summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index cc548baf080..998de06ee63 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1941,9 +1941,18 @@ mouse-2: visit this file in other window"
keymap ,(let* ((current-dir dir)
(click (lambda ()
(interactive)
- (if (assoc current-dir dired-subdir-alist)
- (dired-goto-subdir current-dir)
- (dired current-dir)))))
+ (cond
+ ((assoc current-dir dired-subdir-alist)
+ (dired-goto-subdir current-dir))
+ ;; If there is a wildcard character in the directory, don't
+ ;; use the alternate file machinery which tries to keep only
+ ;; one dired buffer open at once.
+ ;;
+ ;; FIXME: Is this code path reachable?
+ ((insert-directory-wildcard-in-dir-p current-dir)
+ (dired current-dir))
+ (t
+ (dired--find-possibly-alternative-file current-dir))))))
(define-keymap
"<mouse-2>" click
"<follow-link>" 'mouse-face