emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 fcbb0044899 1/2: Fix mouse clicks on directory line in Dired


From: Eli Zaretskii
Subject: emacs-29 fcbb0044899 1/2: Fix mouse clicks on directory line in Dired
Date: Mon, 25 Dec 2023 08:07:53 -0500 (EST)

branch: emacs-29
commit fcbb00448998cdfffcf7455192bfebf98ef27a1e
Author: Jared Finder <jared@finder.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix mouse clicks on directory line in Dired
    
    The option 'dired-kill-when-opening-new-dired-buffer' should be
    also honored when clicking the mouse to kill prev buffer.
    * lisp/dired.el (dired--make-directory-clickable): Call
    'dired--find-possibly-alternative-file' instead of 'dired', in
    the click callback.  (Bug#67856)
---
 lisp/dired.el | 15 ++++++++++++---
 1 file 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]