aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-05-26 04:23:21 +0000
committerKarl Heuer1995-05-26 04:23:21 +0000
commit10774fb5775efbdcd9d75f9de9e2a514242c864b (patch)
treee9a7f21fc7a1959e70d84ea1dbd8a6467d71bd6f
parent499ea23b0798f3d9165c2dc63ce02ac31b9336e4 (diff)
downloademacs-10774fb5775efbdcd9d75f9de9e2a514242c864b.tar.gz
emacs-10774fb5775efbdcd9d75f9de9e2a514242c864b.zip
(dired-find-buffer-nocreate): Don't try to find a
wildcard as a subdirectory.
-rw-r--r--lisp/dired-x.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index bf066123bf7..e9950248d27 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -1366,18 +1366,20 @@ See also variable `dired-vm-read-only-folders'."
1366;;; REDEFINE. 1366;;; REDEFINE.
1367;;; Redefines dired.el's version of `dired-find-buffer-nocreate' 1367;;; Redefines dired.el's version of `dired-find-buffer-nocreate'
1368(defun dired-find-buffer-nocreate (dirname) 1368(defun dired-find-buffer-nocreate (dirname)
1369 (if dired-find-subdir 1369 (if (and dired-find-subdir
1370 ;; don't try to find a wildcard as a subdirectory
1371 (string-equal dirname (file-name-directory dirname)))
1370 (let* ((cur-buf (current-buffer)) 1372 (let* ((cur-buf (current-buffer))
1371 (buffers (nreverse 1373 (buffers (nreverse
1372 (dired-buffers-for-dir (expand-file-name dirname)))) 1374 (dired-buffers-for-dir (expand-file-name dirname))))
1373 (cur-buf-matches (and (memq cur-buf buffers) 1375 (cur-buf-matches (and (memq cur-buf buffers)
1374 ;; wildcards must match, too: 1376 ;; wildcards must match, too:
1375 (equal dired-directory dirname)))) 1377 (equal dired-directory dirname))))
1376 ;; We don't want to switch to the same buffer--- 1378 ;; We don't want to switch to the same buffer---
1377 (setq buffers (delq cur-buf buffers));;need setq with delq 1379 (setq buffers (delq cur-buf buffers));;need setq with delq
1378 (or (car (sort buffers (function dired-buffer-more-recently-used-p))) 1380 (or (car (sort buffers (function dired-buffer-more-recently-used-p)))
1379 ;; ---unless it's the only possibility: 1381 ;; ---unless it's the only possibility:
1380 (and cur-buf-matches cur-buf))) 1382 (and cur-buf-matches cur-buf)))
1381 (dired-old-find-buffer-nocreate dirname))) 1383 (dired-old-find-buffer-nocreate dirname)))
1382 1384
1383;; This should be a builtin 1385;; This should be a builtin