Emacs normally tries to redisplay the screen whenever it waits for input. With the following function, you can request an immediate attempt to redisplay, in the middle of Lisp code, without actually waiting for input.
This function tries immediately to redisplay, provided there are no pending input events.
If the optional argument force is non-
nil, it does all pending redisplay work even if input is available, with no pre-emption.
The function returns
tif it actually tried to redisplay, and
nilotherwise. A value of
tdoes not mean that redisplay proceeded to completion; it could have been pre-empted by newly arriving terminal input.
redisplay with no argument tries immediately to redisplay,
but has no effect on the usual rules for what parts of the screen to
redisplay. By contrast, the following function adds certain windows
to the pending redisplay work (as if their contents had completely
changed), but doesn't immediately try to do any redisplay work.
This function forces some or all windows to be updated on next redisplay. If object is a window, it requires eventual redisplay of that window. If object is a buffer or buffer name, it requires eventual redisplay of all windows displaying that buffer. If object is
nil(or omitted), it requires eventual redisplay of all windows.
force-window-update does not do a redisplay immediately.
(Emacs will do that when it waits for input.) Rather, its effect is
to put more work on the queue to be done by redisplay whenever there
is a chance.
Emacs redisplay normally stops if input arrives, and does not happen
at all if input is available before it starts. Most of the time, this
is exactly what you want. However, you can prevent preemption by
redisplay-dont-pause to a non-
If this variable is non-
nil, pending input does not prevent or halt redisplay; redisplay occurs, and finishes, regardless of whether input is available.
This variable specifies how many seconds Emacs waits between checks for new input during redisplay. (The default is 0.1 seconds.) If input has arrived when Emacs checks, it pre-empts redisplay and processes the available input before trying again to redisplay.
If this variable is
nil, Emacs does not check for input during redisplay, and redisplay cannot be preempted by input.
This variable is only obeyed on graphical terminals. For text terminals, see Terminal Output.