Subject: bug#73764: format-kbd-macro returns a key name that keymap-lookup doesn't recognize

From: Stefan Kangas <[email-masked]>
Date: Mon, 14 Oct 2024 14:48:41 -0700

Eli Zaretskii <[email-masked]> writes:

> In any case, there's the more general issue at hand here:
> keymap--check is (at least in this case) unnecessarily restrictive:
> where key-parse will gladly accept and correctly process a key whose
> modifiers are in any order, keymap--check insist on the canonical
> order.  I'm not sure I like this, at least in non-interactive
> functions.

One issue that these new functions tried to resolve was that the old
functions were too lenient.  See, for example, this passage in the
manual, and its docstring:

     The ‘kbd’ function is very permissive, and will try to return
     something sensible even if the syntax used isn't completely
     conforming.  To check whether the syntax is actually valid, use the
     ‘key-valid-p’ function.

So this strict behaviour is not by accident, and we should probably
think twice before going back on this design decision.

At least, we should review the old arguments to make sure we don't bring
back any undesired/buggy behaviour that this was supposed to remedy.
I didn't have the time to do that fully, as there are many relevant
threads from around that period, both on emacs-devel and bug-gnu-emacs.