diff --git a/lisp/doom-lib.el b/lisp/doom-lib.el index b65414713..3caca2e7e 100644 --- a/lisp/doom-lib.el +++ b/lisp/doom-lib.el @@ -286,6 +286,14 @@ See `eval-if!' for details on this macro's purpose." (when (eval cond) (macroexp-progn body))) +(defmacro eval-when-compile! (&rest body) + "Evaluate BODY *only* during byte-compilation. + +Unlike `eval-when-compile', which is equivalent to `progn' in interpreted code, +this macro's BODY will only be evaluated during byte-compilation." + (declare (indent 0)) + (when (bound-and-true-p byte-compile-current-file) + (ignore (eval (macroexp-progn body) t)))) ;;; Closure factories (defmacro lambda! (arglist &rest body)