Function: evil-state-property

evil-state-property is a byte-compiled function defined in evil-common.el.

Signature

(evil-state-property STATE PROP &optional VALUE)

Documentation

Return the value of property PROP for STATE.

PROP is a keyword as used by evil-define-state. STATE is the state's symbolic name. If VALUE is non-nil and the value is a variable, return the value of that variable.

If STATE is t, return an association list of states and their PROP values instead.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-common.el
(defun evil-state-property (state prop &optional value)
  "Return the value of property PROP for STATE.
PROP is a keyword as used by `evil-define-state'. STATE is the state's
symbolic name. If VALUE is non-nil and the value is a variable, return
the value of that variable.

If STATE is t, return an association list of states and their PROP
values instead."
  (if (eq state t)
      (cl-loop for (key . plist) in evil-state-properties with result do
               (let ((p (plist-member plist prop)))
                 (when p (push (cons key (cadr p)) result)))
               finally return result)
    (let ((val (plist-get (cdr (assq state evil-state-properties)) prop)))
      (if (and value (symbolp val) (boundp val))
          (symbol-value val)
        val))))