Function: evil-get-auxiliary-keymap

evil-get-auxiliary-keymap is a byte-compiled function defined in evil-core.el.

Signature

(evil-get-auxiliary-keymap MAP STATE &optional CREATE IGNORE-PARENT)

Documentation

Get the auxiliary keymap for MAP in STATE.

If CREATE is non-nil, create an auxiliary keymap if MAP does not have one. If CREATE and IGNORE-PARENT are non-nil then a new auxiliary keymap is created even if the parent of MAP has one already.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-core.el
(defun evil-get-auxiliary-keymap (map state &optional create ignore-parent)
  "Get the auxiliary keymap for MAP in STATE.
If CREATE is non-nil, create an auxiliary keymap
if MAP does not have one. If CREATE and
IGNORE-PARENT are non-nil then a new auxiliary
keymap is created even if the parent of MAP has
one already."
  (when state
    (let* ((key (vector (intern (format "%s-state" state))))
           (parent-aux (when (and ignore-parent
                                  (keymap-parent map))
                         (lookup-key (keymap-parent map) key)))
           (aux (lookup-key map key)))
      (cond
       ((and ignore-parent
             (equal parent-aux aux)
             create)
        (evil-set-auxiliary-keymap map state))
       ((evil-auxiliary-keymap-p aux)
        aux)
       (create
        (evil-set-auxiliary-keymap map state))))))