From 15e8a371869da8c80e015403d16a2da67a0e7a2f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 28 May 2017 16:14:37 +0200 Subject: [PATCH] map!: support variables for keys --- core/core-keybinds.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/core-keybinds.el b/core/core-keybinds.el index 205667d10..2b2e4a6d0 100644 --- a/core/core-keybinds.el +++ b/core/core-keybinds.el @@ -178,10 +178,7 @@ Example forms))) (:prefix (let ((def (pop rest))) - (setq prefix - (if (or (symbolp def) (listp def)) - `(vconcat ,prefix (if (stringp ,def) (kbd ,def) ,def)) - `(vconcat ,prefix ,(if (stringp def) (kbd def) def)))) + (setq prefix `(vconcat ,prefix (kbd ,def))) (when desc (push `(doom--keybind-register ,(key-description (eval prefix)) ,desc ',modes) @@ -200,11 +197,14 @@ Example ;; It's a key-def pair ((or (stringp key) (characterp key) - (vectorp key)) + (vectorp key) + (symbolp key)) (unwind-protect (catch 'skip - (when (stringp key) - (setq key (kbd key))) + (cond ((symbolp key) + (setq key `(kbd ,key))) + ((stringp key) + (setq key (kbd key)))) (when prefix (setq key (append prefix (list key)))) (unless (> (length rest) 0)