[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-x C-f RET problem...
From: |
Colin Walters |
Subject: |
Re: C-x C-f RET problem... |
Date: |
16 May 2002 15:02:02 -0400 |
On Thu, 2002-05-16 at 03:45, Pavel Janík wrote:
> my users found the behavior of C-x C-f RET quite inconsistent with the rest
> of Emacs. After typing C-x C-f you will see the current directory in the
> minibuffer. Just after RET you *can* expect to see your current directory
> opened in dired. Well, I'm quite used to the current behavior so
> I personally do not have problem with it, but my users found it quite
> irritating: "How is it possible that C-x C-f and the directory opens file
> and not that directory?".
>
> What do you think?
I agree with Miles in that it's not something we should change lightly.
But I've been using Kevin Rodgers' defadvice for a long time, and been
very happy:
;; From Kevin Rodgers
(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))