[Top][All Lists]

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

Re: Keep dired from creating new buffers.

From: Ekkehard Görlach
Subject: Re: Keep dired from creating new buffers.
Date: Fri, 12 Dec 2003 20:55:52 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Some time ago somebody posted the following code I have for that in my

;; 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."
  (let ((filename (dired-get-filename)))
    (if (file-directory-p filename)
        (find-alternate-file filename)

(defun dired-setup-follow-file ()
   'dired-find-file 'dired-follow-file dired-mode-map)
   'dired-advertised-find-file 'dired-follow-file dired-mode-map))
(add-hook 'dired-mode-hook 'dired-setup-follow-file)


reply via email to

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