GNU bug report logs -
#57969
29.0.50; `device-class' errors when NAME is nil
Previous Next
Reported by: Visuwesh <visuweshm <at> gmail.com>
Date: Wed, 21 Sep 2022 07:46:02 UTC
Severity: normal
Found in version 29.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 57969 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Visuwesh <visuweshm <at> gmail.com> writes:
>
>> According to the docstring of `device-class', nil is a valid value for
>> the NAME argument however it errors out since `x-device-class' uses
>> `downcase' without checking if NAME is non-nil. Backtrace is below,
>>
>> Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
>> downcase(nil)
>
> Yes --
>
> --
> Return the class of the device NAME for an event generated on FRAME.
> NAME is a string that can be the value of last-event-device, or
> nil.
> --
>
> But it's not clear what the meaning of nil should be. Perhaps Po Lu
> knows; added to the CCs.
It does say later on that if the type could not be determined, the
return value is nil. So that is what I made it return.
> (And if nil really is a meaningful value for NAME, and not just a
> documentation error, then perhaps that argument should be optional?)
Well, no, it's only intended to be valid so you can do this:
(device-class last-event-frame last-event-device)
FTR, I consider `device-class' and `last-event-device' low level
interfaces that will be eventually replaced with a better user-facing
one, based on keymaps and virtual function keys, but that is still WIP.
Thanks.
This bug report was last modified 2 years and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.