From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: Browsing into Subdirectory in Dired in the Same Buffer Date: Wed, 29 Oct 2008 07:37:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <763f27d0-7eae-42be-915a-a56a43c542f7@p31g2000prf.googlegroups.com> References: <4c61625d-87eb-403b-861b-acaed98505c6@p39g2000hsb.googlegroups.com> <878ws7k5v0.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1225291340 1922 80.91.229.12 (29 Oct 2008 14:42:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2008 14:42:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 29 15:43:22 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KvCGQ-0002sh-Rm for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Oct 2008 15:43:15 +0100 Original-Received: from localhost ([127.0.0.1]:34960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvCFK-0000xM-Hj for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Oct 2008 10:42:06 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!p31g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 61 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1225291036 28984 127.0.0.1 (29 Oct 2008 14:37:16 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 29 Oct 2008 14:37:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p31g2000prf.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163896 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59237 Archived-At: 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 "") '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 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 =E2=80=9CClose=E2=80=9D, 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 =E2=80=9C*=E2=80=9D. A user can easily have tens of these buffers after a d= ay'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 =E2=88=91 http://xahlee.org/ =E2=98=84