Function: static-unless

static-unless is a macro defined in subr.el.gz.

Signature

(static-unless CONDITION &rest BODY)

Documentation

A conditional compilation macro.

Evaluate CONDITION at macro-expansion time. If it is nil, expand the macro to evaluate all BODY forms sequentially and return the value of the last one, or nil if there are none.

View in manual

Probably introduced at or before Emacs version 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defmacro static-unless (condition &rest body)
  "A conditional compilation macro.
Evaluate CONDITION at macro-expansion time.  If it is nil,
expand the macro to evaluate all BODY forms sequentially and return
the value of the last one, or nil if there are none."
  (declare (indent 1) (debug t))
  (if body
      (if (eval condition lexical-binding)
          nil
        (cons 'progn body))
    (macroexp-warn-and-return (format-message "`static-unless' with empty body")
                              (list 'progn nil nil) '(empty-body static-unless) t)))