]> git.eshelyaron.com Git - emacs.git/commitdiff
(dired-find-buffer-nocreate): Ignore dead buffers.
authorKarl Heuer <kwzh@gnu.org>
Wed, 31 May 1995 21:06:48 +0000 (21:06 +0000)
committerKarl Heuer <kwzh@gnu.org>
Wed, 31 May 1995 21:06:48 +0000 (21:06 +0000)
lisp/dired.el

index 56d5cffb7c21728918175739f6d2293824cf457d..d049ee706d804b523de0b1a648a9f42869eabc2c 100644 (file)
@@ -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))
 
 \f