unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <help-gnu-emacs@gnu.org>
Subject: RE: too many buffers
Date: Thu, 21 Jan 2010 11:22:11 -0800	[thread overview]
Message-ID: <0AFF3EEB5FC24AA4A86C6E03301D6FC3@us.oracle.com> (raw)
In-Reply-To: <4B588448.1040206@gmail.com>

> > 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)

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






  reply	other threads:[~2010-01-21 19:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-17 14:09 too many buffers andrea
2010-01-17 15:37 ` Peter Dyballa
2010-01-17 17:58 ` Sean Sieger
2010-01-18  5:07 ` Thien-Thi Nguyen
2010-01-20 19:06 ` Sam Steingold
2010-01-20 21:03   ` Thierry Volpiatto
2010-01-20 22:17     ` Suvayu Ali
2010-01-20 22:34       ` Thierry Volpiatto
2010-01-21 16:25         ` andrea
2010-01-21 16:43           ` Suvayu Ali
2010-01-21 19:22             ` Drew Adams [this message]
     [not found] <mailman.1572.1263737418.18930.help-gnu-emacs@gnu.org>
2010-01-17 15:45 ` Galen Boyer
2010-01-17 16:15 ` Florian Diesch
2010-01-17 21:25 ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0AFF3EEB5FC24AA4A86C6E03301D6FC3@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).