From: Stefan Kangas <stefan@marxist.se>
To: 50804@debbugs.gnu.org
Subject: bug#50804: Command substitutions for keys without keymaps
Date: Sat, 25 Sep 2021 11:01:38 -0700 [thread overview]
Message-ID: <CADwFkmmjzbwJ=V47V1YUpTAqQQHh9pUk2asCMfyd4-LctYp2=w@mail.gmail.com> (raw)
Severity: wishlist
We have "\\[foo]" command substitutions in `substitute-command-keys'.
This also puts the face help-key-binding on the replaced text, which
makes key bindings stand out more clearly.
We don't always have a keymap to refer to, because the keys are read
through `read-key' or similar.
For example, in ispell.el:
(message (concat "C-h or ? for more options; SPC to leave "
"unchanged, Character to replace word")))
In other cases, we have the same situation in a docstring, for example
in `isearch-lax-whitespace'.
It would be nice if we could have some way of putting a face on such key
bindings, without having to fiddle with propertize. For example:
(message (substitute-command-keys
(concat "\\[[C-h]] or \\[[?]] for more options;
\\[[SPC]] to leave "
"unchanged, Character to replace word"))))
I'm not sure about the notation. Perhaps "\\[[...]]" is okay, or
perhaps we want some other delimiter.
And perhaps we would want support for this notation also in
`format-messages'? I'm not sure, but I'm putting it out there.
next reply other threads:[~2021-09-25 18:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-25 18:01 Stefan Kangas [this message]
2021-09-26 6:58 ` bug#50804: Command substitutions for keys without keymaps Lars Ingebrigtsen
2021-09-28 0:41 ` Stefan Kangas
2021-09-28 5:27 ` Lars Ingebrigtsen
2021-11-20 15:05 ` Stefan Kangas
2021-11-21 8:26 ` Lars Ingebrigtsen
2021-11-21 13:35 ` Stefan Kangas
2021-11-21 19:56 ` Lars Ingebrigtsen
2021-11-22 5:48 ` Stefan Kangas
2021-11-22 15:10 ` Eli Zaretskii
2021-11-22 15:15 ` Eli Zaretskii
2021-11-22 15:29 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADwFkmmjzbwJ=V47V1YUpTAqQQHh9pUk2asCMfyd4-LctYp2=w@mail.gmail.com' \
--to=stefan@marxist.se \
--cc=50804@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.