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:33:04 +0900 (JST) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1473568527 20505 195.159.176.226 (11 Sep 2016 04:35:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2016 04:35:27 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) To: 24409@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 11 06:35:23 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 1biwU7-00041A-0q for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 06:35:15 +0200 Original-Received: from localhost ([::1]:36499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biwU4-0003wL-W9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2016 00:35:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biwTz-0003uL-7n for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:35:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biwTu-0002M7-32 for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:35:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biwTt-0002M3-WE for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1biwTt-0007PE-OQ for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:35:01 -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:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24409 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.147356848528441 (code B ref -1); Sun, 11 Sep 2016 04:35:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Sep 2016 04:34:45 +0000 Original-Received: from localhost ([127.0.0.1]:55886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biwTc-0007Of-NJ for submit@debbugs.gnu.org; Sun, 11 Sep 2016 00:34:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biwTb-0007OT-Ab for submit@debbugs.gnu.org; Sun, 11 Sep 2016 00:34:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biwTV-0002HW-14 for submit@debbugs.gnu.org; Sun, 11 Sep 2016 00:34:38 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biwTU-0002HG-Tg for submit@debbugs.gnu.org; Sun, 11 Sep 2016 00:34:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biwTS-0003tn-74 for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:34:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biwTO-0002GK-6a for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:34:34 -0400 Original-Received: from mail-pa0-f65.google.com ([209.85.220.65]:36572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biwTN-0002DW-VK for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2016 00:34:30 -0400 Original-Received: by mail-pa0-f65.google.com with SMTP id ez1so5949837pab.3 for ; Sat, 10 Sep 2016 21:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:subject:message-id:user-agent:mime-version; bh=jSfUgTT7a71+LlTy8BKRuP333TuoK6/OD9a/gmzSTws=; b=v32LoQ7GSvGqil6MKtRUpuyulycMyAjvMIhi+Gu+GAPoZTu6PTELpX0ZPnWjr8WAj4 CmpPFOedaKGpyvZmEa8fgdfohQ/Du5IPd5+L4bWVmfd+F5LVLJ3Z6hfwFiiKmz3KG1CC 4/ClydXutTcNGBnuA/mH8LrYkdWSMFM329yheSp8v8ozOyh/KleikFVppKzMwn84EyI3 OX0ZMWucoy1byZriwPt5lBLzOhxarFl0yHKutsEcDiwUBhEzCcMPojkrSiaHHnvsG8fe cU+N1XSmWMfiDLXX6rPk0eLB67D8jfGo2Uwula21WBZuwtPq1QOZLEI+6FQIPhF8H+tv kRLQ== 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:subject:message-id:user-agent :mime-version; bh=jSfUgTT7a71+LlTy8BKRuP333TuoK6/OD9a/gmzSTws=; b=Xd97dbE4noEzsbj9v/67R1NW6UFuLwDca9jywX9/xOADHB9mC43u/sQnzF3xKcA6FV ZQCnqz+u8cBDQxM0+j7v8KMc5mcGpG6fHjcKErbsrH944O1F86GTI1Lu1qMsVpW75Lop ADFL3dTvilRLUg0cTuskQ1YnHhupGL/9VkuFjLUwKFYt0UODHBzfXn2S4bZvYnjwZFlf bTyaR0dGLkqlQHxDsPG8/SDxBKOlV+Rl07Zw+orks59S0pr/CFsZL3ypRQ6Y5kMwJuPT vhT7S4ixpBUo5EmIjOjtmdArtxkLadEdIXEeyD7E+ab7DVMpRvH7ZKNK6j+3syuewZlu 17sQ== X-Gm-Message-State: AE9vXwMKnGoFnXm8C4MYOx8QGKkSchUpn2Bt2d5Qhj16YCQWStN5UgNUHUyxutxAmtDiMg== X-Received: by 10.66.5.137 with SMTP id s9mr12877598pas.151.1473568387712; Sat, 10 Sep 2016 21:33:07 -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 s63sm15158621pfb.52.2016.09.10.21.33.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Sep 2016 21:33:07 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:123155 Archived-At: 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 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 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