mode-line-format is a buffer-local variable that holds a
mode line construct, a kind of template, which controls what is
displayed on the mode line of the current buffer. The value of
header-line-format specifies the buffer's header line in the
same way. All windows for the same buffer use the same
mode-line-format and header-line-format.
For efficiency, Emacs does not continuously recompute the mode
line and header line of a window. It does so when circumstances
appear to call for it—for instance, if you change the window
configuration, switch buffers, narrow or widen the buffer, scroll, or
change the buffer's modification status. If you modify any of the
variables referenced by mode-line-format (see Mode Line Variables), or any other variables and data structures that affect
how text is displayed (see Display), you may want to force an
update of the mode line so as to display the new information or
display it in the new way.
Force redisplay of the current buffer's mode line and header line. The next redisplay will update the mode line and header line based on the latest values of all relevant variables. With optional non-
nilall, force redisplay of all mode lines and header lines.This function also forces recomputation of the menu bar menus and the frame title.
The selected window's mode line is usually displayed in a different
color using the face mode-line. Other windows' mode lines
appear in the face mode-line-inactive instead. See Faces.