emacs-devel
[Top][All Lists]
Advanced

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

Re: master 128ed5c9f17: Add one more mouse-set-point call to functions x


From: Po Lu
Subject: Re: master 128ed5c9f17: Add one more mouse-set-point call to functions xref-find-*-at-mouse
Date: Thu, 31 Aug 2023 09:10:32 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Dmitry Gutov <dmitry@gutov.dev> writes:

> On 31/08/2023 03:43, Po Lu wrote:
>> My experience with the entire touch screen affair says that many such
>> errors would never have been written had `xref-find-definitions' taken
>> an EVENT argument and used its posn-point if present.  Something to
>> consider, I suppose.
>
> Sorry, I don't quite understand which change you have in mind.
>
> The issue here was that we needed to move to the click's location both
> when detecting the identifier (at that point), and before using the
> identifier to find a set of locations.
>
> If we used a POSN value, it would also have to be used in two places,
> I guess. One of which we could just as easily missed as we had here.

In my opinion, commands or functions that respond to the location of a
click should always take an EVENT argument, and use:

  (posn-point (event-start event))

if EVENT is present and incorporates a mouse position list.  Rather than
searching for an identifier at point, it should search for an identifier
at the point of the mouse click.  Adhering to such a convention is
almost guaranteed to eliminate every bug where Emacs consults something
under point instead of the mouse pointer when the user meant the latter.

Thanks.


reply via email to

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