unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23089: 25.0.92; dired-goto-file in `find-dired' buffers
@ 2016-03-22 11:22 Tino Calancha
  2016-03-25  8:39 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Tino Calancha @ 2016-03-22 11:22 UTC (permalink / raw)
  To: 23089

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]


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.


In GNU Emacs 25.0.92.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.30)
  of 2016-03-22 built on calancha-pc
Repository revision: dbfbedd3d0f3afcfb811eae0e1a7b1c33fb27735

[-- Attachment #2: Type: text/plain, Size: 897 bytes --]

diff --git a/lisp/dired.el b/lisp/dired.el
index 24b128f..3c66a8e 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2746,7 +2746,20 @@ dired-goto-file
 				(dired-goto-subdir dir)))
 		     (dired-goto-file-1 (file-name-nondirectory file)
 					file
-					(dired-subdir-max)))))))
+					(dired-subdir-max))))
+		 ;; Handle Dired buffers from `find-dired' commands.  The
+		 ;; filename includes '/' if the file belongs to a subdir
+		 ;; of `default-directory'.
+		 (save-excursion
+		   (let ((name-len   (length file))
+				 (defdir-len (length (expand-file-name default-directory))))
+			 (goto-char (point-min))
+			 (and (not (cdr dired-subdir-alist))
+				  (> name-len defdir-len)
+				  (dired-goto-file-1 (substring file defdir-len)
+									 file
+									 (point-max))))))))
+
     ;; Return buffer position, if found.
     (if found
 	(goto-char found))))

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-25 14:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-03-25 11:21   ` Tino Calancha
2016-03-25 14:20     ` Eli Zaretskii

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).