Function: evil-get-minor-mode-keymap

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

Signature

(evil-get-minor-mode-keymap STATE MODE)

Documentation

Get the auxiliary keymap for MODE in STATE, creating one if it does not already exist.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-core.el
(defun evil-get-minor-mode-keymap (state mode)
  "Get the auxiliary keymap for MODE in STATE, creating one if it
does not already exist."
  (let ((state-entry (assq state evil-minor-mode-keymaps-alist)))
    (if (and state-entry
             (assq mode state-entry))
        (cdr (assq mode state-entry))
      (let ((map (make-sparse-keymap)))
        (evil-set-keymap-prompt
         map (format "Minor-mode keymap for %s in %s"
                     mode
                     (or (evil-state-property state :name)
                         (format "%s state" state))))
        (if state-entry
            (setcdr state-entry
                    (append (list (cons mode map)) (cdr state-entry)))
          (push (cons state (list (cons mode map)))
                evil-minor-mode-keymaps-alist))
        map))))