GNU bug report logs -
#23089
25.0.92; dired-goto-file in `find-dired' buffers
Previous Next
Reported by: Tino Calancha <f92capac <at> gmail.com>
Date: Tue, 22 Mar 2016 11:20:02 UTC
Severity: minor
Found in version 25.0.92
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 23089 <at> debbugs.gnu.org (full text, mbox):
> Date: Tue, 22 Mar 2016 20:22:51 +0900 (JST)
> From: Tino Calancha <f92capac <at> 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))
This bug report was last modified 9 years and 57 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.