help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Browsing into Subdirectory in Dired in the Same Buffer


From: Xah
Subject: Re: Browsing into Subdirectory in Dired in the Same Buffer
Date: Wed, 29 Oct 2008 07:37:16 -0700 (PDT)
User-agent: G2/1.0

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/

reply via email to

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