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

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

Re: C-x C-f RET sometimes ignores you


From: Kevin Rodgers
Subject: Re: C-x C-f RET sometimes ignores you
Date: Mon, 02 Apr 2001 15:33:18 -0600

Dan Jacobson wrote:
> Start up emacs, in the scratch buffer do C-x C-f RET
> This invokes dired on the home directory.  Good.
> 
> Start up emacs, find some file, then do C-x C-f RET
> This does nothing.  Bad.

(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 <address@hidden>          Lead Software Engineer
Information Handling Services           Electronic Systems Development
15 Inverness Way East, M/S A114         GO BUFFS!
Englewood CO 80112-5776 USA             1+ (303)
397-2807[voice]/705-4258[fax]



reply via email to

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