branch: externals/which-key commit 5ced0016f6fd44f6318f75367557fa129be36655 Author: Kévin Le Gouguec <kevin.legoug...@gmail.com> Commit: Kévin Le Gouguec <kevin.legoug...@gmail.com>
Fix some keymap names not showing up Closes #314. --- which-key-tests.el | 8 ++++++++ which-key.el | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/which-key-tests.el b/which-key-tests.el index cce75ce..1f2b196 100644 --- a/which-key-tests.el +++ b/which-key-tests.el @@ -44,6 +44,14 @@ ("C-b" . "group:mymap") ("C-c" . "group:mymap2")))))) +(ert-deftest which-key-test--named-prefix-keymap () + (define-prefix-command 'which-key-test--named-map) + (let ((map (make-sparse-keymap))) + (define-key map "\C-a" 'which-key-test--named-map) + (should (equal + (which-key--get-keymap-bindings map) + '(("C-a" . "which-key-test--named-map")))))) + (ert-deftest which-key-test--prefix-declaration () "Test `which-key-declare-prefixes' and `which-key-declare-prefixes-for-mode'. See Bug #109." diff --git a/which-key.el b/which-key.el index 0fdcb7a..9a334cc 100644 --- a/which-key.el +++ b/which-key.el @@ -1743,8 +1743,8 @@ Requires `which-key-compute-remaps' to be non-nil" (binding (cons key-desc (cond - ((keymapp def) "prefix") ((symbolp def) (which-key--compute-binding def)) + ((keymapp def) "prefix") ((eq 'lambda (car-safe def)) "lambda") ((eq 'closure (car-safe def)) "closure") ((stringp def) def)