1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-27 18:30:47 -08:00

New function 'xref-find-definitions-at-mouse'

* lisp/progmodes/xref.el (xref-find-definitions-at-mouse): New
function.  (Bug32029)

Copyright-paperwork-exempt: yes
This commit is contained in:
Tobias Gerdin 2018-07-07 11:59:56 +03:00 committed by Eli Zaretskii
parent c73cf3548e
commit 455a236d41

View file

@ -873,6 +873,19 @@ With prefix argument, prompt for the identifier."
(interactive (list (xref--read-identifier "Find references of: ")))
(xref--find-xrefs identifier 'references identifier nil))
;;;###autoload
(defun xref-find-definitions-at-mouse (event)
"Find the definition of identifier at or around mouse click.
This command is intended to be bound to a mouse event."
(interactive "e")
(let ((identifier
(save-excursion
(mouse-set-point event)
(xref-backend-identifier-at-point (xref-find-backend)))))
(if identifier
(xref-find-definitions identifier)
(user-error "No identifier here"))))
(declare-function apropos-parse-pattern "apropos" (pattern))
;;;###autoload