Go to the first, previous, next, last section, table of contents.


Displaying Messages

Often it is useful to be able to show the user a short one-line message, this is what the message function does.

Function: message message &optional display-now
This function displays the string message in the status line of the current window, then returns message.

If display-now is non-nil the message is rendered into the window immediately, otherwise it will not be visible until the next general redisplay (usually after each command exits).

Note that an alternate way of writing in the status line is to use the output stream t. See section Output Streams.

When writing interactive programs it is sometimes useful to be able to render the cursor in the status line. This shows that the next key press will not be subject to normal editing key bindings but to the special user interface (usually explained by a message in the status line).

For example the y-or-n-p function uses this technique to show that it needs an answer.

Variable: status-line-cursor
When this window-local variable is non-nil the window's cursor is rendered at the end of the message in the status line, not at the cursor's position in the main display.

Another way of alerting the user is to use the beep function,

Function: beep
This function rings a bell or flashes the current window or screen depending on your system.


Go to the first, previous, next, last section, table of contents.