unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Keybinding for finding definition by mouse
@ 2018-07-08 20:06 Tobias Gerdin
  2018-07-09 17:09 ` Eli Zaretskii
  2018-07-09 17:43 ` Yuri Khan
  0 siblings, 2 replies; 10+ messages in thread
From: Tobias Gerdin @ 2018-07-08 20:06 UTC (permalink / raw)
  To: emacs-devel

Hello,

A function for jumping to a definition by clicking on an identifier was 
recently added to master.[1]

For mouse users like myself this invoking this is probably the second 
mouse common use of the mouse (after text selection) so I propose we add 
a default binding for it in the global map. So which one? All other 
editors/IDEs I am familiar with (Eclipse, IntelliJ, VS Code) has this 
bound to <C-mouse-1>. Not that Emacs has to follow this convention, but 
since it's a convenient choice this would be my preferred binding.

Because this is Emacs it as obviously already used (for 
'mouse-buffer-menu'). The meta modifier mouse events are all used for 
secondary selection (very useful) and I vaguely recall that shift 
modified mouse events (S-mouse-..) are reserved for the user (in the 
same spirit as the C-c), also makes sense.[2]

<C-mouse-2> is bound to 'face-menu'. It's useful on occasions (mostly in 
enriched-mode I presume?) but since mouse-2 is typically bound to the 
mouse wheel button on modern mice it is very uncomfortable for something 
used regularly hence not a good choice I think.

My proposal:

<C-mouse-3> is bound to a mode-specific context menu ("major mode 
menu"). Because this same menu is also available by clicking mouse-1 on 
the mode name in the modeline (and it's also in the frame/application 
menu) I propose we move 'mouse-buffer-menu' to C-mouse-3 in the interest 
of freeing up C-mouse-1 for 'xref-find-definitions-at-mouse'.

<C-M-mouse-1> would be another, more conservative option because the all 
of the <C-M-mouse-..> appears to be unbound.

Wishful thinking would be to also have 'xref-pop-marker-stack' bound to 
some mouse event (ideally C-mouse-3) to enable keyboard-free code 
browsing when one so feel inclined, but I may be greedy here and would 
settle for keeping that one to my private keymap for now.

What do you think?

I am not subscribed to the list so I would be grateful if I would be 
CC:ed any replies.

--

Regards,

Tobias Gerdin

[1]: 
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=455a236d415d3ca9a25564cd3f295f5e5e0bb7b4
[2]: Even so, ffap.el binds the similar functionality 'ffap-at-mouse' to 
<S-mouse-3> through the command 'ffap-bindings'. So one option would be 
to introduce a "dwim-at-mouse" unifying xref-find-definitions-at-mouse 
and ffap-at-mouse and bind it to that.




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-07-10 16:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-08 20:06 Keybinding for finding definition by mouse Tobias Gerdin
2018-07-09 17:09 ` Eli Zaretskii
2018-07-09 20:40   ` Tobias Gerdin
2018-07-10 16:16     ` Eli Zaretskii
2018-07-09 21:17   ` Tobias Gerdin
2018-07-09 17:43 ` Yuri Khan
2018-07-09 17:50   ` Marcin Borkowski
2018-07-09 18:42     ` Yuri Khan
2018-07-09 19:16       ` Helmut Eller
2018-07-09 19:58       ` Tobias Gerdin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).