unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Don March <don@ohspite.net>
Cc: 7631@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#7631: 24.0.50; inconsistency in event-convert-list and event-basic-type
Date: Sun, 18 Jul 2021 14:20:30 +0200	[thread overview]
Message-ID: <871r7vu835.fsf@gnus.org> (raw)
In-Reply-To: <AANLkTikZoQWmHuPb7ZZ3kWQjMrPJbPN0BLgmVEna2Acp@mail.gmail.com> (Don March's message of "Mon, 13 Dec 2010 22:36:20 -0500")

Don March <don@ohspite.net> writes:

>>> (event-convert-list '(t)) ; => 116
>>
>>> There's good reason to want this to eval to t (i.e. the symbol, not
>>> the char).
>>
>> Could you explain what is this good reason?
>
> I guess it boils down to the expected result of:
>
> (setq event t)
>
> (event-convert-list
>  (append (event-modifiers event)
>         (list (event-basic-type event)))) ; => 116, not t

Or simpler:

(event-convert-list (list nil 's))
=> 115

(115 is the same as the character ?s.)

The doc string says:

---
EVENT-DESC should contain one base event type (a character or symbol)
and zero or more modifier names (control, meta, hyper, super, shift, alt,
drag, down, double or triple).  The base must be last.
The return value is an event type (a character or symbol) which
has the same base event type and all the specified modifiers.
---

(event-basic-type 's)
=> s

So if this isn't a bug (and I think it would be problematic to change
the return value at this point), the doc string is at least slightly
misleading here, and shouldn't claim that it returns exactly the same
base event type.

Any opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2021-07-18 12:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13  6:22 bug#7631: 24.0.50; inconsistency in event-convert-list and event-basic-type Don March
2010-12-13 18:01 ` Stefan Monnier
2010-12-14  3:36   ` Don March
2021-07-18 12:20     ` Lars Ingebrigtsen [this message]
2021-07-18 16:09     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-18 16:18       ` Lars Ingebrigtsen

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=871r7vu835.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=7631@debbugs.gnu.org \
    --cc=don@ohspite.net \
    --cc=monnier@iro.umontreal.ca \
    /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).