Emacs dired-mode as a file manager
Published on: 2025-06-23 19:46:57
I'm sure some of you reading this are rolling your eyes or reciting the well-known "Emacs is a great OS, but …" I use it a lot, though. I already use dired-mode to manage my writing and programming. It's something that is powerful, and comfortable to use. If you are following along and use something else, it is also quite easy to adjust my code here as well.
Ok, with that out of the way let's look at what we actually want to do: xdg-mime needs to connect "Opening a directory" with "opening emacs in dired-mode ." First, we need the MIME type for directories. A quick search shows that it is called inode/directory .
I have no idea why it is called inode/directory, and I couldn't find an explanation. I've learned not to ask questions about these names.
Opening emacs in dired-mode is the easy part: if you pass emacs a directory instead of a file, it automatically opens in the appropriate mode. Great! Now we need to tie these two concepts together.
If we were using a non-declarative syst
... Read full article.