[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

23.3 Mode Line Format

Each Emacs window (aside from minibuffer windows) typically has a mode line at the bottom, which displays status information about the buffer displayed in the window. The mode line contains information about the buffer, such as its name, associated file, depth of recursive editing, and major and minor modes. A window can also have a header line, which is much like the mode line but appears at the top of the window (starting in Emacs 21).

This section describes how to control the contents of the mode line and header line. We include it in this chapter because much of the information displayed in the mode line relates to the enabled major and minor modes.

mode-line-format is a buffer-local variable that holds a template used to display the mode line of the current buffer. All windows for the same buffer use the same mode-line-format, so their mode lines appear the same--except for scrolling percentages, and line and column numbers, since those depend on point and on how the window is scrolled. header-line-format is used likewise for header lines.

The mode line and header line of a window are normally updated whenever a different buffer is shown in the window, or when the buffer's modified-status changes from nil to t or vice-versa. If you modify any of the variables referenced by mode-line-format (see section 23.3.2 Variables Used in the Mode Line), or any other variables and data structures that affect how text is displayed (see section 38. Emacs 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.

Function: force-mode-line-update
Force redisplay of the current buffer's mode line and header line.

The mode line is usually displayed in inverse video; see mode-line-inverse-video in 38.15 Inverse Video.

23.3.1 The Data Structure of the Mode Line  The data structure that controls the mode line.
23.3.2 Variables Used in the Mode Line  Variables used in that data structure.
23.3.3 %-Constructs in the Mode Line  Putting information into a mode line.
23.3.4 Properties in the Mode Line  Using text properties in the mode line.
23.3.5 Window Header Lines  Like a mode line, but at the top.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on May 2, 2002 using texi2html