[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#50804: Command substitutions for keys without keymaps
From: |
Stefan Kangas |
Subject: |
bug#50804: Command substitutions for keys without keymaps |
Date: |
Mon, 27 Sep 2021 17:41:51 -0700 |
Lars Ingebrigtsen <larsi@gnus.org> writes:
>> I'm not sure about the notation. Perhaps "\\[[...]]" is okay, or
>> perhaps we want some other delimiter.
>
> What about... \\`C-h'
>
> Hm. Possibly too confusing.
Using some other delimiters than "\\[]" would probably be nice though,
because:
(substitute-command-keys "\\[[C-h]]")
=> "M-x [C-h]"
(substitute-command-keys "\\`C-h`")
=> "\\‘C-h‘"
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...