unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tobias Gerdin <tgerdin@gmail.com>
To: emacs-devel@gnu.org
Subject: Keybinding for finding definition by mouse
Date: Sun, 8 Jul 2018 22:06:18 +0200	[thread overview]
Message-ID: <76face16-e29e-e945-674f-79b8a2f2e498@gmail.com> (raw)

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.




             reply	other threads:[~2018-07-08 20:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-08 20:06 Tobias Gerdin [this message]
2018-07-09 17:09 ` Keybinding for finding definition by mouse 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

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76face16-e29e-e945-674f-79b8a2f2e498@gmail.com \
    --to=tgerdin@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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 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).