This section describes the functions for explicitly producing echo area messages. Many other Emacs features display messages there, too.
This function displays a message in the echo area. The argument format-string is similar to a C language
printfformat string. See
formatin Formatting Strings, for the details on the conversion specifications.
messagereturns the constructed string.
In batch mode,
messageprints the message text on the standard error stream, followed by a newline.
If format-string, or strings among the arguments, have
facetext properties, these affect the way the message is displayed.
If format-string is
nilor the empty string,
messageclears the echo area; if the echo area has been expanded automatically, this brings it back to its normal size. If the minibuffer is active, this brings the minibuffer contents back onto the screen immediately.(message "Minibuffer depth is %d." (minibuffer-depth)) -| Minibuffer depth is 0. ⇒ "Minibuffer depth is 0." ---------- Echo Area ---------- Minibuffer depth is 0. ---------- Echo Area ----------
To automatically display a message in the echo area or in a pop-buffer, depending on its size, use
This construct displays a message in the echo area temporarily, during the execution of body. It displays message, executes body, then returns the value of the last body form while restoring the previous echo area contents.
This function displays a message like
message, but may display it in a dialog box instead of the echo area. If this function is called in a command that was invoked using the mouse—more precisely, if
last-nonmenu-event(see Command Loop Info) is either
nilor a list—then it uses a dialog box or pop-up menu to display the message. Otherwise, it uses the echo area. (This is the same criterion that
y-or-n-puses to make a similar decision; see Yes-or-No Queries.)
You can force use of the mouse or of the echo area by binding
last-nonmenu-eventto a suitable value around the call.
This function displays the message message, which may be either a string or a buffer. If it is shorter than the maximum height of the echo area, as defined by
max-mini-window-height, it is displayed in the echo area, using
display-bufferis used to show it in a pop-up buffer.
Returns either the string shown in the echo area, or when a pop-up buffer is used, the window used to display it.
If message is a string, then the optional argument buffer-name is the name of the buffer used to display it when a pop-up buffer is used, defaulting to ‘*Message*’. In the case where message is a string and displayed in the echo area, it is not specified whether the contents are inserted into the buffer anyway.
The optional arguments not-this-window and frame are as for
display-buffer, and only used if a buffer is displayed.
This function returns the message currently being displayed in the echo area, or
nilif there is none.