emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 1e1ea22: Fix 'dired-goto-file' in Dired buffers p


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 1e1ea22: Fix 'dired-goto-file' in Dired buffers produced by find-dired
Date: Fri, 25 Mar 2016 14:19:44 +0000

branch: emacs-25
commit 1e1ea22e91b8312c76eb8768bf995ae6129ac16a
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix 'dired-goto-file' in Dired buffers produced by find-dired
    
    * lisp/dired.el (dired-goto-file): Try looking for the file as a
    relative name with leading sub-directories, before looking for the
    basename alone.  (Bug#23089)
---
 lisp/dired.el |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

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 @@ instead of `dired-actual-switches'."
                 (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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]