GNU bug report logs -
#32029
PATCH: xref-find-definitions-at-mouse
Previous Next
Reported by: Tobias Gerdin <tgerdin <at> gmail.com>
Date: Sun, 1 Jul 2018 23:52:01 UTC
Severity: wishlist
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 32029 <at> debbugs.gnu.org (full text, mbox):
On 7/2/18 2:18 AM, Tobias Gerdin wrote:
> +;;;###autoload
> +(defun xref-find-definitions-at-mouse (event)
> + "Find the definition of identifier around mouse click."
> + (interactive "e")
> + (let* ((backend (xref-find-backend))
> + (identifier (save-excursion
> + (mouse-set-point event)
> + (xref-backend-identifier-at-point backend))))
> + (if identifier
> + (xref--find-definitions identifier nil)
> + (user-error "No identifier here"))))
You should call `mouse-set-point` before `xref-find-backend`, because
the latter might conceivably depend on the value of point.
I think this can be written much shorter (call mouse-set-point, then
interactively call xref-find-definitions), but I'm not sure how.
This bug report was last modified 7 years and 35 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.