[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bind-map 89747f7240 75/97: Fix evil-local-mode-hook logic
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bind-map 89747f7240 75/97: Fix evil-local-mode-hook logic |
Date: |
Thu, 20 Jan 2022 07:59:26 -0500 (EST) |
branch: elpa/bind-map
commit 89747f7240e5f51084fd94aad502d67f426e03b4
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>
Fix evil-local-mode-hook logic
Can't be sure that the override modes are enabled before this hook is
run so we check if the global mode is enabled and if the local mode is
set explicitly in a prior hook (presumably a major mode hook).
---
bind-map.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/bind-map.el b/bind-map.el
index 4d40d0c962..8d64d7028f 100644
--- a/bind-map.el
+++ b/bind-map.el
@@ -129,10 +129,16 @@ be activated.")
"Called to activate local state maps in a buffer."
;; format is (OVERRIDE-MODE STATE KEY DEF)
(dolist (entry bind-map-evil-local-bindings)
- (let ((map (intern (format "evil-%s-state-local-map" (nth 1 entry)))))
- (when (and (nth 0 entry)
- (boundp map)
- (keymapp (symbol-value map)))
+ (let* ((map (intern (format "evil-%s-state-local-map" (nth 1 entry))))
+ (mode (nth 0 entry))
+ (global-mode (intern (format "global-%s" (nth 0 entry))))
+ (set-explicitly (intern (format "%s-set-explicitly" mode))))
+ (when (and (boundp global-mode) (boundp mode)
+ (boundp set-explicitly) (boundp map)
+ (keymapp (symbol-value map))
+ (symbol-value global-mode)
+ (not (and (symbol-value set-explicitly)
+ (null (symbol-value mode)))))
(define-key (symbol-value map) (nth 2 entry) (nth 3 entry))))))
(add-hook 'evil-local-mode-hook 'bind-map-evil-local-mode-hook)
- [nongnu] elpa/bind-map e239bbdaef 44/97: Always use global evil maps, (continued)
- [nongnu] elpa/bind-map e239bbdaef 44/97: Always use global evil maps, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map af26966c9a 57/97: Make macro expansion prettier, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 393879d260 58/97: Satisfy compiler, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 2fafc10f7d 45/97: Rename a var and a function and tweak a docstring, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map e94572b50b 74/97: Increment version, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 00b7778826 68/97: Fix minor-mode tests, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 9ae3e9b113 72/97: Increment version, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 40ed95d4d5 80/97: Add bindings keyword, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 6f84c0254f 78/97: Increment version, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map c335674139 60/97: Add files for travis, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 89747f7240 75/97: Fix evil-local-mode-hook logic,
ELPA Syncer <=
- [nongnu] elpa/bind-map 76b8e2ab6c 85/97: Add tests for inheritance, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 6ba28e31aa 83/97: Revert change to prefix-cmd handling, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map fe76f92777 91/97: Add default keys and default evil-keys, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 26a3b5571d 88/97: Make return val consistent in bind-map, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map bf4181e3a4 95/97: Add types to defcustoms, ELPA Syncer, 2022/01/20
- [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