diff options
| author | Eli Zaretskii | 2016-03-25 17:18:21 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-03-25 17:18:21 +0300 |
| commit | 1e1ea22e91b8312c76eb8768bf995ae6129ac16a (patch) | |
| tree | 9d7cfac6a9267d7f3b6c109a8def680476e0e438 | |
| parent | 3a13472adee7117e5af1249e41f6e8db9c473603 (diff) | |
| download | emacs-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.el | 15 |
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)) |