From: Karl Heuer Date: Wed, 31 May 1995 21:06:48 +0000 (+0000) Subject: (dired-find-buffer-nocreate): Ignore dead buffers. X-Git-Tag: emacs-19.34~3813 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6103c44e5a46ec815db8b14635157bb4211eeb5b;p=emacs.git (dired-find-buffer-nocreate): Ignore dead buffers. --- diff --git a/lisp/dired.el b/lisp/dired.el index 56d5cffb7c2..d049ee706d8 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -459,13 +459,15 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." (defun dired-find-buffer-nocreate (dirname) (let (found (blist dired-buffers)) ; was (buffer-list) (while blist - (save-excursion - (set-buffer (cdr (car blist))) - (if (and (eq major-mode 'dired-mode) - (equal dired-directory dirname)) - (setq found (cdr (car blist)) - blist nil) - (setq blist (cdr blist))))) + (if (null (buffer-name (cdr (car blist)))) + (setq blist (cdr blist)) + (save-excursion + (set-buffer (cdr (car blist))) + (if (and (eq major-mode 'dired-mode) + (equal dired-directory dirname)) + (setq found (cdr (car blist)) + blist nil) + (setq blist (cdr blist)))))) found))