]> git.eshelyaron.com Git - emacs.git/commitdiff
(dired-find-buffer-nocreate): Don't try to find a
authorKarl Heuer <kwzh@gnu.org>
Fri, 26 May 1995 04:23:21 +0000 (04:23 +0000)
committerKarl Heuer <kwzh@gnu.org>
Fri, 26 May 1995 04:23:21 +0000 (04:23 +0000)
wildcard as a subdirectory.

lisp/dired-x.el

index bf066123bf7d842967a938e3098cffec6f49778b..e9950248d27479315a50e70a6af1879b27100f42 100644 (file)
@@ -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