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: Mon, 12 Sep 2016 13:37:14 +0900 (JST) Message-ID: References: <83a8febg8c.fsf@gnu.org> <83zine9x18.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 1473655105 29305 195.159.176.226 (12 Sep 2016 04:38:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Sep 2016 04:38:25 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: 24409@debbugs.gnu.org, Tino Calancha To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 12 06:38:21 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 1bjJ0a-0006cT-Rk for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Sep 2016 06:38:17 +0200 Original-Received: from localhost ([::1]:40097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjJ0Z-0003W8-0a for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Sep 2016 00:38:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjJ0S-0003Vx-Bn for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2016 00:38:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjJ0M-0008Hl-Ch for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2016 00:38:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjJ0M-0008Hf-86 for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2016 00:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bjJ0L-0004V2-Vq for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2016 00:38: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: Mon, 12 Sep 2016 04:38:01 +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.147365504617247 (code B ref 24409); Mon, 12 Sep 2016 04:38:01 +0000 Original-Received: (at 24409) by debbugs.gnu.org; 12 Sep 2016 04:37:26 +0000 Original-Received: from localhost ([127.0.0.1]:56920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjIzl-0004U6-WA for submit@debbugs.gnu.org; Mon, 12 Sep 2016 00:37:26 -0400 Original-Received: from mail-pa0-f50.google.com ([209.85.220.50]:33059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjIzk-0004Tr-3i for 24409@debbugs.gnu.org; Mon, 12 Sep 2016 00:37:24 -0400 Original-Received: by mail-pa0-f50.google.com with SMTP id cm16so47016401pac.0 for <24409@debbugs.gnu.org>; Sun, 11 Sep 2016 21:37:24 -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=Cd/6wkft0+sMW9HmEKcKnOkxs18aAR5abOBU6qQRyMI=; b=xisGr8sDbfq+RmAP9vcGiMCRVL+B8iKXq4AD/8wHQZuXQndba7NmtIEXfLphkGi9NY g28nys6tqy/57P0S9TDw4Wkg157RIewP9Rc4cFQc4nHwpOlx6+y7L1fS5fTSrI55+TPi vOTBtPRkOx8I8Oe+iL4WHLgTZQmM/0Xpf82sssmx8qQlejk0SVpLLONSDeVTRE1rhgQI OQVkNrXCt4OlZvIdQcbbMr8yh0PkbgWSm+RV15WHygzaWi0mc0O1l1RVYjQyKHm0MJci YoWShFyDZwmMza3f9wt+lF/eY4mEAEfJGPyrYrEE8YuMRfF/ZVaSwK1Pls9gTZbrTgYP 99UQ== 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=Cd/6wkft0+sMW9HmEKcKnOkxs18aAR5abOBU6qQRyMI=; b=iY6XYH48Te/An4HotSCJoeju705US3FJNPdzwZlr6zmodQojKocriyFMFa6mlAoj76 5iUHZhuPIKMrWIXGqVMxnLGyoiItN2Gbe4jWzd1+v5/sr5PRiJ6YJ96kR9IAO9YPQJaX TC7df79Il88nakZuZ8xFKDJAVudJvMY58xUETkqN32xD3uRkqo/hJXTuVNfBs0dPLTyE YcUaW+tP9uwozhuZXGoLVvoMmnvCcyXBp4TInfnDKdHFJfiVv7nVwYFvd4+l7ZQ8cZqz 2clhMyPdYudKL7fTcjpOR7tYS8pQBOtYIPFJ3nx6gU3XG716AwIHcYMn9f5QeFXNwy70 NovQ== X-Gm-Message-State: AE9vXwNE3mJog8X0gSz8wtoYc4rykTOpgzMijw0r/J0AveiN2TEYuuygzAmxPcr771uWCw== X-Received: by 10.66.217.132 with SMTP id oy4mr29896245pac.46.1473655038326; Sun, 11 Sep 2016 21:37:18 -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 f16sm16434533pfd.84.2016.09.11.21.37.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Sep 2016 21:37:17 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <83zine9x18.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" 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:123204 Archived-At: On Sun, 11 Sep 2016, Eli Zaretskii wrote: > 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 '~/'. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From 3e58d4987590dbdb54d08fd6be201bd0cad4b804 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 12 Sep 2016 13:16:32 +0900 Subject: [PATCH] dired-jump: Expand file-name before dired-goto-file call Command dired-goto-file requires its argument to be an absolute canonical file name. Interactively FILE-NAME is read with read-file-name, which could return an abbreviated file name, i.e., non-canonical (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..90420ad 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, 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 `dired-goto-file' call: + ;; `dired-goto-file' requires its argument to be an absolute + ;; canonical file name; the result of `read-file-name' could + ;; be an abbreviated file name, i.e., non-canonical (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.2 (x86_64-pc-linux-gnu, GTK+ Version 3.21.5) of 2016-09-12 built on calancha-pc Repository revision: 367f8568bc9e759ebdfb423648891efa0346456b