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:
parent
c73cf3548e
commit
455a236d41
1 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue