GNU bug report logs -
#50804
Command substitutions for keys without keymaps
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Sat, 25 Sep 2021 18:02:01 UTC
Severity: wishlist
Tags: patch
Fixed in version 29.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> The second one will be printed as "\‘C-h‘" on old versions, which isn't
>> perfect but not too bad. Even if the extra "\" is distracting, it is at
>> least not actively misleading...
>
> That's a good point. So perhaps \\`C-h' does make sense in
> `substitute-command-keys'.
I found a patch of mine from March that I had forgotten about. It uses
the syntax "\\[=y]" to mean the key "y" where, I guess, we could
stipulate that whatever comes after "=" is `key-valid-p'.
However, it breaks backwards incompatibility just as "\\[[y]]" would:
(substitute-command-keys "\\[=k]")
=> "M-x =k"
(substitute-command-keys "\\[[y]]")
=> "M-x [y]"
Which is just... wrong. So either we say that, you know, don't use this
syntax in code intended for use in anything older Emacs 29, or we just
go with the new syntax \\`y`.
Given that I have a seemingly mostly working patch it should be easy to
fix it up whichever way we decide to go. I hope.
This bug report was last modified 3 years and 242 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.