[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bind-map ebc4c9fb11 34/97: Remove bind-map-kbd hack
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bind-map ebc4c9fb11 34/97: Remove bind-map-kbd hack |
Date: |
Thu, 20 Jan 2022 07:59:12 -0500 (EST) |
branch: elpa/bind-map
commit ebc4c9fb119ef2381065548971be41478b1fd884
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>
Remove bind-map-kbd hack
---
bind-map.el | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/bind-map.el b/bind-map.el
index 6168cc5465..d1d704182b 100644
--- a/bind-map.el
+++ b/bind-map.el
@@ -138,8 +138,8 @@ Declare a prefix command for MAP named COMMAND-NAME."
(activate-func (intern (format "%s-activate-function" map)))
(prefix-cmd (or (plist-get args :prefix-cmd)
(intern (format "%s-prefix" map))))
- (keys (mapcar 'bind-map-kbd (plist-get args :keys)))
- (evil-keys (mapcar 'bind-map-kbd (plist-get args :evil-keys)))
+ (keys (plist-get args :keys))
+ (evil-keys (plist-get args :evil-keys))
(evil-states (or (plist-get args :evil-states)
bind-map-default-evil-states))
(minor-modes (plist-get args :minor-modes))
@@ -169,17 +169,17 @@ Declare a prefix command for MAP named COMMAND-NAME."
(if (or ',minor-modes ',major-modes)
;;bind keys in root-map
(progn
- (dolist (key ',keys)
- (define-key ,root-map key ',prefix-cmd))
+ (dolist (key (list ,@keys))
+ (define-key ,root-map (kbd key) ',prefix-cmd))
(when ',evil-keys
(bind-map-evil-define-key
- ',evil-states ,root-map ',evil-keys ',prefix-cmd)))
+ ',evil-states ,root-map (list ,@evil-keys) ',prefix-cmd)))
;;bind in global maps
- (dolist (key ',keys)
- (global-set-key key ',prefix-cmd))
+ (dolist (key (list ,@keys))
+ (global-set-key (kbd key) ',prefix-cmd))
(when ',evil-keys
(bind-map-evil-define-key
- ',evil-states nil ',evil-keys ',prefix-cmd))))))
+ ',evil-states nil (list ,@evil-keys) ',prefix-cmd))))))
(put 'bind-map 'lisp-indent-function 'defun)
;;;###autoload
@@ -226,13 +226,6 @@ concatenated with `bind-map-default-map-suffix'."
',map-name)))
(put 'bind-map-for-minor-mode 'lisp-indent-function 'defun)
-(defun bind-map-kbd (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
STATES and KEYS."
@@ -241,9 +234,9 @@ STATES and KEYS."
(dolist (key keys)
(if map
(eval
- `(evil-define-key ',state ',map ,key ',def))
+ `(evil-define-key ',state ',map (kbd ,key) ',def))
(eval
- `(evil-global-set-key ',state ,key ',def))))))
+ `(evil-global-set-key ',state (kbd ,key) ',def))))))
;;;###autoload
(defun bind-map-set-keys (map key def &rest bindings)
@@ -251,7 +244,7 @@ STATES and KEYS."
BINDINGS is a series of KEY DEF pairs. Each KEY should be a
string suitable for `kbd'."
(while key
- (define-key map (bind-map-kbd key) def)
+ (define-key map (kbd key) def)
(setq key (pop bindings) def (pop bindings))))
(put 'bind-map-set-keys 'lisp-indent-function 'defun)
@@ -262,8 +255,8 @@ Default bindings never override existing ones. BINDINGS is a
series of KEY DEF pairs. Each KEY should be a string suitable for
`kbd'."
(while key
- (unless (lookup-key map (bind-map-kbd key))
- (define-key map (bind-map-kbd key) def))
+ (unless (lookup-key map (kbd key))
+ (define-key map (kbd key) def))
(setq key (pop bindings) def (pop bindings))))
(put 'bind-map-set-key-defaults 'lisp-indent-function 'defun)
- [nongnu] elpa/bind-map a8a2937ecc 38/97: Minor tweak to previous commit, (continued)
- [nongnu] elpa/bind-map a8a2937ecc 38/97: Minor tweak to previous commit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map faaa33d909 77/97: Prefer eval-after-load to require for evil funcs, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 61fe55e097 17/97: Can't simply use cl-pushnew, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 5508980148 69/97: Account for multiple declarations of the same map, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b05ea98102 37/97: Add option to use local state maps, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 7d20946692 04/97: Add autoloads, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 7de08fe592 43/97: Move a defvar and reword docstring, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map bb7a8b2258 59/97: Remove declare-function from previous commit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 6d05297e3c 20/97: Add another example and more detail to README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map d47be94d23 63/97: Don't try to bind keys that are nil or "", ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map ebc4c9fb11 34/97: Remove bind-map-kbd hack,
ELPA Syncer <=
- [nongnu] elpa/bind-map 8ec4516db2 48/97: Remove use of evil-define-key, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map c182707793 41/97: Remove unnecessary helper functions and reorg, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b0b9e18947 66/97: Revert last commit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map f51d4b0c0d 79/97: Add bind-map-for-modes-derived, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 21b7ba7eca 30/97: Fix some docstrings, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map cc1db8958c 64/97: Version 0.1, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 988f14eb77 65/97: Use evil-define-minor-mode-key for minor-mode keys, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 292794739c 71/97: Fix incorrect check of override mode in local hook, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b187069313 22/97: Add short versions for single major/minor mode, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map d45971cd40 46/97: Use minor mode for overriding behavior, ELPA Syncer, 2022/01/20