EmacsWiki: Mode Line (original) (raw)

The mode line appears at the bottom of every Emacs internal window. It has useful summary information about the buffer shown in the window, including its name and current modes.

An Emacs mode-line serves a similar function to what some other applications call a “status bar”, but the reported status is specific to the mode-line’s window.

You can configure the mode line in various ways.

Appearance

Graphical

This screenshot shows Emacs 27.1. Three buffers visiting files are shown, each in a window with a mode-line at its bottom. The mode-lines use black text on a grey/silver background. The main parts of the window use a white background.

ModeLineCalloutsScreenShot

Text

This gives an idea of what the mode-lines would look like on a text-only character-cell display for the same three windows above:

-UUU:----F1      short-unicode   All L4    (Fundamental) --------------------
-UU-(DOS)%%--F1  win.ini         Top L5    (Conf[WinIni]) -------------------
-UU-:----F1      spell.el        38% L47   (Emacs-Lisp ElDoc Wrap) -----

Components

The standard (default) components of a mode-line, from left to right, are as follows.

Input Method and Coding System

If an input method is active, it may be indicated first. Next comes the coding system of the buffer – one or more characters indicating how buffer characters are encoded.

Meaning
- No code conversion, except possibly end-of-line translation
= No code conversion or end-of-line translation
1 ISO Latin 1 code conversion
U Unicode (typically UTF-8)

The file buffer short-unicode shown above contains Unicode text [A]. The other two buffers have no translation (aside from end-of-line).

See International Character Set Support in the Emacs manual for details.

End Of Line

Next in the mode-line is an indication of how an EndOfLine is represented in the buffer. This is either a single character, or a word in parenthesis:

Char Word Meaning Used by
: (Unix) Line feed Unix, Linux, MacOS X
/ (MAC) Carriage return classic Macintosh (not MacOS X)
\ (DOS) Both Microsoft, DEC, RFCs

The win.ini file buffer shown above uses the DOS/Windows end-of-line format, indicated by (DOS) [G]. The others use the OS native format, indicated by : (colon).

Buffer Modification

The next two characters in the mode line indicate whether or not the buffer has been modified, can be edited but is unmodified since last saving, or is read-only.

Chars Meaning
** modified since last save
-- not modified since last save
%* read-only, but modified
%% read-only, not modified

File buffer spell.el shown above has been modified (**) [L]. File buffer win.ini is read-only (%%) [H].

Frame Name

For text-mode terminals, the frame name is shown next. This is omitted from the mode-line for graphical displays (the FrameTitle typically appears in a the window-manager window).

The first frame title is F1 for text displays..

Buffer Name

If the buffer is visiting a file then the buffer name is the (relative) file name.

Three buffers are shown above, all visiting files: short-unicode [B], win.ini [K], and spell.el [N].

Cursor Position

After the buffer name comes the current position of the TextCursor in the window (that is, point). The position is described first as the portion of the buffer that’s currently visible in the window:

Meaning
Top the beginning of the buffer is shown in the window
Bot the end of the buffer is shown in the window
All all of the buffer is shown in the window
xx% percent of the buffer above the top of the window (the portion before the visible text)

The entire buffer short-unicode shown above is visible [C]. The first line of buffer win.ini is visible [E]. Lastly, point is 38% [P] into buffer spell.el.

Next comes the line number, prefixed by L. Optionally, the column number appears as well, with prefix C.

The cursor is on line 47 [R] of buffer spell.el (above).

If the buffer is narrowed then the position is reported relative to the buffer restriction (the narrowing), not the entire buffer.

Modes

Last are the modes applied to the buffer, in parentheses. First is the MajorMode, followed by MinorModes.

Square brackets around the modes – like this: [(Emacs-Lisp)] – indicate that a RecursiveEdit is in progress.

You can click the major-mode and minor-mode names with ‘mouse-1’ to access their menus and some of their options.

Buffer short-unicode shown above is in Fundamental mode [D]. Buffer win.ini is in ‘conf-mode’, with the WinIni variant [F]. Buffer spell.el is in ‘emacs-lisp-mode’ [S], with minor modes ‘eldoc-mode’ [T] and ‘visual-line-mode’ (Wrap) [U].

Not all minor modes appear in the mode-line. This is mode-specific and is user-configurable.

See Also


CategoryDisplay CategoryGlossary CategoryWindows CategoryModeLine