unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 57969@debbugs.gnu.org, Visuwesh <visuweshm@gmail.com>
Subject: bug#57969: 29.0.50; `device-class' errors when NAME is nil
Date: Wed, 21 Sep 2022 19:53:40 +0800	[thread overview]
Message-ID: <87y1udeyez.fsf@yahoo.com> (raw)
In-Reply-To: <87k05x6jas.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 21 Sep 2022 13:47:23 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> 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)
>
> 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.





  reply	other threads:[~2022-09-21 11:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21  7:45 bug#57969: 29.0.50; `device-class' errors when NAME is nil Visuwesh
2022-09-21 11:47 ` Lars Ingebrigtsen
2022-09-21 11:53   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-09-21 12:03     ` Lars Ingebrigtsen
2022-09-21 12:15       ` Visuwesh
2022-09-24 16:34         ` Lars Ingebrigtsen
2022-09-21 12:40       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-21 12:02   ` Visuwesh
2022-09-21 11:54 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-21 12:15   ` Visuwesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1udeyez.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=57969@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    --cc=visuweshm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).