branch: elpa/bind-map
commit ddce68ed1de873f7bf8b52e56dec23fdb3fdcb47
Author: justbur <jus...@burkett.cc>
Commit: justbur <jus...@burkett.cc>

    Move evil-local-mode hook next to var
---
 bind-map.el | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/bind-map.el b/bind-map.el
index b21e6ceeb4..a6b5db9b11 100644
--- a/bind-map.el
+++ b/bind-map.el
@@ -117,14 +117,25 @@
   :group 'bind-map)
 
 (defvar bind-map-evil-local-bindings '()
-  "Each element of this list takes the form (OVERRIDE-MODE STATE
-KEY DEF) and corresponds to a binding for an evil local state
-map. OVERRIDE-MODE is the minor mode that must be enabled for
-these to be activated.")
+  "Each element takes the form (OVERRIDE-MODE STATE KEY DEF) and
+corresponds to a binding for an evil local state map.
+OVERRIDE-MODE is the minor mode that must be enabled for these to
+be activated.")
 (defvaralias 'bind-map-local-bindings 'bind-map-evil-local-bindings)
 (make-obsolete-variable 'bind-map-local-bindings
                         'bind-map-evil-local-bindings "2015-12-2")
 
+(defun bind-map-evil-local-mode-hook ()
+  "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)))
+        (define-key (symbol-value map) (nth 2 entry) (nth 3 entry))))))
+(add-hook 'evil-local-mode-hook 'bind-map-evil-local-mode-hook)
+
 ;;;###autoload
 (defmacro bind-map (map &rest args)
   "Bind keymap MAP in multiple locations.
@@ -327,16 +338,6 @@ concatenated with `bind-map-default-map-suffix'."
        ',map-name)))
 (put 'bind-map-for-minor-mode 'lisp-indent-function 'defun)
 
-(defun bind-map-evil-local-mode-hook ()
-  ;; 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)))
-        (define-key (symbol-value map) (nth 2 entry) (nth 3 entry))))))
-(add-hook 'evil-local-mode-hook 'bind-map-evil-local-mode-hook)
-
 ;;;###autoload
 (defun bind-map-set-keys (map key def &rest bindings)
   "Add a series of bindings to MAP.

Reply via email to