GNU bug report logs - #24409
25.1.1; dired-jump: Interactive call w/ prefix arg move to wrong file line

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tino Calancha <tino.calancha <at> gmail.com>
Subject: bug#24409: closed (Re: bug#24409: 25.1.1; dired-jump: Interactive
 call w/ prefix arg move to wrong file line)
Date: Tue, 13 Sep 2016 15:10:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#24409: 25.1.1; dired-jump: Interactive call w/ prefix arg move to wrong file line

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 24409 <at> debbugs.gnu.org.

-- 
24409: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24409
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: 24409-done <at> debbugs.gnu.org
Subject: Re: bug#24409: 25.1.1; dired-jump: Interactive call w/ prefix arg
 move to wrong file line
Date: Wed, 14 Sep 2016 00:09:41 +0900 (JST)
On Tue, 13 Sep 2016, Eli Zaretskii wrote:

>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Date: Tue, 13 Sep 2016 16:04:05 +0900 (JST)
>> cc: Tino Calancha <tino.calancha <at> gmail.com>, 24409 <at> debbugs.gnu.org
>>
>> Once you give me the LGTM i will apply the following corrected patch:
>
> LGTM, thank you.
Thank you.  Pushed fix to master branch as commit 3988ceaa

[Message part 3 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.1; dired-jump: Interactive call w/ prefix arg move to wrong
 file line
Date: Sun, 11 Sep 2016 13:33:04 +0900 (JST)
emacs -Q -eval "(require 'dired-x)"

;; Assumed you have Emacs source code in `source-directory'.
;; Following should visit `lisp' on Dired and set point on `simple.el'.
M-: (find-file (expand-file-name (concat "lisp/dired-x.el") 
source-directory)) RET
C-u C-x C-j simple.el RET

*) The first patch just fix this bug.
*) The second patch makes to work following non-interactive call:
(dired-jump nil (abbreviate-file-name
                 (expand-file-name (concat "lisp/dired-x.el") 
source-directory)))
;; i.e., accepts an UNIX file-name as: "~/foo/bar

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From e7a5a0534ac3f2bb624acb855ddbdbb8cd04c7a3 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sun, 11 Sep 2016 13:14:28 +0900
Subject: [PATCH] dired-jump: Expand file-name after read-file-name call

Fix Bug#24409.
* lisp/dired-x.el (dired-jump):
---
 lisp/dired-x.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 088ca81..7c65a2c 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -413,11 +413,12 @@ 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, move to FILE-NAME line in Dired.
+Interactively with prefix argument, read FILE-NAME."
   (interactive
    (list nil (and current-prefix-arg
-                  (read-file-name "Jump to Dired file: "))))
+                  (expand-file-name
+                   (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))
-- 
2.9.3

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 713d23fd2a0c798df265e29a21d1bd04f483f1b0 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sun, 11 Sep 2016 13:15:26 +0900
Subject: [PATCH] dired-jump: Make sure file-name is expanded

* lisp/dired-x.el (dired-jump): Use expand-file-name on FILE-NAME
before call dired-goto-file (Bug#24409).
---
 lisp/dired-x.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 088ca81..4470a2c 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -413,14 +413,16 @@ 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, move to FILE-NAME line in Dired.
+Interactively with prefix argument, read FILE-NAME."
   (interactive
    (list nil (and current-prefix-arg
-                  (read-file-name "Jump to Dired file: "))))
+                  (expand-file-name
+                   (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))
+    (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.1 (x86_64-pc-linux-gnu, GTK+ Version 3.21.5)
 of 2016-09-10
Repository revision: 0bbdeed10f37d4ce203e1f5feb0cd7c4b5eeec72




This bug report was last modified 8 years and 306 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.