branch: externals/setup commit a77d9f2c06b264f2f53cd3b8284cb1b8c73aea3d Author: Philip K <phil...@posteo.net> Commit: Philip K <phil...@posteo.net>
Don't apply kbd to symbols in :global, :bind, :unbind and :rebind --- setup.el | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/setup.el b/setup.el index 20b3c7c..07421f7 100644 --- a/setup.el +++ b/setup.el @@ -267,9 +267,7 @@ the first FEATURE." (setup-define :global (lambda (key command) `(global-set-key - ,(cond ((stringp key) (kbd key)) - ((symbolp key) `(kbd ,key)) - (key)) + ,(if (stringp key) (kbd key) key) #',command)) :documentation "Globally bind KEY to COMMAND." :debug '(form sexp) @@ -278,9 +276,7 @@ the first FEATURE." (setup-define :bind (lambda (key command) `(define-key (symbol-value setup-map) - ,(if (or (symbolp key) (stringp key)) - `(kbd ,key) - key) + ,(if (stringp key) (kbd key) key) #',command)) :documentation "Bind KEY to COMMAND in current map." :after-loaded t @@ -290,9 +286,7 @@ the first FEATURE." (setup-define :unbind (lambda (key) `(define-key (symbol-value setup-map) - ,(if (or (symbolp key) (stringp key)) - `(kbd ,key) - key) + ,(if (stringp key) (kbd key) key) nil)) :documentation "Unbind KEY in current map." :after-loaded t @@ -305,9 +299,7 @@ the first FEATURE." (dolist (key (where-is-internal ',command (symbol-value setup-map))) (define-key (symbol-value setup-map) key nil)) (define-key (symbol-value setup-map) - ,(if (or (symbolp key) (stringp key)) - `(kbd ,key) - key) + ,(if (stringp key) (kbd key) key) #',command))) :documentation "Unbind the current key for COMMAND, and bind it to KEY." :after-loaded t