From: Dmitry Gutov Date: Thu, 31 Aug 2023 00:21:11 +0000 (+0300) Subject: Add one more mouse-set-point call to functions xref-find-*-at-mouse X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~4414 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=128ed5c9f17fab87fdb679326035aa2598612658;p=emacs.git Add one more mouse-set-point call to functions xref-find-*-at-mouse * lisp/progmodes/xref.el (xref-find-definitions-at-mouse) (xref-find-references-at-mouse): Call mouse-set-point to ensure that the search is initiated at the same place where xref-backend-identifier-at-point was called (bug#65578). --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 3f75f8d7132..dbafa00c3ad 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1638,7 +1638,9 @@ This command is intended to be bound to a mouse event." (mouse-set-point event) (xref-backend-identifier-at-point (xref-find-backend))))) (if identifier - (xref-find-definitions identifier) + (progn + (mouse-set-point event) + (xref-find-definitions identifier)) (user-error "No identifier here")))) ;;;###autoload @@ -1652,6 +1654,7 @@ This command is intended to be bound to a mouse event." (xref-backend-identifier-at-point (xref-find-backend))))) (if identifier (let ((xref-prompt-for-identifier nil)) + (mouse-set-point event) (xref-find-references identifier)) (user-error "No identifier here"))))