Variable: clear-message-function

clear-message-function is a variable defined in xdisp.c.

Value

clear-minibuffer-message

Documentation

If non-nil, function to clear echo-area messages.

Usually this function is called when the next input event arrives. It is expected to clear the message displayed by its counterpart function specified by set-message-function.

The function is called without arguments.

If this function returns a value that isn't dont-clear-message, the message is cleared from the echo area as usual. If this function returns dont-clear-message, this means that the message was already handled, and the original message text will not be cleared from the echo area.

View in manual

Probably introduced at or before Emacs version 27.1.

Source Code

// Defined in /usr/src/emacs/src/xdisp.c
  DEFVAR_LISP ("clear-message-function", Vclear_message_function,
	       doc: /* If non-nil, function to clear echo-area messages.
Usually this function is called when the next input event arrives.
It is expected to clear the message displayed by its counterpart
function specified by `set-message-function'.

The function is called without arguments.

If this function returns a value that isn't `dont-clear-message', the
message is cleared from the echo area as usual.  If this function
returns `dont-clear-message', this means that the message was already
handled, and the original message text will not be cleared from the
echo area.  */);