From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?q?Ekkehard_G=F6rlach?= Newsgroups: gmane.emacs.help Subject: Re: Keep dired from creating new buffers. Date: Fri, 12 Dec 2003 20:55:52 +0100 Organization: T-Online Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1071259580 23610 80.91.224.253 (12 Dec 2003 20:06:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 Dec 2003 20:06:20 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 12 21:06:14 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AUtYE-00062r-00 for ; Fri, 12 Dec 2003 21:06:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AUuVc-00062k-Pz for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Dec 2003 16:07:36 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!feed.news.tiscali.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-X-Trace: news.t-online.com 1071258833 00 16488 SG1EGi4v+oymiIn 031212 19:53:53 Original-X-Complaints-To: usenet-abuse@t-online.de X-ID: E6A1b0ZrYeFmQ4yVv2wPNWXFTzibKpoK-5uH8Cz+zYUvcAIQMCIWgi User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:Bz6CGBARUtEJ50IWCsSOVuMGnSA= Original-Xref: shelby.stanford.edu gnu.emacs.help:119272 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:15208 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15208 Some time ago somebody posted the following code I have for that in my .emacs: ;; dired customization (defun dired-follow-file () "In dired, visit the file or directory on this line. If a directory is on the current line, replace the current Dired buffer with one containing the contents of the directory. Otherwise, invoke `dired-find-file' on the file." (interactive) (let ((filename (dired-get-filename))) (if (file-directory-p filename) (find-alternate-file filename) (dired-find-file)))) (defun dired-setup-follow-file () (substitute-key-definition 'dired-find-file 'dired-follow-file dired-mode-map) (substitute-key-definition 'dired-advertised-find-file 'dired-follow-file dired-mode-map)) (add-hook 'dired-mode-hook 'dired-setup-follow-file) HTH, Ekkehard