aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--which-key-tests.el8
-rw-r--r--which-key.el2
2 files changed, 9 insertions, 1 deletions
diff --git a/which-key-tests.el b/which-key-tests.el
index cce75ce4066..1f2b1965ec3 100644
--- a/which-key-tests.el
+++ b/which-key-tests.el
@@ -44,6 +44,14 @@
44 ("C-b" . "group:mymap") 44 ("C-b" . "group:mymap")
45 ("C-c" . "group:mymap2")))))) 45 ("C-c" . "group:mymap2"))))))
46 46
47(ert-deftest which-key-test--named-prefix-keymap ()
48 (define-prefix-command 'which-key-test--named-map)
49 (let ((map (make-sparse-keymap)))
50 (define-key map "\C-a" 'which-key-test--named-map)
51 (should (equal
52 (which-key--get-keymap-bindings map)
53 '(("C-a" . "which-key-test--named-map"))))))
54
47(ert-deftest which-key-test--prefix-declaration () 55(ert-deftest which-key-test--prefix-declaration ()
48 "Test `which-key-declare-prefixes' and 56 "Test `which-key-declare-prefixes' and
49`which-key-declare-prefixes-for-mode'. See Bug #109." 57`which-key-declare-prefixes-for-mode'. See Bug #109."
diff --git a/which-key.el b/which-key.el
index 0fdcb7aefb2..9a334ccc1ac 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1743,8 +1743,8 @@ Requires `which-key-compute-remaps' to be non-nil"
1743 (binding 1743 (binding
1744 (cons key-desc 1744 (cons key-desc
1745 (cond 1745 (cond
1746 ((keymapp def) "prefix")
1747 ((symbolp def) (which-key--compute-binding def)) 1746 ((symbolp def) (which-key--compute-binding def))
1747 ((keymapp def) "prefix")
1748 ((eq 'lambda (car-safe def)) "lambda") 1748 ((eq 'lambda (car-safe def)) "lambda")
1749 ((eq 'closure (car-safe def)) "closure") 1749 ((eq 'closure (car-safe def)) "closure")
1750 ((stringp def) def) 1750 ((stringp def) def)