From: Visuwesh <visuweshm@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael_heerdegen@web.de, 74700@debbugs.gnu.org
Subject: bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name
Date: Thu, 26 Dec 2024 17:21:15 +0530 [thread overview]
Message-ID: <87v7v6ek7g.fsf@gmail.com> (raw)
In-Reply-To: <865xn6zusv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Dec 2024 10:56:48 +0200")
[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]
[வியாழன் டிசம்பர் 26, 2024] Eli Zaretskii wrote:
>> [...]
>> >> +++ #<buffer dired.el>
>> >> @@ -2089,8 +2089,10 @@
>> >> `( mouse-face highlight
>> >> help-echo "mouse-1: revert this buffer"
>> >> keymap ,(define-keymap
>> >> - "<mouse-2>" #'revert-buffer
>> >> - "<follow-link>" 'follow-link
>> >> + "<mouse-2>" (lambda (_)
>> >> + (interactive "@e")
>> >> + (revert-buffer))
>> >> + "<follow-link>" 'mouse-face
>> >
>> > I don't know how to fix the mouse-1 problem in a sensible way either.
>> > Does anyone?
>> >
>> > (And I think in this version the "e" code in `interactive' isn't
>> > significant - but let's first see if we can improve the behavior even
>> > more.)
>>
>> Indeed, I thought @ had to go with e _always_.
>
> Thanks, so please post a proper patch with a commit log message, so I
> could install it.
Thanks, patch attached.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Ensure-Dired-window-is-selected-when-reverting-buffe.patch --]
[-- Type: text/x-diff, Size: 1189 bytes --]
From 53cf31f879811389b030d5af7a90aa823ce35bde Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
Date: Thu, 26 Dec 2024 17:19:41 +0530
Subject: [PATCH] Ensure Dired window is selected when reverting buffer
* lisp/dired.el (dired--make-directory-clickable): Ensure the
Dired window is selected. This prevents erroneously reverting a
non-Dired buffer. (Bug#74700)
---
lisp/dired.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/dired.el b/lisp/dired.el
index 9895229694a..9632858703c 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2089,8 +2089,10 @@ dired--make-directory-clickable
`(mouse-face highlight
help-echo "mouse-1: re-read this buffer's directory"
keymap ,(define-keymap
- "<mouse-2>" #'revert-buffer
- "<follow-link>" 'follow-link
+ "<mouse-2>" (lambda ()
+ (interactive "@")
+ (revert-buffer))
+ "<follow-link>" 'mouse-face
"RET" #'revert-buffer))))))))
(defun dired--get-ellipsis-length ()
--
2.45.2
next prev parent reply other threads:[~2024-12-26 11:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 6:12 bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name Visuwesh
2024-12-05 7:02 ` Eli Zaretskii
2024-12-05 8:26 ` Visuwesh
2024-12-05 8:41 ` Eli Zaretskii
2024-12-05 9:02 ` Visuwesh
2024-12-05 9:24 ` Eli Zaretskii
2024-12-05 10:42 ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-05 17:56 ` Juri Linkov
2024-12-12 10:31 ` Eli Zaretskii
2024-12-23 21:31 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-24 3:22 ` Visuwesh
2024-12-24 23:39 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-25 3:43 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-25 4:47 ` Visuwesh
2024-12-26 8:56 ` Eli Zaretskii
2024-12-26 11:51 ` Visuwesh [this message]
2024-12-26 12:08 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v7v6ek7g.fsf@gmail.com \
--to=visuweshm@gmail.com \
--cc=74700@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=michael_heerdegen@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.