[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: too many buffers

From: Drew Adams
Subject: RE: too many buffers
Date: Thu, 21 Jan 2010 11:22:11 -0800

> > I didn't get this, I try to open a dired buffer but I see the normal
> > dired.
> Every time you open something with `a' in dired, it replaces the 
> original dired buffer. So you don't end up opening numerous dired 
> buffers while trying to find some file. :)

`a' is command `dired-find-alternate-file', which simply calls
`find-alternate-file', which replaces the current buffer with the new, target
buffer. That might or might not be what you want.

I'm a big fan of `find-alternate-file' (which is bound globally to `C-x C-v') -
I use it very often. But I use it only when I explicitly want it.

Be aware that `a' in Dired always replaces (kills) the current Dired buffer.
IOW, it will not only replace one Dired buffer with another Dired buffer - it
will also replace a Dired buffer with a file buffer. It does not distinguish
between visiting a file and visiting a directory.

That is, if you use `a' on a directory line then it replaces the current Dired
buffer and opens a new one for the line's directory. But if you use `a' on a
file line then it does the same thing: it replaces the current Dired buffer with
a buffer visiting the line's file.

So if you do not want to kill the current Dired buffer then do not use `a' on a
file line.

An alternative approach is to load `dired+.el' and use command
`toggle-dired-find-file-reuse-dir'. That makes the usual Dired file/directory
access keys replace (kill) the current Dired buffer, but only when you visit
another directory.

IOW, it makes `RET', `mouse-2', `e', and `f' reuse (replace) Dired buffers, just
like `a' does. But unlike `a', these keys will not kill the Dired buffer when
you visit a file.

In sum, if you want to always reuse Dired buffers, then turn this on and forget
about it - just use the usual Dired keys.

To cancel this behavior, use the toggle command again. To set this behavior by
default, put this in your .emacs:

 (toggle-dired-find-file-reuse-dir 1)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]