Emacs: Mode Line
What is Mode Line
mode line is a line at the bottom of a window pane that shows info about the current buffer, such as • buffer name (file name) • current Major Mode • File Encoding
The mode line show some info about the current buffer.
Mode Line Display Meaning
- You can hover mouse over the mode line part to show tooltips on what it means.
- You can mouse click the mode line part to do something useful, typically cycle alternative states.
- File Encoding and Newline Convention
-
The first character indicates encoding.
U
means Unicode. Alt+xlist-coding-systems
to see a full list and explanation.Sample:
U(Unix)
→ Unicode encoding with unix newlineU(Dos)
→ Unicode encoding with Microsoft Windows newlineU\
→ Unicode encoding with Microsoft Windows newline when on Windows.U(Mac)
→ Unicode encoding with Classic Mac OS newline (1990s)
- Modified Status
-
This is 3 characters.
Sample:
---
→ file not changed**-
→ file is modified%%-
→ read only%*-
→ read only and modified
If the last character is
@
, the file is on a remote machine. - Buffer Name
-
If the buffer is a file, it usually is the file name
Clicking on it switches buffer.
- Position
-
Sample:
ALL
→ all content are shown.Top
→ cursor is at the top of buffernn%
→ cursor is at nn percent of bufferBot
→ cursor is at the bottom of buffer
L27
→ at line 27
If you have
column-number-mode
on:(27,4)
→ at line 27, column 4
- (major minor)
-
shows the current Major Mode and few Minor Mode and or possibly some other info.
Sample:
- in recursive edit
-
if the
(major minor)
part is bracketed by square brackets, e.g.[(major minor)]
It means you are in recursive edit.
Recursive Edit means you are calling a command before another command has finished. This often happens when you are coding elisp and there are errors and debugger is entered. Recursive Edit can be nested many times. Each level of recursive edit adds a square bracket.
To exit Recursive Edit:
- 【Ctrl+Meta+Ctrl 】
exit-recursive-edit
→ exit the current level. - 【Ctrl+]】
abort-recursive-edit
→ exit all.
- 【Ctrl+Meta+Ctrl 】