unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Get key-binding for a command and print key binding in kbd syntax
@ 2023-02-09  8:33 Tassilo Horn
  2023-02-09 10:28 ` Robert Pluim
  0 siblings, 1 reply; 10+ messages in thread
From: Tassilo Horn @ 2023-02-09  8:33 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

someone asked on another list if mu4e could replace its main buffer's
content, parts of which looks like

  Maildirs

	* [ji] /Fastmail/GNU                                 0/1244
	* [ja] /Fastmail/Archive                             0/8976
	* [jb] /Fastmail/Drafts                              0/24

where j is the key bound to the mu4e-search-maildir command by default,
with the correct key bound in its mode's map.  I.e., right now, j is
hard-coded and conforms to the standard binding but is wrong when you
define-key it otherwise.

So the question is: how do you get the key(s) for a command?
`where-is-internal' looks promising giving ([106] [menu-bar mu4e Search\
maildir]) where 106 is the char ?j.  If that's the right way, is numeric
vector vs. vector of symbols the right way to distinguish key bindings
from menu items?

And the other question: how to I convert such a key binding vector to a
string in kbd syntax for display purposes?

Thanks,
Tassilo



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

end of thread, other threads:[~2023-02-09 14:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-09  8:33 Get key-binding for a command and print key binding in kbd syntax Tassilo Horn
2023-02-09 10:28 ` Robert Pluim
2023-02-09 10:50   ` Tassilo Horn
2023-02-09 11:09     ` Tassilo Horn
2023-02-09 11:44       ` Robert Pluim
2023-02-09 11:58         ` Tassilo Horn
2023-02-09 12:20           ` Robert Pluim
2023-02-09 12:22             ` Tassilo Horn
2023-02-09 13:46               ` Robert Pluim
2023-02-09 14:10                 ` Tassilo Horn

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).