emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/bind-map db9d72efcd 31/97: Better version of bind-map-key


From: ELPA Syncer
Subject: [nongnu] elpa/bind-map db9d72efcd 31/97: Better version of bind-map-key
Date: Thu, 20 Jan 2022 07:59:12 -0500 (EST)

branch: elpa/bind-map
commit db9d72efcd75510ac892f9e234fea59afa7605b9
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]