diff options
author | Karl Heuer <kwzh@gnu.org> | 1995-05-31 21:06:48 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1995-05-31 21:06:48 +0000 |
commit | d42c9557c50af12017e9d77a5216acc1a7c9dd80 (patch) | |
tree | 742deb80b41a97d65e6eccffb67ab49ec9232f33 /lisp/dired.el | |
parent | 77bb542d81d706c5601cefc4cc96f632d7c4280f (diff) | |
download | emacs-d42c9557c50af12017e9d77a5216acc1a7c9dd80.tar.gz |
(dired-find-buffer-nocreate): Ignore dead buffers.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r-- | lisp/dired.el | 16 |
1 files changed, 9 insertions, 7 deletions
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)) |