aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Burkett2021-07-27 21:50:13 -0400
committerGitHub2021-07-27 21:50:13 -0400
commitcc84b2d0da629ecb62a92e3fd23cbee4ea20ce56 (patch)
treee92f73ca76f006fb784ac913c0ea963081b0c0b5
parent55fcce0c6143044535bc6825a68f42ca83f58f00 (diff)
parent5ced0016f6fd44f6318f75367557fa129be36655 (diff)
downloademacs-cc84b2d0da629ecb62a92e3fd23cbee4ea20ce56.tar.gz
emacs-cc84b2d0da629ecb62a92e3fd23cbee4ea20ce56.zip
Merge pull request #315 from peniblec/keymap-names
Fix some keymap names not showing up
-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)