[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bind-map 4489504e47 29/97: Check evil-keys before calling
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bind-map 4489504e47 29/97: Check evil-keys before calling evil-define-* |
Date: |
Thu, 20 Jan 2022 07:59:12 -0500 (EST) |
branch: elpa/bind-map
commit 4489504e479c906bae22bbbfa43abdccf551c032
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>
Check evil-keys before calling evil-define-*
---
bind-map.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/bind-map.el b/bind-map.el
index cf651962ac..32260f7564 100644
--- a/bind-map.el
+++ b/bind-map.el
@@ -137,7 +137,7 @@ Declare a prefix command for MAP named COMMAND-NAME."
(activate (intern (format "%s-activate" map)))
(activate-func (intern (format "%s-activate-function" map)))
(prefix-cmd (or (plist-get args :prefix-cmd)
- (intern (format "%s-cmds" map))))
+ (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)))
(evil-states (or (plist-get args :evil-states)
@@ -146,7 +146,6 @@ Declare a prefix command for MAP named COMMAND-NAME."
(major-modes (plist-get args :major-modes)))
`(progn
(defvar ,map (make-sparse-keymap))
-
(setq ,prefix-cmd ,map)
(setf (symbol-function ',prefix-cmd) ,map)
@@ -170,13 +169,15 @@ Declare a prefix command for MAP named COMMAND-NAME."
(progn
(dolist (key ',keys)
(define-key ,root-map-sym key ',prefix-cmd))
- (bind-map-evil-define-key
- ',evil-states ,root-map-sym ',evil-keys ',prefix-cmd))
+ (when ',evil-keys
+ (bind-map-evil-define-key
+ ',evil-states ,root-map-sym ',evil-keys ',prefix-cmd)))
;;bind in global maps
(dolist (key ',keys)
(global-set-key key ',prefix-cmd))
- (bind-map-evil-define-key
- ',evil-states nil ',evil-keys ',prefix-cmd)))))
+ (when ',evil-keys
+ (bind-map-evil-define-key
+ ',evil-states nil ',evil-keys ',prefix-cmd))))))
(put 'bind-map 'lisp-indent-function 'defun)
;;;###autoload
@@ -229,15 +230,14 @@ minor mode with -bm-map appended."
(defun bind-map-evil-define-key (states map keys def)
"Version of `evil-define-key' that binds DEF across multiple
STATES and KEYS."
- (when keys
- (require 'evil)
- (dolist (state states)
- (dolist (key keys)
- (if map
- (eval
- `(evil-define-key ',state ',map ,key ',def))
+ (require 'evil)
+ (dolist (state states)
+ (dolist (key keys)
+ (if map
(eval
- `(evil-global-set-key ',state ,key ',def)))))))
+ `(evil-define-key ',state ',map ,key ',def))
+ (eval
+ `(evil-global-set-key ',state ,key ',def))))))
;;;###autoload
(defun bind-map-set-keys (map key def &rest bindings)
- [nongnu] elpa/bind-map 510a24138d 97/97: Merge pull request #6 from skangas/bump-version, (continued)
- [nongnu] elpa/bind-map 510a24138d 97/97: Merge pull request #6 from skangas/bump-version, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 21f972e52d 08/97: Clarify some parts of README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map d609a7d784 12/97: Add cl-lib requirement, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 27ed3304d2 19/97: Revert one of the changes in the previous commit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 9f88b251f1 14/97: Fix typo, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 5077cb72cb 39/97: Add :override-minor-modes option for :keys, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 07eef581ef 15/97: Add URL, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map ce4e8e7f64 21/97: Fix typos in docstrings, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map f46bf57d7f 52/97: Add major-mode test, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map e3fa3cc383 26/97: Fix compiler warning, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 4489504e47 29/97: Check evil-keys before calling evil-define-*,
ELPA Syncer <=
- [nongnu] elpa/bind-map fb234332ff 32/97: Signal error if supplied map is not a keymap, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 3f6eba7b5b 56/97: Make sure active-var is bound before setting, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 99236303f6 84/97: Rename bind-map-for-modes-derived, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 96802ece2b 76/97: Increment version, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 4ceb7deb3a 90/97: Remove messages from tests, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 3b5a27e429 47/97: Tweak docstrings, ELPA Syncer, 2022/01/20