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