unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Browsing into Subdirectory in Dired in the Same Buffer
Date: Wed, 29 Oct 2008 07:37:16 -0700 (PDT)	[thread overview]
Message-ID: <763f27d0-7eae-42be-915a-a56a43c542f7@p31g2000prf.googlegroups.com> (raw)
In-Reply-To: mailman.2367.1225288108.25473.help-gnu-emacs@gnu.org

Thanks for the tip on dired-find-alternate-file. This is something
i've desired.

Now i put it into a hook:

(add-hook 'dired-mode-hook
 (lambda ()
  (define-key dired-mode-map (kbd "<return>") 'dired-find-alternate-
file) ; was dired-advertised-find-file
  (define-key dired-mode-map (kbd "^") (lambda () (interactive) (find-
alternate-file ".."))) ; was dired-up-directory
 ))


On Oct 29, 6:48 am, Lave <lave.wan...@gmail.com> wrote:
> It's nice. I copied it, thanks.
>
> But, I used to 'v' to view a directory, and 'q' buried it, then I can
> see the previous again, although there are too many buffers. Is there
> a method to go back the previous viewed directory?

i think that having too many buffers is a usability problem. As far as
i know, many old emacs users typically adapted the habit of leaving
hundreds of buffers open.

The reason that people leave buffers open in emacs is because, in my
opinion, emacs lacks a easy way to close buffer. Specifically, the
command kill-buffer (Ctrl+x k) will prompt the user whether he wants
to kill for sure, even though the bufer is not modified. Then, there's
the menu command “Close”, which calls kill-this-buffer. But it doesn't
have a keyboard shortcut.

My own solution to this is to create a keyboard shortcut for Close,
when called, it prompt to save only if file is modified. This way, it
works around kill-buffer's extraneous prompting.

Related to this is that kill-buffer and kill-this-buffer both do not
prompt to save when the buffer is not associated with a file. This
easily cause data lose. So, i modified my close command so that it
will prompt to save if it is a buffer not associated with file but has
content.

Related is that, now you easily close a buffer, but when you close
one, often the one shown is one of the emacs's buffers (e.g.
*Messages*, shell output, comman completion, lossage, info, man page,
dictionary lookup, word spelling suggestions, etc those starting with
“*”. A user can easily have tens of these buffers after a day's use of
emacs.) Typically user don't care about these buffers after having
viewed them once. So, i think it's beffer that the next buffer shown
after a Close buffer call should be one of user's buffers.

i have implemented the above code here:
http://xahlee.org/emacs/ergonomic_emacs_keybinding.html

  Xah
∑ http://xahlee.org/

  parent reply	other threads:[~2008-10-29 14:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29  8:46 Browsing into Subdirectory in Dired in the Same Buffer stephan.zimmer
2008-10-29 11:17 ` Tassilo Horn
2008-10-29 11:40   ` Paul R
2008-10-29 13:48   ` Lave
2008-10-29 14:49     ` Tassilo Horn
2008-10-29 15:03       ` Paul R
2008-10-29 23:01         ` Lave
     [not found]   ` <mailman.2367.1225288108.25473.help-gnu-emacs@gnu.org>
2008-10-29 14:37     ` Xah [this message]
2008-10-29 13:35 ` Drew Adams
2008-10-30  2:01 ` Joe Casadonte

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=763f27d0-7eae-42be-915a-a56a43c542f7@p31g2000prf.googlegroups.com \
    --to=xahlee@gmail.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).