M-x all-things-emacs

Quick Tip: Reuse Dired Buffers

February 25th, 2007 by Ryan McGeary · 41 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

41 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/ [...]

  • 12 chiropractor Omaha, NE // Jul 31, 2015 at 6:23 pm

    ... [Trackback]

    [...] There you will find 93105 more Infos: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 13 Prodaja staklene ambalaze // Aug 1, 2015 at 2:37 am

    ... [Trackback]

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

  • 14 security training // Aug 1, 2015 at 8:22 pm

    ... [Trackback]

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

  • 15 Can I trust my sump pump to work? // Aug 2, 2015 at 6:12 pm

    ... [Trackback]

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

  • 16 why not find out more // Aug 2, 2015 at 7:56 pm

    ... [Trackback]

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

  • 17 www.optimumcontractors.com // Aug 2, 2015 at 8:32 pm

    ... [Trackback]

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

  • 18 http://tiptoproofers.net // Aug 2, 2015 at 10:25 pm

    ... [Trackback]

    [...] There you will find 39670 more Infos: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 19 buy online ventolin 100 mcg without rx // Aug 3, 2015 at 1:49 pm

    ... [Trackback]

    [...] There you will find 94073 more Infos: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 20 http://tiptophvac.com // Aug 4, 2015 at 1:08 am

    ... [Trackback]

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

  • 21 What is the advance measurement system? // Aug 4, 2015 at 1:32 am

    ... [Trackback]

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

  • 22 www.supremecontracting.net // Aug 4, 2015 at 2:58 am

    ... [Trackback]

    [...] There you will find 34547 more Infos: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 23 find more // Aug 4, 2015 at 12:44 pm

    ... [Trackback]

    [...] There you will find 44389 more Infos: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 24 social signals Pinterest // Aug 5, 2015 at 7:03 am

    ... [Trackback]

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

  • 25 http://skillfullcontracting.com // Aug 5, 2015 at 7:15 am

    ... [Trackback]

    [...] There you will find 11911 more Infos: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 26 solar energy and solar panels // Aug 5, 2015 at 11:02 am

    ... [Trackback]

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

  • 27 permanent skin whitening treatment // Aug 6, 2015 at 5:29 am

    ... [Trackback]

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

  • 28 foto bugil // Aug 7, 2015 at 8:46 am

    ... [Trackback]

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

  • 29 Buy Social Signals // Aug 8, 2015 at 10:12 pm

    ... [Trackback]

    [...] There you will find 24613 more Infos: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 30 link // Aug 9, 2015 at 6:53 pm

    ... [Trackback]

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

  • 31 see this // Aug 11, 2015 at 12:07 am

    ... [Trackback]

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

  • 32 view // Aug 12, 2015 at 10:18 pm

    ... [Trackback]

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

  • 33 navigate here // Aug 13, 2015 at 11:39 pm

    ... [Trackback]

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

  • 34 http://www.optimumdentist.com // Aug 14, 2015 at 12:07 am

    ... [Trackback]

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

  • 35 www.majesticplumbers.com // Aug 14, 2015 at 4:33 am

    ... [Trackback]

    [...] There you will find 89208 more Infos: emacsblog.org/2007/02/25/quick-tip-reuse-dired-buffers/ [...]

  • 36 try this // Aug 14, 2015 at 4:47 am

    ... [Trackback]

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

  • 37 Who is responsible for fence repair and maintenance? // Aug 14, 2015 at 4:49 am

    ... [Trackback]

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

  • 38 commercial glass repair // Aug 14, 2015 at 4:55 am

    ... [Trackback]

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

  • 39 garage clean up // Aug 14, 2015 at 7:25 am

    ... [Trackback]

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

  • 40 mold removal contractors // Aug 14, 2015 at 1:53 pm

    ... [Trackback]

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

  • 41 custom ductwork install // Aug 14, 2015 at 1:53 pm

    ... [Trackback]

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