Commit f5b06a95 authored by Karl Heuer's avatar Karl Heuer
Browse files

(dired-find-buffer-nocreate): Check only buffers in

dired-buffers instead of all buffers in (buffer-list).
parent 0f09b616
......@@ -457,13 +457,13 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
;; This differs from dired-buffers-for-dir in that it does not consider
;; subdirs of default-directory and searches for the first match only
(defun dired-find-buffer-nocreate (dirname)
(let (found (blist (buffer-list)))
(let (found (blist dired-buffers)) ; was (buffer-list)
(while blist
(set-buffer (car blist))
(set-buffer (cdr (car blist)))
(if (and (eq major-mode 'dired-mode)
(equal dired-directory dirname))
(setq found (car blist)
(setq found (cdr (car blist))
blist nil)
(setq blist (cdr blist)))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment