GNU bug report logs - #57969
29.0.50; `device-class' errors when NAME is nil

Previous Next

Package: emacs;

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 #14 received at 57969 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 57969 <at> debbugs.gnu.org
Subject: Re: bug#57969: 29.0.50; `device-class' errors when NAME is nil
Date: Wed, 21 Sep 2022 19:54:07 +0800
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)
>   (let ((downcased-name (downcase name))) (cond ((string-match-p "XTEST" name) 'test) ((string= "Virtual core pointer" name) 'core-pointer) ((string= "Virtual core keyboard" name) 'core-keyboard) ((string-match-p "eraser" downcased-name) 'eraser) ((string-match-p " pad" downcased-name) 'pad) ((or (or (string-match-p "wacom" downcased-name) (string-match-p "pen" downcased-name)) (string-match-p "stylus" downcased-name)) 'pen) ((or (string-prefix-p "xwayland-touch:" name) (string-match-p "touchscreen" downcased-name)) 'touchscreen) ((or (string-match-p "trackpoint" downcased-name) (string-match-p "stick" downcased-name)) 'trackpoint) ((or (string-match-p "mouse" downcased-name) (string-match-p "optical" downcased-name) (string-match-p "pointer" downcased-name)) 'mouse) ((string-match-p "cursor" downcased-name) 'puck) ((or (string-match-p "keyboard" downcased-name) (string= name "USB USB Keykoard")) 'keyboard) ((string-match-p "button" downcased-name) 'power-button) ((string-match-p "touchpad" downcased-name) 'touchpad) ((or (string-match-p "midi" downcased-name) (string-match-p "piano" downcased-name)) 'piano) ((or (string-match-p "wskbd" downcased-name) (and (string-match-p "/dev" downcased-name) (string-match-p "kbd" downcased-name))) 'keyboard)))
>   x-device-class(nil)
>   device-class(#<frame *unsent mail to bug-gnu-emacs <at> gnu.org* emacs <at> astatine 0x562ae5daf070> nil)
>   eval((device-class last-event-frame nil) nil)
>   elisp--eval-last-sexp(nil)
>   eval-last-sexp(nil)
>   eros-eval-last-sexp(nil)
>   funcall-interactively(eros-eval-last-sexp nil)
>   call-interactively(eros-eval-last-sexp nil nil)
>   command-execute(eros-eval-last-sexp)

Should be fixed now, 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.