I have been trying to add a custom keyboard command that will find a functions definition using S-mouse1
.
The issue is that I need two mouse clicks for this to work. The first click is to move cursor to the function who's definition I want to find. The second click is the S-mouse-1
to trigger the function to find it's definition.
Here is what I have added to my .emacs
:
(global-set-key (kbd "<S-mouse-1>")
(lambda ()
(interactive)
(xref-find-definitions (thing-at-point 'word))))
An ideal solution would update point based on my mouse position and then use thing-at-point
to pass the symbol into xref-find-definitions
I tried adding the following solution to my config without success: https://emacs.stackexchange.com/a/30856/21056