justbur / emacs-which-key

Emacs package that displays available keybindings in popup
GNU General Public License v3.0
1.74k stars 87 forks source link

fix which-key--show-keymap for which-key-enable-extended-define-key #299

Closed zhaojiangbin closed 3 years ago

zhaojiangbin commented 3 years ago

With which-key-enable-extended-define-key set to 't, given the keymap and bindings below:

  (setq a-map (make-sparse-keymap))
  (bind-keys :map a-map
             ("a" . ("key 1" . command-1))
             ("b" . ("key b" . command-2)))

The output of (which-key--get-keymap-bindings a-map) was having "unknown" as the key descriptions.

This change fixes it therefore allows the following to work as expected:

(which-key--show-keymap "A map" a-map)

Pull requests are welcome as long as the following apply.

  1. The issue you are fixing or feature you are adding is clearly described and/or referenced in the pull request or github issue.
  2. Since which-key is on GNU ELPA, any legally significant changes must have their copyright assigned to the FSF (more info). If you have not done so and would like to assign copyright, please see the request form. This process is easy, but can be slow.
justbur commented 3 years ago

thank you