all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: 61185@debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	Robert Pluim <rpluim@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#61185: 29.0.60; key-parse is not as strict as the other keymap APIs
Date: Mon, 30 Jan 2023 22:01:56 +0100	[thread overview]
Message-ID: <a4140ea2-ad5a-f5de-9dc6-9553bdce1a7b@daniel-mendler.de> (raw)

The function `key-parse' is publicly exposed as part of the keymap.el
API. As such it would be good if it were as strict as the rest of the
API to improve consistency. Currently it accepts strings which are
invalid according to `key-valid-p'.

(key-valid-p "bug") ;; nil
(key-parse "bug")   ;; [98 117 103]

We can move the `key-valid-p' check to `key-parse'. This would alleviate
the need for many additional `key-valid-p' checks across keymap.el. Then
the `keymap--check' helper can even be removed.

There is the small complication that `kbd' has been reimplemented based
on `key-parse' which prevents `key-parse' from being more strict. One
can either introduce an internal `key--parse-lax' function which is then
used by `kbd' and `key-parse'.





                 reply	other threads:[~2023-01-30 21:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=a4140ea2-ad5a-f5de-9dc6-9553bdce1a7b@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --cc=61185@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rpluim@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.