From: Robert Pluim <rpluim@gmail.com>
To: Tassilo Horn <tsdh@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Get key-binding for a command and print key binding in kbd syntax
Date: Thu, 09 Feb 2023 11:28:39 +0100 [thread overview]
Message-ID: <87cz6jm8tk.fsf@gmail.com> (raw)
In-Reply-To: <87lel72mqs.fsf@gnu.org> (Tassilo Horn's message of "Thu, 09 Feb 2023 09:33:16 +0100")
>>>>> On Thu, 09 Feb 2023 09:33:16 +0100, Tassilo Horn <tsdh@gnu.org> said:
Tassilo> Hi all,
Tassilo> someone asked on another list if mu4e could replace its main buffer's
Tassilo> content, parts of which looks like
Tassilo> Maildirs
Tassilo> * [ji] /Fastmail/GNU 0/1244
Tassilo> * [ja] /Fastmail/Archive 0/8976
Tassilo> * [jb] /Fastmail/Drafts 0/24
Tassilo> where j is the key bound to the mu4e-search-maildir command by default,
Tassilo> with the correct key bound in its mode's map. I.e., right now, j is
Tassilo> hard-coded and conforms to the standard binding but is wrong when you
Tassilo> define-key it otherwise.
Tassilo> So the question is: how do you get the key(s) for a command?
Tassilo> `where-is-internal' looks promising giving ([106] [menu-bar mu4e Search\
Tassilo> maildir]) where 106 is the char ?j. If that's the right way, is numeric
Tassilo> vector vs. vector of symbols the right way to distinguish key bindings
Tassilo> from menu items?
`substitute-command-keys'
Tassilo> And the other question: how to I convert such a key binding vector to a
Tassilo> string in kbd syntax for display purposes?
`key-description'
Robert
--
next prev parent reply other threads:[~2023-02-09 10:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=87cz6jm8tk.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tsdh@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.