Adobe
Adobe

Reputation: 13467

Emacs: how do I read my keybindings?

How do I read read isearch-mode-map and global-map variables? With C-h v they are displayed in an unreadable form.

Edit:

C-h b is also useful in finding keybindings.

Upvotes: 2

Views: 82

Answers (1)

event_jr
event_jr

Reputation: 17707

substitute-command-keys will format a keymap nicely. To wit:

(defun le::describe-keymap (kmap-sym)
  (interactive "Skeymap:")
  (with-output-to-temp-buffer (format "*keymap: %s*" kmap-sym)
    (print (substitute-command-keys (format "\\{%s}" kmap-sym)))))

Upvotes: 5

Related Questions