aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2016-03-25 17:18:21 +0300
committerEli Zaretskii2016-03-25 17:18:21 +0300
commit1e1ea22e91b8312c76eb8768bf995ae6129ac16a (patch)
tree9d7cfac6a9267d7f3b6c109a8def680476e0e438
parent3a13472adee7117e5af1249e41f6e8db9c473603 (diff)
downloademacs-1e1ea22e91b8312c76eb8768bf995ae6129ac16a.tar.gz
emacs-1e1ea22e91b8312c76eb8768bf995ae6129ac16a.zip
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)
-rw-r--r--lisp/dired.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index ef22d457bca..5741872cfc8 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2736,9 +2736,18 @@ instead of `dired-actual-switches'."
2736 (save-excursion 2736 (save-excursion
2737 (goto-char (point-min)) 2737 (goto-char (point-min))
2738 (dired-goto-file-1 file file (point-max))) 2738 (dired-goto-file-1 file file (point-max)))
2739 ;; Otherwise, look for it as a relative name. The 2739 ;; Next, look for it as a relative name with leading
2740 ;; hair is to get the result of `dired-goto-subdir' 2740 ;; subdirectories. (This happens in Dired buffers
2741 ;; without calling it if we don't have any subdirs. 2741 ;; created by find-dired, for example.)
2742 (save-excursion
2743 (goto-char (point-min))
2744 (dired-goto-file-1 (file-relative-name file
2745 default-directory)
2746 file (point-max)))
2747 ;; Otherwise, look for it as a relative name, a base
2748 ;; name only. The hair is to get the result of
2749 ;; `dired-goto-subdir' without calling it if we don't
2750 ;; have any subdirs.
2742 (save-excursion 2751 (save-excursion
2743 (when (if (string= dir (expand-file-name default-directory)) 2752 (when (if (string= dir (expand-file-name default-directory))
2744 (goto-char (point-min)) 2753 (goto-char (point-min))