emacs-devel
[Top][All Lists]
Advanced

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

Re: master 3b41141708: Expose the name of an event's input device to Lis


From: Po Lu
Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp
Date: Sun, 10 Apr 2022 14:23:58 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Why "different indexes to get the same property"?  The additional
> members should provide additional information, unavailable in the
> original elements.  We already have such data structures in Emacs;
> see, for example, data structures returned by pos-visible-in-window-p
> and find-composition.  The list returned by posn-at-point is another
> example: the 2nd member can be either display area or buffer position,
> and the 6th member always reports the position.  So this is quite
> "normal" in Emacs, assuming that the data structure is designed to be
> convenient for the code that will use it.

Because it doesn't make sense for this additional information to obscure
information that is already available.

For example, we might extend `wheel-up' and `wheel-down' with an extra
DEVICE parameter, so that it might look something like this:

  (wheel-down POSITION CLICKS LINES PIXEL-DELTA DEVICE)

But for touch end events, it would look like this:

  (touch-end POSITION DEVICE)

And for pinch events,

  (pinch POSITION DX DY SCALE ANGLE DEVICE)

To access the device would require the 6th, 3rd and 7th elements of each
type of event, which is very confusing.

Stefan's solution of making DEVICE an association might work, but I
suspect it would be liable to break if any of the preceding elements
were also conses.


reply via email to

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