Function: static-if

static-if is a macro defined in diff-hl.el.

Signature

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

Documentation

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.

View in manual

Probably introduced at or before Emacs version 30.1.

Source Code

;; Defined in /nix/store/cfz56rl3lp066226i0bmmgiicls3gcq7-emacs-packages-deps/share/emacs/site-lisp/elpa/diff-hl-20261001.135/diff-hl.el
(defmacro static-if (condition then-form &rest else-forms) ; since Emacs 30.1
  "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)))