Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

When I use dired mode to browse around and find a file I want to open in Emacs, dired opens a new buffer for each directory I visit when looking for the file each time I select a directory with Enter, which means I can end up with a lot of buffers I don't want:

. * newer                    0  Fundamental       c:/work/stackoverflow/batch/mydir/newer
 %  mydir                  302  Dired by name     c:/work/stackoverflow/batch/mydir/
 %  batch                  616  Dired by name     c:/work/stackoverflow/batch/
 %  stackoverflow         1017  Dired by name     c:/work/stackoverflow/
 %  work                  2545  Dired by name     c:/work/
  * *scratch*              190  Lisp Interaction
 %  *Completions*          162  Completion List
  * *Messages*            2163  Fundamental

Is there any way to make dired re-use a single buffer? I tried M-x customize-group for group dired but didn't see anything promising in there.

Alternatively, does anyone have a macro to close all open dired buffers?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
600 views
Welcome To Ask or Share your Answers For Others

1 Answer

Use a (dired-find-alternate-file) instead of Enter

Also, see this page:

http://www.emacswiki.org/emacs/DiredReuseDirectoryBuffer


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...