From: Eli Zaretskii <eliz@gnu.org>
To: Tino Calancha <f92capac@gmail.com>
Cc: 23089@debbugs.gnu.org
Subject: bug#23089: 25.0.92; dired-goto-file in `find-dired' buffers
Date: Fri, 25 Mar 2016 11:39:15 +0300 [thread overview]
Message-ID: <83r3ez0x58.fsf@gnu.org> (raw)
In-Reply-To: <alpine.LRH.2.20.1603222021460.11552@calancha-ilc.kek.jp> (message from Tino Calancha on Tue, 22 Mar 2016 20:22:51 +0900 (JST))
> Date: Tue, 22 Mar 2016 20:22:51 +0900 (JST)
> From: Tino Calancha <f92capac@gmail.com>
>
> 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))
next prev parent reply other threads:[~2016-03-25 8:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 11:22 bug#23089: 25.0.92; dired-goto-file in `find-dired' buffers Tino Calancha
2016-03-25 8:39 ` Eli Zaretskii [this message]
2016-03-25 11:21 ` Tino Calancha
2016-03-25 14:20 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83r3ez0x58.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=23089@debbugs.gnu.org \
--cc=f92capac@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).