GNU bug report logs -
#24409
25.1.1; dired-jump: Interactive call w/ prefix arg move to wrong file line
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sun, 11 Sep 2016 04:35:01 UTC
Severity: minor
Found in version 25.1.1
Done: Tino Calancha <tino.calancha <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 24409 <at> debbugs.gnu.org (full text, mbox):
On Mon, 12 Sep 2016, Eli Zaretskii wrote:
>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Date: Mon, 12 Sep 2016 13:37:14 +0900 (JST)
>> cc: Tino Calancha <tino.calancha <at> gmail.com>, 24409 <at> debbugs.gnu.org
>>
>>> I think a better comment would be to say that dired-goto-file requires
>>> its argument to be an absolute file name, and the result of
>>> read-file-name could be an abbreviated file name.
>> Thank you. I rewrote the comment/log message with your suggestion.
>> I included the word canonical: an abbreviated file name could be
>> an absolute file name, for instance ~/foo, but dired-goto-file,
>> in addition to absolute file name, requires the substitution of '~/'.
>
> We don't have a notion of a "canonical" file name in Emacs, so I'm not
> sure this helps. OTOH, "absolute file name" is quite clear, and I
> don't think people will be confused by the fact that ~/foo returns
> non-nil from file-name-absolute-p.
Ok, i will not use the word canonical.
>> +When FILE-NAME is non-nil, move to FILE-NAME line in Dired.
>
> "When FILE-NAME is non-nil, jump to its line in Dired."
> (Try to avoid saying the same thing twice too close to one another.)
Added. Thank you very much.
Once you give me the LGTM i will apply the following corrected patch:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From e1541dd78cb5bf81247bd4025a603cef81f3a3cb Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Tue, 13 Sep 2016 15:59:45 +0900
Subject: [PATCH] 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.
---
lisp/dired-x.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index be762e6..41c2256 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -413,14 +413,19 @@ dired-jump
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."
(interactive
(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))
+ buffer-file-name))
(dir (if file (file-name-directory file) default-directory)))
(if (and (eq major-mode 'dired-mode) (null file-name))
(progn
--
2.9.3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.21.5)
of 2016-09-13
Repository revision: 367f8568bc9e759ebdfb423648891efa0346456b
This bug report was last modified 8 years and 255 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.