]> git.eshelyaron.com Git - emacs.git/commitdiff
Add one more mouse-set-point call to functions xref-find-*-at-mouse
authorDmitry Gutov <dmitry@gutov.dev>
Thu, 31 Aug 2023 00:21:11 +0000 (03:21 +0300)
committerDmitry Gutov <dmitry@gutov.dev>
Thu, 31 Aug 2023 00:22:56 +0000 (03:22 +0300)
* 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).

lisp/progmodes/xref.el

index 3f75f8d7132e924c4ac461a6984b44d91b439a84..dbafa00c3ad8ca1c62f5451c3fe09b966c70afcf 100644 (file)
@@ -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"))))