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

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

Re: dired not loading directory if in buffer with file from that direct


From: Kevin Rodgers
Subject: Re: dired not loading directory if in buffer with file from that directory
Date: Thu, 29 Nov 2001 12:38:37 -0700

Klaus Straubinger wrote:
> However, I fail to understand why the behaviour of "find-file"
> should be a feature. What benefit do you get from the function
> actually doing nothing?

That's why I have this in my .emacs file:

(defadvice find-file (around find-default-filename-run-dired activate)
  "Run `\\[dired]' on the current directory (instead of reverting the
buffer) when called interactively, if `find-file-run-dired' is set, no
FILENAME is specified, and the buffer hasn't been modified."
  (if (and find-file-run-dired
           (interactive-p)
           (equal (ad-get-arg 0) buffer-file-name)
           (not (buffer-modified-p)))
      (dired (file-name-directory buffer-file-name))
    ad-do-it))

-- 
Kevin Rodgers <kevinr@ihs.com>



reply via email to

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