Subject: bug#78945: 30.1; C-x 4 4 and C-x 5 5 do not work with `dired-mouse-find-file'

From: Alcor <[email-masked]>
Date: Thu, 03 Jul 2025 08:13:15 +0200

Eli Zaretskii <[email-masked]> writes:

> P.S. Your Subject says dired-mouse-find-file, whereas the recipe uses
> dired-find-file.  I tried both, and I get the expected behavior with
> both.

I apologize, there is one important distinction in the bug report I
should have made: I meant "single-click" by "click", i.e. <mouse-1> in
Emacs jargon.

Clicking <mouse-2> directly works correctly and does exhibit the
expected behavior. The issue here is that C-x 4 4 and C-x 5 5 do not
work when the <mouse-2> is translated from <mouse-1>.

As for `dired-mouse-find-file' vs. `dired-find-file' - I have meant to
write `dired-mouse-find-file' in the original message, but the behavior
should be reproducible with both.

For completeness, the corrected reproducer looks like this:

1. Start a fresh emacs -Q process
2. Open some directory in dired via e.g. C-x C-f /tmp RET
3. Rebind <mouse-2> to dired-mouse-find-file via (define-key dired-mode-map
(kbd "<mouse-2>") #'dired-mouse-find-file)
4a. Try C-x 4 4 and single-click (<mouse-1>) on a filename
OR
4b. Try C-x 5 5 and single-click (<mouse-1>) on a filename

I'm not sure how I should describe/retitle the issue - maybe "C-x 4 4
and C-x 5 5 do not work with `dired-mouse-find-file' using a translated
keybind"?

Also, I'd like to mention that this behavior is not just limited to GUI
Emacs. Trying the above with `emacs -nw' with M-x xterm-mouse-mode
yields the same results.

Cheers,
-A.