aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTino Calancha2016-09-14 00:04:32 +0900
committerTino Calancha2016-09-14 00:04:32 +0900
commit3988ceaa1cfa2022443906750cbb30127a1e161f (patch)
treeac9f5cd2833d85b7ed1dbb73309ae376e7793a5d
parent469fcaa7f8d2ad57571a0af55a4082700345e4a5 (diff)
downloademacs-3988ceaa1cfa2022443906750cbb30127a1e161f.tar.gz
emacs-3988ceaa1cfa2022443906750cbb30127a1e161f.zip
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.
-rw-r--r--lisp/dired-x.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index be762e6e306..41c2256ec6f 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -413,14 +413,19 @@ If in Dired already, pop up a level and goto old directory's line.
413In case the proper Dired file line cannot be found, refresh the dired 413In case the proper Dired file line cannot be found, refresh the dired
414buffer and try again. 414buffer and try again.
415When OTHER-WINDOW is non-nil, jump to Dired buffer in other window. 415When OTHER-WINDOW is non-nil, jump to Dired buffer in other window.
416Interactively with prefix argument, read FILE-NAME and 416When FILE-NAME is non-nil, jump to its line in Dired.
417move to its line in dired." 417Interactively with prefix argument, read FILE-NAME."
418 (interactive 418 (interactive
419 (list nil (and current-prefix-arg 419 (list nil (and current-prefix-arg
420 (read-file-name "Jump to Dired file: ")))) 420 (read-file-name "Jump to Dired file: "))))
421 (if (bound-and-true-p tar-subfile-mode) 421 (if (bound-and-true-p tar-subfile-mode)
422 (switch-to-buffer tar-superior-buffer) 422 (switch-to-buffer tar-superior-buffer)
423 (let* ((file (or file-name buffer-file-name)) 423 ;; Expand file-name before `dired-goto-file' call:
424 ;; `dired-goto-file' requires its argument to be an absolute
425 ;; file name; the result of `read-file-name' could be
426 ;; an abbreviated file name (Bug#24409).
427 (let* ((file (or (and file-name (expand-file-name file-name))
428 buffer-file-name))
424 (dir (if file (file-name-directory file) default-directory))) 429 (dir (if file (file-name-directory file) default-directory)))
425 (if (and (eq major-mode 'dired-mode) (null file-name)) 430 (if (and (eq major-mode 'dired-mode) (null file-name))
426 (progn 431 (progn