Function: with-delayed-message

with-delayed-message is a macro defined in subr.el.gz.

Signature

(with-delayed-message (TIMEOUT MESSAGE) &rest BODY)

Documentation

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.

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defmacro with-delayed-message (args &rest body)
  "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.

\(fn (TIMEOUT MESSAGE) &rest BODY)"
  (declare (indent 1))
  `(funcall-with-delayed-message ,(car args) ,(cadr args)
                                 (lambda ()
                                   ,@body)))