summaryrefslogtreecommitdiff
path: root/lisp/dired-x.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-05-26 04:23:21 +0000
committerKarl Heuer <kwzh@gnu.org>1995-05-26 04:23:21 +0000
commit10774fb5775efbdcd9d75f9de9e2a514242c864b (patch)
treee9a7f21fc7a1959e70d84ea1dbd8a6467d71bd6f /lisp/dired-x.el
parent499ea23b0798f3d9165c2dc63ce02ac31b9336e4 (diff)
downloademacs-10774fb5775efbdcd9d75f9de9e2a514242c864b.tar.gz
(dired-find-buffer-nocreate): Don't try to find a
wildcard as a subdirectory.
Diffstat (limited to 'lisp/dired-x.el')
-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'."
;;; REDEFINE.
;;; Redefines dired.el's version of `dired-find-buffer-nocreate'
(defun dired-find-buffer-nocreate (dirname)
- (if dired-find-subdir
+ (if (and dired-find-subdir
+ ;; don't try to find a wildcard as a subdirectory
+ (string-equal dirname (file-name-directory dirname)))
(let* ((cur-buf (current-buffer))
- (buffers (nreverse
+ (buffers (nreverse
(dired-buffers-for-dir (expand-file-name dirname))))
- (cur-buf-matches (and (memq cur-buf buffers)
- ;; wildcards must match, too:
- (equal dired-directory dirname))))
- ;; We don't want to switch to the same buffer---
- (setq buffers (delq cur-buf buffers));;need setq with delq
- (or (car (sort buffers (function dired-buffer-more-recently-used-p)))
- ;; ---unless it's the only possibility:
- (and cur-buf-matches cur-buf)))
+ (cur-buf-matches (and (memq cur-buf buffers)
+ ;; wildcards must match, too:
+ (equal dired-directory dirname))))
+ ;; We don't want to switch to the same buffer---
+ (setq buffers (delq cur-buf buffers));;need setq with delq
+ (or (car (sort buffers (function dired-buffer-more-recently-used-p)))
+ ;; ---unless it's the only possibility:
+ (and cur-buf-matches cur-buf)))
(dired-old-find-buffer-nocreate dirname)))
;; This should be a builtin