diff options
| author | Jared Finder | 2023-12-16 12:10:03 -0800 |
|---|---|---|
| committer | Eli Zaretskii | 2023-12-25 15:02:34 +0200 |
| commit | fcbb00448998cdfffcf7455192bfebf98ef27a1e (patch) | |
| tree | 38828540a5c2a8ab78884831289d6eeb21ac41e1 | |
| parent | be8a7155b48198b08bbc4844b2ce60c127405fb7 (diff) | |
| download | emacs-fcbb00448998cdfffcf7455192bfebf98ef27a1e.tar.gz emacs-fcbb00448998cdfffcf7455192bfebf98ef27a1e.zip | |
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)
| -rw-r--r-- | lisp/dired.el | 15 |
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" | |||
| 1941 | keymap ,(let* ((current-dir dir) | 1941 | keymap ,(let* ((current-dir dir) |
| 1942 | (click (lambda () | 1942 | (click (lambda () |
| 1943 | (interactive) | 1943 | (interactive) |
| 1944 | (if (assoc current-dir dired-subdir-alist) | 1944 | (cond |
| 1945 | (dired-goto-subdir current-dir) | 1945 | ((assoc current-dir dired-subdir-alist) |
| 1946 | (dired current-dir))))) | 1946 | (dired-goto-subdir current-dir)) |
| 1947 | ;; If there is a wildcard character in the directory, don't | ||
| 1948 | ;; use the alternate file machinery which tries to keep only | ||
| 1949 | ;; one dired buffer open at once. | ||
| 1950 | ;; | ||
| 1951 | ;; FIXME: Is this code path reachable? | ||
| 1952 | ((insert-directory-wildcard-in-dir-p current-dir) | ||
| 1953 | (dired current-dir)) | ||
| 1954 | (t | ||
| 1955 | (dired--find-possibly-alternative-file current-dir)))))) | ||
| 1947 | (define-keymap | 1956 | (define-keymap |
| 1948 | "<mouse-2>" click | 1957 | "<mouse-2>" click |
| 1949 | "<follow-link>" 'mouse-face | 1958 | "<follow-link>" 'mouse-face |