Function: evil-initialize-local-keymaps
evil-initialize-local-keymaps is a byte-compiled function defined in
evil-core.el.
Signature
(evil-initialize-local-keymaps)
Documentation
Initialize a buffer-local value for local keymaps as necessary.
The initial value is that of make-sparse-keymap.
Source Code
;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-core.el
;; Local keymaps are implemented using buffer-local variables.
;; However, unless a buffer-local value already exists,
;; `define-key' acts on the variable's default (global) value.
;; So we need to initialize the variable whenever we enter a
;; new buffer or when the buffer-local values are reset.
(defun evil-initialize-local-keymaps ()
"Initialize a buffer-local value for local keymaps as necessary.
The initial value is that of `make-sparse-keymap'."
(dolist (entry evil-local-keymaps-alist)
(let ((map (cdr entry)))
(unless (and (keymapp (symbol-value map))
(local-variable-p map))
(set map (make-sparse-keymap))))))