Emacs: print key binding for a command or list all key bindings

Posted by Yktula on Stack Overflow See other posts from Stack Overflow or by Yktula
Published on 2010-05-16T23:34:19Z Indexed on 2010/05/16 23:40 UTC
Read the original article Hit count: 189

Filed under:
|

In Emacs (GNU 23.2, *nix), how can I:

  1. list the key sequences bound to a particular command? For example, how can we list all the key sequences that execute save-buffers-kill-emacs, with the output of key sequences bound to it? Assuming we can do this, listing the key sequences bound to goto-line should print the output: M-g g on a default install.
  2. list all key-bindings? Does C-h b do this? Would it print my own bindings?

I am aware that executing the command directly can print a key sequence it can be activated with, but it doesn't always do so, and a few things happen, including:
(1) the output doesn't remain for long, (2) the command is executed.

I want a command that lists for me (preferably all) the bindings attached to a given command, without executing the command, or something like that.

© Stack Overflow or respective owner

Related posts about emacs

Related posts about keybindings