bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#65578: Eglot with mouse


From: Dmitry Gutov
Subject: bug#65578: Eglot with mouse
Date: Mon, 28 Aug 2023 16:41:12 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 28/08/2023 10:13, Juri Linkov wrote:
xref-find-definitions-at-mouse uses save-excursion with
mouse-set-point before calling xref-backend-identifier-at-point.
But the same save-excursion with mouse-set-point can't be added
around xref-find-definitions because save-excursion will restore
the original position after visiting the found identifier.

Could we do that without additional save-excursion?

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 0666b18cba1..0c3e34fe0a5 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1637,7 +1637,9 @@ xref-find-definitions-at-mouse
            (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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]