Function: with-delayed-message

with-delayed-message is a macro defined in compat-29.el.

Signature

(with-delayed-message (timeout message) &rest body)

Documentation

[Compatibility macro for with-delayed-message, defined in Emacs 29.1. See
(compat) Emacs 29.1' for more details.]

Like progn, but display MESSAGE if BODY takes longer than TIMEOUT seconds. The MESSAGE form will be evaluated immediately, but the resulting string will be displayed only if BODY takes longer than TIMEOUT seconds.

NOTE: The compatibility function never displays the message, which is not problematic since the only effect of the function is to display a progress message to the user. Backporting this feature is not possible, since the implementation is directly baked into the Elisp interpreter.

Source Code

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

(compat-defmacro with-delayed-message (_args &rest body) ;; <compat-tests:with-delayed-message>
  "Like `progn', but display MESSAGE if BODY takes longer than TIMEOUT seconds.
The MESSAGE form will be evaluated immediately, but the resulting
string will be displayed only if BODY takes longer than TIMEOUT seconds.

NOTE: The compatibility function never displays the message,
which is not problematic since the only effect of the function is
to display a progress message to the user.  Backporting this
feature is not possible, since the implementation is directly
baked into the Elisp interpreter.

\(fn (timeout message) &rest body)"
  (declare (indent 1))
  (macroexp-progn body))