diff options
author | Juri Linkov <juri@jurta.org> | 2010-05-21 00:33:58 +0300 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2010-05-21 00:33:58 +0300 |
commit | f5d6548ac93ed6b2c5eb06bfe93e2f531ddd72e0 (patch) | |
tree | 5aa2773a7ff331e7e3afeb88607866fc17e960a3 /lisp/dired-x.el | |
parent | f8e6369193666ccd4e38b1ed490042a2a7ce5c91 (diff) | |
download | emacs-f5d6548ac93ed6b2c5eb06bfe93e2f531ddd72e0.tar.gz |
* dired-x.el (dired-jump, dired-jump-other-window): Add arg
FILE-NAME to read from the minibuffer when called interactively
with prefix argument instead of using buffer-file-name.
http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00534.html
* dired.el: Update autoloads.
Diffstat (limited to 'lisp/dired-x.el')
-rw-r--r-- | lisp/dired-x.el | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index aba4b7a7a9d..2dc7475e9e3 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -506,16 +506,21 @@ See variables `dired-texinfo-unclean-extensions', ;;; JUMP. ;;;###autoload -(defun dired-jump (&optional other-window) +(defun dired-jump (&optional other-window file-name) "Jump to dired buffer corresponding to current buffer. If in a file, dired the current directory and move to file's line. If in Dired already, pop up a level and goto old directory's line. In case the proper dired file line cannot be found, refresh the dired -buffer and try again." - (interactive "P") - (let* ((file buffer-file-name) +buffer and try again. +When OTHER-WINDOW is non-nil, jump to dired buffer in other window. +Interactively with prefix argument, read FILE-NAME and +move to its line in dired." + (interactive + (list nil (and current-prefix-arg + (read-file-name "Jump to dired file: ")))) + (let* ((file (or file-name buffer-file-name)) (dir (if file (file-name-directory file) default-directory))) - (if (eq major-mode 'dired-mode) + (if (and (eq major-mode 'dired-mode) (null file-name)) (progn (setq dir (dired-current-directory)) (dired-up-directory other-window) @@ -539,10 +544,12 @@ buffer and try again." (dired-omit-mode) (dired-goto-file file)))))))) -(defun dired-jump-other-window () +(defun dired-jump-other-window (&optional file-name) "Like \\[dired-jump] (`dired-jump') but in other window." - (interactive) - (dired-jump t)) + (interactive + (list (and current-prefix-arg + (read-file-name "Jump to dired file: ")))) + (dired-jump t file-name)) ;;; OMITTING. |