all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#61185: 29.0.60; key-parse is not as strict as the other keymap APIs
@ 2023-01-30 21:01 Daniel Mendler
  0 siblings, 0 replies; only message in thread
From: Daniel Mendler @ 2023-01-30 21:01 UTC (permalink / raw)
  To: 61185; +Cc: Lars Ingebrigtsen, Robert Pluim, Stefan Monnier

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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-30 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 21:01 bug#61185: 29.0.60; key-parse is not as strict as the other keymap APIs Daniel Mendler

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.