[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#57969: 29.0.50; `device-class' errors when NAME is nil
From: |
Po Lu |
Subject: |
bug#57969: 29.0.50; `device-class' errors when NAME is nil |
Date: |
Wed, 21 Sep 2022 19:54:07 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) |
Visuwesh <visuweshm@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@gnu.org* emacs@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.