From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#24409: 25.1.1; dired-jump: Interactive call w/ prefix arg move to wrong file line Date: Sun, 11 Sep 2016 13:50:04 +0900 (JST) Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Trace: blaine.gmane.org 1473569487 3814 195.159.176.226 (11 Sep 2016 04:51:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2016 04:51:27 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: 24409@debbugs.gnu.org, Tino Calancha To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 11 06:51:22 2016 Return-path: 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 ) id 1biwja-0007wX-Kp for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 06:51:14 +0200 Original-Received: from localhost ([::1]:36531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biwjY-0005jO-Jm for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 00:51:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biwjR-0005jJ-SN for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:51:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biwjO-0006zW-Po for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:51:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biwjO-0006zP-LU for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1biwjO-0007sT-AN for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2016 04:51:02 +0000 Resent-Message-ID: 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.147356941630224 (code B ref 24409); Sun, 11 Sep 2016 04:51:02 +0000 Original-Received: (at 24409) by debbugs.gnu.org; 11 Sep 2016 04:50:16 +0000 Original-Received: from localhost ([127.0.0.1]:55895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biwie-0007rQ-CI for submit@debbugs.gnu.org; Sun, 11 Sep 2016 00:50:16 -0400 Original-Received: from mail-pf0-f173.google.com ([209.85.192.173]:34006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biwic-0007rE-Q9 for 24409@debbugs.gnu.org; Sun, 11 Sep 2016 00:50:15 -0400 Original-Received: by mail-pf0-f173.google.com with SMTP id p64so42109071pfb.1 for <24409@debbugs.gnu.org>; Sat, 10 Sep 2016 21:50:14 -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=/yykvPWmlAZwxjRY/7QTDEP+OBPOCHaD+iejEDRRjvI=; b=ZJcmLxedB4Bbdq9nqTptHxy8itlkHdjsfOutIGQrNJQAulN6Wmzl1O+swQ0ok1Pep0 tEHeuD3CwpkErtwBaowAcZYHR9y0zGiTteitTLat4im9Ed4flj3pBnwzbFDSqn0wMfe+ ubizGqE2d4GDA7US5cgyYsp+eOm7/A5uCa1saZC1vyRkeOCUJzzTCLWliSDqZ5SUywKs 7qOkr+PB4nYSV0qX5tH2qawAhHFpoUbFHnJWGnEASPAag00tryuj9mv45DY+wr5Y9Vc5 MWGquJjsSYrjITiQsDNJ/LMGXJjH16Nd9THaswiCmeCJVUV9fDShd1euhYv+O4dC4HMo LU2A== 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=/yykvPWmlAZwxjRY/7QTDEP+OBPOCHaD+iejEDRRjvI=; b=OaDLBgK0eqGtWH5EYg9DBjrGP1DbcdnGr3lyCly6y5aVZB7ZbtCoBa14XxXZez4KMT 1n2fWZDpg1svpOzdA2KGkf87hPnqcSlTLWZqkw5OsH8+h9Hzp2UMKBZvSJlybRwj6+58 6hYm978aGnpNCbr14bMwosqCweB6ylzGV0rUxIYPA0/yds9HGpdwtTDMb+kzQIW2x6P1 +F/j3Qt5/XGPhX/QW6/6sGPmCtm2Ogm1WSQuAW8tS7JFINXOlB5V5zF/jEXe8P67Sv6C 7ewnymaPrnCsPmwCy+iXsVl6V7W2yBKca7yo5W8dZzdo7mEs7iFVoVfYrUzwxOLfqNpf /hgQ== X-Gm-Message-State: AE9vXwO+P7hO2mRyPCVjnE5f9td4TT5Au1nu3LbJe2V9oeuWOTTlZ+rCX9Wyipgk8SD+ug== X-Received: by 10.98.19.196 with SMTP id 65mr21234029pft.121.1473569408888; Sat, 10 Sep 2016 21:50:08 -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 xn11sm15245712pac.38.2016.09.10.21.50.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Sep 2016 21:50:08 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: 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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:123157 Archived-At: On Sun, 11 Sep 2016, Noam Postavsky wrote: > On Sun, Sep 11, 2016 at 12:33 AM, Tino Calancha wrote: >> (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)) > > Doesn't the second `expand-file-name` call make the first one redundant? Absolutely. Thank you! Following is the corrected second patch: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From f4b0e30a79e4d2c959931d9baec7ce72cd67c935 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Sun, 11 Sep 2016 13:47:50 +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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 088ca81..2ab9562 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -413,14 +413,15 @@ 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)) + (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