4 ms·
Dired is an abomination filling up your buffer list as you traverse directories.
by cutler 4y ago
Dired is an abomination filling up your buffer list as you traverse directories.
- arc-in-space 4y agoI use tabbar and confine dired buffers to their own group, which makes it actually useful that they stick around.
- yaantc 4y agoFrom Emacs 28 onward, set 'dired-kill-when-opening-new-dired-buffer' to 't'. It will kill the previous buffer when opening a new directory.
- trey-jones 4y agoAbomination is not the word I would use. I also find it to be indispensable, whatever it does to my buffer list.
- alex_smart 4y agohttps://github.com/emacs-mirror/emacs/commit/5afe27624f7 https://github.com/emacs-mirror/emacs/commit/5afe27624f7 This is the patch that added the feature you wanted to dired. 30 lines of diff, 20 of which is documentation. Calling a piece of exceptional software an "abomination" because of one specific behavior that you find annoying is the wrong attitude to have, especially for an emacs user. It is emacs. You can make it do whatever you want within a few lines of lisp.
- cutler 4y agoOk, perhaps "abomination" was excessive but, seriously, why is opening a new buffer each time you traverse a directory a sane default?
- alex_smart 4y agoYour assumption is that the state of a dired buffer is trivial to recreate so should be thrown away. While that is the case in the simplest use case of using dired as a replacement of a bog-standard file browser, it is possible for the state of the dired buffer to be more complicated. For example, the buffer could contain marks and flags for some batch operation the user was working on before they decided to visit a subdirectory. The dired buffer may not even correspond to just one directory but may be a result of a complex find operation or may contain some arbitrary set of directories the user manually curated. It would certainly not be nice to the user to lose all this state accidentally. This is why emacs takes the conservative approach and chooses not to throw away dired buffers by default and gives the users the option of choosing to do discard the current buffer consciously by using the "find-find-alternate" command (bound to "a" by default in dired-mode-map).