Function: set-multi-message

set-multi-message is a byte-compiled function defined in minibuffer.el.gz.

Signature

(set-multi-message MESSAGE)

Documentation

Return recent messages as one string to display in the echo area.

Individual messages will be separated by a newline. Up to multi-message-max messages can be accumulated, and the accumulated messages are discarded when multi-message-timeout seconds have elapsed since the first message. Note that this feature works best only when resize-mini-windows is at its default value grow-only.

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/minibuffer.el.gz
(defun set-multi-message (message)
  "Return recent messages as one string to display in the echo area.
Individual messages will be separated by a newline.
Up to `multi-message-max' messages can be accumulated, and the
accumulated messages are discarded when `multi-message-timeout'
seconds have elapsed since the first message.
Note that this feature works best only when `resize-mini-windows'
is at its default value `grow-only'."
  (let ((last-message (car multi-message-list)))
    (unless (and last-message (equal message (aref last-message 1)))
      (when last-message
        (cond
         ((> (float-time) (+ (aref last-message 0) multi-message-timeout))
          (setq multi-message-list nil))
         ((or
           ;; `message-log-max' was nil, potential clutter.
           (aref last-message 2)
           ;; Remove old message that is substring of the new message
           (string-prefix-p (aref last-message 1) message))
          (setq multi-message-list (cdr multi-message-list)))))
      (push (vector (float-time) message (not message-log-max)) multi-message-list)
      (when (> (length multi-message-list) multi-message-max)
        (setf (nthcdr multi-message-max multi-message-list) nil)))
    (mapconcat (lambda (m) (aref m 1))
               (reverse multi-message-list)
               multi-message-separator)))