Skip to content
Browse files

Add which-key-dump-bindings

Fixes #209
  • Loading branch information...
justbur committed May 18, 2019
1 parent 187ac0e commit 77586e62b6d306bae07e4e3e093ba488724f4131
Showing with 15 additions and 0 deletions.
  1. +15 −0 which-key.el
@@ -2278,6 +2278,21 @@ current evil state. "
"Major-mode bindings")
(message "which-key: No map named %s" map-sym))))

(defun which-key-dump-bindings (prefix buffer-name)
"Dump bindings from PREFIX into buffer named BUFFER-NAME.
PREFIX should be a string suitable for `kbd'."
(interactive "sPrefix: \nB")
(let* ((buffer (get-buffer-create buffer-name))
(keys (which-key--get-bindings (kbd prefix))))
(with-current-buffer buffer
(dolist (key keys)
(insert (apply #'format "%s%s%s\n" key)))))
(switch-to-buffer-other-window buffer)))

(defun which-key-undo-key (&optional _)
"Undo last keypress and force which-key update."

0 comments on commit 77586e6

Please sign in to comment.
You can’t perform that action at this time.