branch: master
commit 3ff8f48193dce6670ac57f8e67469435bc0a71ba
Author: Justin Burkett <[email protected]>
Commit: Justin Burkett <[email protected]>
Allow null DEF in which-key--process-define-key-args
This is useful for naming prefixes
---
which-key.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/which-key.el b/which-key.el
index 22bed08..15b599a 100644
--- a/which-key.el
+++ b/which-key.el
@@ -915,11 +915,11 @@ in which-key with DESCRIPTION. This function is meant to
be used
as :before advice for `define-key'."
(when (and (consp def)
(stringp (car def))
- (symbolp (cdr def))
- (cdr def))
+ (symbolp (cdr def)))
(let ((key-desc (regexp-quote (key-description key))))
(push (cons (cons (format "%s\\'" key-desc)
- (format "\\`%s\\'" (symbol-name (cdr def))))
+ (when (cdr def)
+ (format "\\`%s\\'" (symbol-name (cdr def)))))
(cons nil (car def)))
which-key-replacement-alist))))