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
I can't find much documentation on some of these functions.
I found a little bit about
last-command-event
here https://www.gnu.org/software/emacs/manual/html_node/elisp/Command-Loop-Info.htmlAnd have not been able to any real documentation about
posn-set-point
other than this other SO answer: https://stackoverflow.com/a/36088695Do you have any recommended resources for learning more about built in functions like these and elisp in general?
– Priceatronic Dec 13 '18 at 05:15