From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Tino Calancha <tino.calancha@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#24409: 25.1.1;
	dired-jump: Interactive call w/ prefix arg move to wrong file line
Date: Mon, 12 Sep 2016 02:03:14 +0900 (JST)
Message-ID: <alpine.DEB.2.20.1609120159040.14684@calancha-pc>
References: <alpine.DEB.2.20.1609111332220.5847@calancha-pc>
	<83a8febg8c.fsf@gnu.org>
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII
X-Trace: blaine.gmane.org 1473613466 31573 195.159.176.226 (11 Sep 2016 17:04:26 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 11 Sep 2016 17:04:26 +0000 (UTC)
User-Agent: Alpine 2.20 (DEB 67 2015-01-07)
Cc: 24409@debbugs.gnu.org, Tino Calancha <tino.calancha@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 11 19:04:22 2016
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1bj8Ay-0007Jj-SM
	for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 19:04:17 +0200
Original-Received: from localhost ([::1]:38433 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1bj8Ax-0004GN-2N
	for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 13:04:15 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60403)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1bj8Aq-0004G4-12
	for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 13:04:09 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1bj8Aj-0005LG-TO
	for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 13:04:06 -0400
Original-Received: from debbugs.gnu.org ([208.118.235.43]:58954)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1bj8Aj-0005LC-Pu
	for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 13:04:01 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
	(envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1bj8Aj-0003Xp-KC
	for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 13:04:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Tino Calancha <tino.calancha@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 11 Sep 2016 17:04:01 +0000
Resent-Message-ID: <handler.24409.B24409.147361340413573@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 24409
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
Original-Received: via spool by 24409-submit@debbugs.gnu.org id=B24409.147361340413573
	(code B ref 24409); Sun, 11 Sep 2016 17:04:01 +0000
Original-Received: (at 24409) by debbugs.gnu.org; 11 Sep 2016 17:03:24 +0000
Original-Received: from localhost ([127.0.0.1]:56666 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1bj8A8-0003Wr-9W
	for submit@debbugs.gnu.org; Sun, 11 Sep 2016 13:03:24 -0400
Original-Received: from mail-pa0-f53.google.com ([209.85.220.53]:35902)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <tino.calancha@gmail.com>) id 1bj8A6-0003Wb-T1
	for 24409@debbugs.gnu.org; Sun, 11 Sep 2016 13:03:23 -0400
Original-Received: by mail-pa0-f53.google.com with SMTP id id6so43468865pad.3
	for <24409@debbugs.gnu.org>; Sun, 11 Sep 2016 10:03:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 
	h=from:date:to:cc:subject:in-reply-to:message-id:references
	:user-agent:mime-version;
	bh=YqXwn9jkoRf5OJFH/hwcMj0FUKgB2wFmi9FbPcNVC5k=;
	b=SfkFxJfIdAQFcStnTf0O7fjbayj9hBpf0gzOLgbMwAJPlbirwYDJODPpbMoj4YoFov
	N3RfYyLEzSv5nA5WqyiHs30Ej2Ywx7PO4yXSSmZDDr1XXNw9dOAFfvrP8OHHrHbPWyoP
	15mwKsUM3+1lDxvs+0VspAb+6eWQPKtkapN+u7g8rao1iy3t/d78vGQibdvCmvaG1Z4E
	7ntmn1h/r2NDwJk+lm6cbPp4/TBO/2QsqF+gDonWL7U9oNZ6RNqxqWOiPv1PmBmq0k4j
	e3TigBwcMg6wGAO+1tlkqTNryqUvF5n6JduN/MSXZio04RFhGXfRk42g99A72GYOqCcD
	4Zxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id
	:references:user-agent:mime-version;
	bh=YqXwn9jkoRf5OJFH/hwcMj0FUKgB2wFmi9FbPcNVC5k=;
	b=mYkEmXrKm2OEN6HGqB+im5opKM6vCJgfHYt9JbOo5SXfrKtnBorHwGPA7VJP/jfO6j
	ADaurGldA0G9hDgdwkNr37JvS3YNRbzUzXgTjEbznOZxOQQiekIOyUCMnz+2kkJ2HfCN
	AbLTUfO/ZW9cnuehhZGzeEWhIn/p1928EKckTzmqpgmXefc+XcIA8iS3eh5U+jONTr3H
	xFiggWCDHSV5hX4b/DjRhV6oJQzc4+rE/b+dWHlji7wTP6uoT6WKDlTmr6YCWrGgAq/0
	2D5z0/wne3HHk5gyP4oJxoT7Ux3Xd4NCHbaKETDcFSJYI6QAEI1M1MqkUG/jO7BuRB/2
	0LUQ==
X-Gm-Message-State: AE9vXwNU1ChqR4AO8/X08pqzi/Bu91oKqEcEJZFq3T2evNiKz5lHhkM1oUX2xjpBAUV3ng==
X-Received: by 10.66.220.106 with SMTP id pv10mr25574633pac.81.1473613397083; 
	Sun, 11 Sep 2016 10:03:17 -0700 (PDT)
Original-Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57])
	by smtp.gmail.com with ESMTPSA id 7sm18691907pfk.6.2016.09.11.10.03.15
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sun, 11 Sep 2016 10:03:16 -0700 (PDT)
X-Google-Original-From: Tino Calancha <calancha@gmail.com>
X-X-Sender: calancha@calancha-pc
In-Reply-To: <83a8febg8c.fsf@gnu.org>
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
	the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-emacs/>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
	<mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: "bug-gnu-emacs"
	<bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Xref: news.gmane.org gmane.emacs.bugs:123182
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/123182>



On Sun, 11 Sep 2016, Eli Zaretskii wrote:

> Thanks.  A few nits:
>
> Please be sure to explain the need for the expand-file-name call
> either in a comment or in the log message.

> Also, you fixed the do string (thanks!), but didn't mention that in
> the log message.
*) Please, take a look in the new patch below with more verbose log 
message/comments.
*) Where should go the fix: emacs-25 branch or master?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>From fcb693f38657c2e47e6bb3116a781bebaea1d3ea Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Mon, 12 Sep 2016 01:53:44 +0900
Subject: [PATCH] dired-jump: Expand file-name before dired-goto-file call

* lisp/dired-x.el (dired-jump): Use expand-file-name on FILE-NAME
before dired-goto-file call: this is mandatory in interactive
calls (Bug#24409); in non-interactive calls is also desirable
in order to accept an abbreviated FILE-NAME as  ~/dir/file.
Clarify in doc string the meaning of arg FILE-NAME.
---
  lisp/dired-x.el | 12 +++++++++---
  1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 088ca81..2a9bd72 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -413,14 +413,20 @@ 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: "))))
    (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 calling `dired-goto-file':
+    ;; This is required in interactive calls because the return value
+    ;; of `read-file-name' is not expanded; it also helps in
+    ;; non-interactive calls, where file-name could be an abbreviated
+    ;; file name as ~/dir/file (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.1 (x86_64-pc-linux-gnu, GTK+ Version 3.21.5)
  of 2016-09-12
Repository revision: 0bbdeed10f37d4ce203e1f5feb0cd7c4b5eeec72