Subject: Re: bug#65578: Eglot with mouse
From: Dmitry Gutov <[email-masked]>
To: Juri Linkov <[email-masked]>
Cc: [email-masked],João Távora <[email-masked]>
Date: Thu, 31 Aug 2023 03:27:29 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 30.1

On 30/08/2023 19:35, Juri Linkov wrote:
>>>> @@ -1637,7 +1637,9 @@ xref-find-definitions-at-mouse
>>>> -        (xref-find-definitions identifier)
>>>> +        (progn
>>>> +          (mouse-set-point event)
>>>> +          (xref-find-definitions identifier))
>>>>          (user-error "No identifier here"))))
>>> The problem with this solution is that when it doesn't find
>>> the identifier then it leaves point at the wrong place.
>> I'm not sure is a big problem, but we could save the original position and
>> restore it in case of error too:
> Thanks.  I tend to agree with João that your initial version would be
> sufficient to leave point at the position of right-clicking.
> 
> Then the same change is also needed in xref-find-references-at-mouse
> with mouse-set-point before xref-find-references.

Very good, if you don't mind the side-effect too, I've pushed the fix 
for both functions to master. And closing.

BTW, this context-menu-mode is looking pretty nifty. It'd be nice to 
turn it on by default someday.