diff options
author | Juri Linkov <juri@jurta.org> | 2007-11-23 00:33:48 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2007-11-23 00:33:48 +0000 |
commit | b3acb094ec7180eb596a51e22efe72d98cec1d46 (patch) | |
tree | f7f4f841fa849c667a477fd69066929017736c28 /lisp/dired.el | |
parent | 8783fe91be449416e1aab353afed54ff965c236f (diff) | |
download | emacs-b3acb094ec7180eb596a51e22efe72d98cec1d46.tar.gz emacs-b3acb094ec7180eb596a51e22efe72d98cec1d46.tar.bz2 emacs-b3acb094ec7180eb596a51e22efe72d98cec1d46.zip |
(dired-read-dir-and-switches): For C-x d, set the value for M-n to the
visited file name of the current buffer. Use minibuffer-with-setup-hook
to set minibuffer-default to buffer-file-name inside read-file-name.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r-- | lisp/dired.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 4502609013b..ab56579e718 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -595,8 +595,12 @@ Don't use that together with FILTER." (if (next-read-file-uses-dialog-p) (read-directory-name (format "Dired %s(directory): " str) nil default-directory nil) - (read-file-name (format "Dired %s(directory): " str) - nil default-directory nil))))) + (let ((default (and buffer-file-name + (abbreviate-file-name buffer-file-name)))) + (minibuffer-with-setup-hook + (lambda () (setq minibuffer-default default)) + (read-file-name (format "Dired %s(directory): " str) + nil default-directory nil))))))) ;;;###autoload (define-key ctl-x-map "d" 'dired) ;;;###autoload |