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: Stefan Monnier
Subject: Re: master 3b41141708: Expose the name of an event's input device to Lisp
Date: Sun, 10 Apr 2022 11:16:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> `register-device-function-key' takes a device or device class, and a
> recommended function key.  If no function key was previously registered
> for that device, it associates the function key with the device.
> Otherwise, it returns the function key that was previously registered.

That means all users of `register-device-function-key` need to write
their code under the assumption that the actual "function key" (I'd
call it a "prefix event" rather than a "function key") is not the one
they asked for but the one returned, which ends up being the same as
dynamically-generated "function keys".

It makes it rather inconvenient to use for the end user who wants to

    (define-key map [foot-pedal ?b] 'foo)

and has to do

    (define-key map (vector (register-device-function-key <blabla>) ?b) 'foo)

instead.

I hope we will settle over time on some naming convention so that
conflicting names almost never happen and `register-device-function-key`
can presume the caller knows what it does, so instead of returning the
previously chosen name, it doesn't return anything and overrides the old
name instead.


        Stefan




reply via email to

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