all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tino Calancha <f92capac@gmail.com>
To: 23089@debbugs.gnu.org
Subject: bug#23089: 25.0.92; dired-goto-file in `find-dired' buffers
Date: Tue, 22 Mar 2016 20:22:51 +0900 (JST)	[thread overview]
Message-ID: <alpine.LRH.2.20.1603222021460.11552@calancha-ilc.kek.jp> (raw)

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

             reply	other threads:[~2016-03-22 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 11:22 Tino Calancha [this message]
2016-03-25  8:39 ` bug#23089: 25.0.92; dired-goto-file in `find-dired' buffers Eli Zaretskii
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.20.1603222021460.11552@calancha-ilc.kek.jp \
    --to=f92capac@gmail.com \
    --cc=23089@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.