Function: static-if

static-if is a macro defined in compat-30.el.

Signature

(static-if CONDITION THEN-FORM &rest ELSE-FORMS)

Documentation

[Compatibility macro for static-if, defined in Emacs 30.1. See (compat) Emacs
30.1' for more details.]

A conditional compilation macro. Evaluate CONDITION at macro-expansion time. If it is non-nil, expand the macro to THEN-FORM. Otherwise expand it to ELSE-FORMS enclosed in a progn form. ELSE-FORMS may be empty.

Source Code

;; Defined in ~/.emacs.d/elpa/compat-30.1.0.1/compat-30.el
;;;; Defined in subr.el

(compat-defmacro static-if (condition then-form &rest else-forms) ;; <compat-tests:static-if>
  "A conditional compilation macro.
Evaluate CONDITION at macro-expansion time.  If it is non-nil,
expand the macro to THEN-FORM.  Otherwise expand it to ELSE-FORMS
enclosed in a `progn' form.  ELSE-FORMS may be empty."
  (declare (indent 2) (debug (sexp sexp &rest sexp)))
  (if (eval condition lexical-binding)
      then-form
    (cons 'progn else-forms)))