unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50804: Command substitutions for keys without keymaps
@ 2021-09-25 18:01 Stefan Kangas
  2021-09-26  6:58 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Kangas @ 2021-09-25 18:01 UTC (permalink / raw)
  To: 50804

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.





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-11-22 15:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-25 18:01 bug#50804: Command substitutions for keys without keymaps Stefan Kangas
2021-09-26  6:58 ` 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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).