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 15:37:30 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> We have this in many places in Emacs already, so adding one more will
> not hurt too much.  Dispatch on the first element of the list is easy
> and produces code that is quite readable and maintainable, IMO.
>
> Of course, if more elegant ways exist, I don't object to using them,
> quite the contrary.  But if not, I see nothing especially wrong with
> doing what you call "very confusing", because we do it elsewhere.

Hmm, do we use keywords anywhere inside Lisp events?  If not, then
here's a simple way to add a property list to the end of event lists:

  (defun event-plist (event)
    "Return the property list of EVENT."
    (while (and event (not (keywordp (car event))))
      (setq event (cdr event)))
    event)

Then, additional information could just be added to the end of each
event by appending any property list that associates keywords.


reply via email to

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