From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23089: 25.0.92; dired-goto-file in `find-dired' buffers Date: Fri, 25 Mar 2016 11:39:15 +0300 Message-ID: <83r3ez0x58.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1458895257 5432 80.91.229.3 (25 Mar 2016 08:40:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Mar 2016 08:40:57 +0000 (UTC) Cc: 23089@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 25 09:40:47 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ajNIU-00069W-T2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Mar 2016 09:40:47 +0100 Original-Received: from localhost ([::1]:54708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajNIU-00080C-62 for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Mar 2016 04:40:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajNIF-0007yv-5K for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 04:40:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajNHm-0001hm-MJ for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 04:40:30 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajNHm-0001hh-D1 for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 04:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ajNHm-0006cs-7V for bug-gnu-emacs@gnu.org; Fri, 25 Mar 2016 04:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Mar 2016 08:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23089 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23089-submit@debbugs.gnu.org id=B23089.145889517625430 (code B ref 23089); Fri, 25 Mar 2016 08:40:02 +0000 Original-Received: (at 23089) by debbugs.gnu.org; 25 Mar 2016 08:39:36 +0000 Original-Received: from localhost ([127.0.0.1]:36810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajNHM-0006c6-GH for submit@debbugs.gnu.org; Fri, 25 Mar 2016 04:39:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajNHK-0006bs-NE for 23089@debbugs.gnu.org; Fri, 25 Mar 2016 04:39:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajNH7-0001QY-6k for 23089@debbugs.gnu.org; Fri, 25 Mar 2016 04:39:29 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajNH7-0001QI-3l; Fri, 25 Mar 2016 04:39:21 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4581 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ajNH6-0006vi-Kr; Fri, 25 Mar 2016 04:39:20 -0400 In-reply-to: (message from Tino Calancha on Tue, 22 Mar 2016 20:22:51 +0900 (JST)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115465 Archived-At: > Date: Tue, 22 Mar 2016 20:22:51 +0900 (JST) > From: Tino Calancha > > Dired buffers output from `find-dired' commands, usually contains > filename including '/'. Command `dired-goto-file' fails > on those files. > > ; emacs-lisp: > emacs -Q $emacs-lisp > M-x find-name-dired RET *.el RET > j language/thai-word.el RET > > ;It cannot find the file. Thanks for the report and the patch. Does the alternative patch below look correct, and does it give good results? diff --git a/lisp/dired.el b/lisp/dired.el index ef22d45..5741872 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2736,9 +2736,18 @@ dired-goto-file (save-excursion (goto-char (point-min)) (dired-goto-file-1 file file (point-max))) - ;; Otherwise, look for it as a relative name. The - ;; hair is to get the result of `dired-goto-subdir' - ;; without calling it if we don't have any subdirs. + ;; Next, look for it as a relative name with leading + ;; subdirectories. (This happens in Dired buffers + ;; created by find-dired, for example.) + (save-excursion + (goto-char (point-min)) + (dired-goto-file-1 (file-relative-name file + default-directory) + file (point-max))) + ;; Otherwise, look for it as a relative name, a base + ;; name only. The hair is to get the result of + ;; `dired-goto-subdir' without calling it if we don't + ;; have any subdirs. (save-excursion (when (if (string= dir (expand-file-name default-directory)) (goto-char (point-min))