Function: evil-define-interactive-code
evil-define-interactive-code is a macro defined in evil-macros.el.
Signature
(evil-define-interactive-code CODE (PROMPT) [[KEY VALUE]...] BODY...)
Documentation
Define an interactive code.
PROMPT, if given, is the remainder of the interactive string up to the next newline. Command properties may be specified via KEY-VALUE pairs. BODY should evaluate to a list of values.
Source Code
;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-macros.el
(defmacro evil-define-interactive-code (code &rest body)
"Define an interactive code.
PROMPT, if given, is the remainder of the interactive string
up to the next newline. Command properties may be specified
via KEY-VALUE pairs. BODY should evaluate to a list of values.
\(fn CODE (PROMPT) [[KEY VALUE]...] BODY...)"
(declare (indent defun))
(let* ((args (and (> (length body) 1) (listp (car body))
(pop body)))
(doc (when (stringp (car body)) (pop body)))
(properties
(cl-loop while (keywordp (car body))
collect (pop body) collect (pop body)))
(func (if args
`(lambda ,args
,@(when doc `(,doc))
,@body)
`',(macroexp-progn body))))
`(eval-and-compile
(evil--add-to-alist
evil-interactive-alist ,code (cons ,func ',properties))
,code)))