GNU bug report logs - #61185
29.0.60; key-parse is not as strict as the other keymap APIs

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Mon, 30 Jan 2023 21:03:02 UTC

Severity: normal

Found in version 29.0.60

To reply to this bug, email your comments to 61185 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61185; Package emacs. (Mon, 30 Jan 2023 21:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Mendler <mail <at> daniel-mendler.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 30 Jan 2023 21:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: bug-gnu-emacs <at> gnu.org
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Robert Pluim <rpluim <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: 29.0.60; key-parse is not as strict as the other keymap APIs
Date: Mon, 30 Jan 2023 22:01:56 +0100
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'.




This bug report was last modified 1 year and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.