Commit 3988ceaa authored by Tino Calancha's avatar Tino Calancha
Browse files

dired-jump: Expand file-name before dired-goto-file call

Command dired-goto-file requires its argument to be an absolute
file name.  Interactively FILE-NAME is read with read-file-name,
which could return an abbreviated file name (Bug#24409).
* lisp/dired-x.el (dired-jump): Use expand-file-name on FILE-NAME.
Clarify in doc string the meaning of arg FILE-NAME.
parent 469fcaa7
......@@ -413,14 +413,19 @@ 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.
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."
When FILE-NAME is non-nil, jump to its line in Dired.
Interactively with prefix argument, read FILE-NAME."
(list nil (and current-prefix-arg
(read-file-name "Jump to Dired file: "))))
(if (bound-and-true-p tar-subfile-mode)
(switch-to-buffer tar-superior-buffer)
(let* ((file (or file-name buffer-file-name))
;; Expand file-name before `dired-goto-file' call:
;; `dired-goto-file' requires its argument to be an absolute
;; file name; the result of `read-file-name' could be
;; an abbreviated file name (Bug#24409).
(let* ((file (or (and file-name (expand-file-name file-name))
(dir (if file (file-name-directory file) default-directory)))
(if (and (eq major-mode 'dired-mode) (null file-name))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment