branch: elpa/bind-map commit db9d72efcd75510ac892f9e234fea59afa7605b9 Author: justbur <jus...@burkett.cc> Commit: justbur <jus...@burkett.cc>
Better version of bind-map-key --- bind-map.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bind-map.el b/bind-map.el index 2e4ac36671..05cfa1c05c 100644 --- a/bind-map.el +++ b/bind-map.el @@ -225,7 +225,11 @@ concatenated with `bind-map-default-map-suffix'." (put 'bind-map-for-minor-mode 'lisp-indent-function 'defun) (defun bind-map-kbd (key) - (if (stringp key) (kbd key) (kbd (eval key)))) + "If KEY is a string use `kbd'. If it's a symbol, use +`symbol-value' then `kbd'." + (cond ((stringp key) (kbd key)) + ((symbolp key) (kbd (symbol-value key))) + (t (error "bind-map-kbd: KEY should be a string or a symbol. KEY is %s" key)))) (defun bind-map-evil-define-key (states map keys def) "Version of `evil-define-key' that binds DEF across multiple