M-x all-things-emacs

Quick Tip: Reuse Dired Buffers

February 25th, 2007 by Ryan McGeary · 11 Comments

By default, dired creates new buffers when visiting new directories. Sometimes this is desired, especially when you need to visualize the contents of two separate directories; however, when you’re just navigating around, all the extra buffers tend to clutter your buffer list.

Typical navigation is done with dired-find-file (bound to f, RET, or e) or dired-find-file-other-window (bound to o). When performed on a directory, this visits the directory in a new dired buffer. In Emacs 22, instead try running dired-find-alternate-file (bound to a). This replaces the current buffer keeping the clutter of dired buffers to a minimum.

When you run dired-find-alternate-file for the first time, you’ll receive a warning that the function is disabled. You can either follow the built-in instructions and customizations to enable the function, or you can add the following to your .emacs.

(put 'dired-find-alternate-file 'disabled nil)

Bibliography

GNU Emacs Manual, Visiting Files in Dired

EmacsWiki, DiredReuseDirectoryBufferincludes other ways to enable similar behavior in Emacs 21.

Tags: dired · quick · tips

11 responses so far ↓

  • 1 Eric // Feb 26, 2007 at 4:39 pm

    I always figured it was possible, but never got around to looking into it. Thanks!

  • 2 Personal Trainer Seattle // Jul 22, 2015 at 1:10 am

    ... [Trackback]

    [...] Find More Informations here: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 3 amazin gas station video // Jul 24, 2015 at 8:55 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 4 dwi defense lawyer // Jul 24, 2015 at 9:29 pm

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 5 defense attorney // Jul 24, 2015 at 11:26 pm

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 6 special occasions limo service // Jul 25, 2015 at 1:55 pm

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 7 locksmith orangevale ca // Jul 26, 2015 at 6:25 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 8 Roseville Locksmith // Jul 26, 2015 at 6:31 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 9 link // Jul 27, 2015 at 9:05 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 10 Marsna Design // Jul 27, 2015 at 2:54 pm

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 11 http://vmaz.me/rtl-jetzt-kostenlos-im-online-live-stream-gucken-so-gehts/ // Jul 28, 2015 at 9:43 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]