aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sainty2022-08-14 23:17:38 +1200
committerPhil Sainty2023-03-27 00:36:47 +1300
commit28db56d5f04879675aabb3fb2195ef2dd27716ba (patch)
tree7e0fe2d7159d02f6d4ae30061036a9ed4a6b9fa8
parentd4a3f64ad75444fa26f707aec5b642a900507a41 (diff)
downloademacs-28db56d5f04879675aabb3fb2195ef2dd27716ba.tar.gz
emacs-28db56d5f04879675aabb3fb2195ef2dd27716ba.zip
* src/buffer.c (mode-line-format): Reorder and reformat %-construct docs
The original formatting dates back to the earliest commits. It saved a few lines but was harder to follow. As windows are typically taller now than the terminals of the time, this reformatting now makes better sense for readabiity. See bug#57080. * doc/lispref/modes.texi: Order change for consistency. Add index.
-rw-r--r--doc/lispref/modes.texi7
-rw-r--r--src/buffer.c31
2 files changed, 21 insertions, 17 deletions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 42e02b20fa3..18d5da5c7d1 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2390,6 +2390,7 @@ specifies addition of text properties.
2390 2390
2391@node %-Constructs 2391@node %-Constructs
2392@subsection @code{%}-Constructs in the Mode Line 2392@subsection @code{%}-Constructs in the Mode Line
2393@cindex @code{%}-constructs in the mode line
2393 2394
2394 Strings used as mode line constructs can use certain 2395 Strings used as mode line constructs can use certain
2395@code{%}-constructs to substitute various kinds of data. The 2396@code{%}-constructs to substitute various kinds of data. The
@@ -2480,6 +2481,9 @@ The mnemonics of keyboard, terminal, and buffer coding systems.
2480@item %Z 2481@item %Z
2481Like @samp{%z}, but including the end-of-line format. 2482Like @samp{%z}, but including the end-of-line format.
2482 2483
2484@item %&
2485@samp{*} if the buffer is modified, and @samp{-} otherwise.
2486
2483@item %* 2487@item %*
2484@samp{%} if the buffer is read only (see @code{buffer-read-only}); @* 2488@samp{%} if the buffer is read only (see @code{buffer-read-only}); @*
2485@samp{*} if the buffer is modified (see @code{buffer-modified-p}); @* 2489@samp{*} if the buffer is modified (see @code{buffer-modified-p}); @*
@@ -2491,9 +2495,6 @@ Like @samp{%z}, but including the end-of-line format.
2491@samp{-} otherwise. This differs from @samp{%*} only for a modified 2495@samp{-} otherwise. This differs from @samp{%*} only for a modified
2492read-only buffer. @xref{Buffer Modification}. 2496read-only buffer. @xref{Buffer Modification}.
2493 2497
2494@item %&
2495@samp{*} if the buffer is modified, and @samp{-} otherwise.
2496
2497@item %@@ 2498@item %@@
2498@samp{@@} if the buffer's @code{default-directory} (@pxref{File Name 2499@samp{@@} if the buffer's @code{default-directory} (@pxref{File Name
2499Expansion}) is on a remote machine, and @samp{-} otherwise. 2500Expansion}) is on a remote machine, and @samp{-} otherwise.
diff --git a/src/buffer.c b/src/buffer.c
index 0c740775e5b..31c08cf3650 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5124,35 +5124,38 @@ A list whose car is an integer is processed by processing the cadr of
5124 negative) to the width specified by that number. 5124 negative) to the width specified by that number.
5125 5125
5126A string is printed verbatim in the mode line except for %-constructs: 5126A string is printed verbatim in the mode line except for %-constructs:
5127 %b -- print buffer name. %f -- print visited file name. 5127 %b -- print buffer name.
5128 %F -- print frame name.
5129 %* -- print %, * or hyphen. %+ -- print *, % or hyphen.
5130 %& is like %*, but ignore read-only-ness.
5131 % means buffer is read-only and * means it is modified.
5132 For a modified read-only buffer, %* gives % and %+ gives *.
5133 %s -- print process status. %l -- print the current line number.
5134 %c -- print the current column number (this makes editing slower). 5128 %c -- print the current column number (this makes editing slower).
5135 Columns are numbered starting from the left margin, and the 5129 Columns are numbered starting from the left margin, and the
5136 leftmost column is displayed as zero. 5130 leftmost column is displayed as zero.
5137 To make the column number update correctly in all cases, 5131 To make the column number update correctly in all cases,
5138 `column-number-mode' must be non-nil. 5132 `column-number-mode' must be non-nil.
5139 %C -- Like %c, but the leftmost column is displayed as one. 5133 %C -- Like %c, but the leftmost column is displayed as one.
5134 %e -- print error message about full memory.
5135 %f -- print visited file name.
5136 %F -- print frame name.
5140 %i -- print the size of the buffer. 5137 %i -- print the size of the buffer.
5141 %I -- like %i, but use k, M, G, etc., to abbreviate. 5138 %I -- like %i, but use k, M, G, etc., to abbreviate.
5139 %l -- print the current line number.
5140 %n -- print Narrow if appropriate.
5142 %o -- print percent of window travel through buffer, or Top, Bot or All. 5141 %o -- print percent of window travel through buffer, or Top, Bot or All.
5143 %p -- print percent of buffer above top of window, or Top, Bot or All. 5142 %p -- print percent of buffer above top of window, or Top, Bot or All.
5144 %P -- print percent of buffer above bottom of window, perhaps plus Top, 5143 %P -- print percent of buffer above bottom of window, perhaps plus Top,
5145 or print Bottom or All. 5144 or print Bottom or All.
5146 %q -- print percent of buffer above both the top and the bottom of the 5145 %q -- print percent of buffer above both the top and the bottom of the
5147 window, separated by ‘-’, or ‘All’. 5146 window, separated by ‘-’, or ‘All’.
5148 %n -- print Narrow if appropriate. 5147 %s -- print process status.
5149 %z -- print mnemonics of keyboard, terminal, and buffer coding systems. 5148 %z -- print mnemonics of keyboard, terminal, and buffer coding systems.
5150 %Z -- like %z, but including the end-of-line format. 5149 %Z -- like %z, but including the end-of-line format.
5151 %e -- print error message about full memory. 5150 %& -- print * if the buffer is modified, otherwise hyphen.
5152 %@ -- print @ or hyphen. @ means that default-directory is on a 5151 %+ -- print *, % or hyphen (modified, read-only, neither).
5153 remote machine. 5152 %* -- print %, * or hyphen (read-only, modified, neither).
5154 %[ -- print one [ for each recursive editing level. %] similar. 5153 For a modified read-only buffer, %+ prints * and %* prints %.
5155 %% -- print %. %- -- print infinitely many dashes. 5154 %@ -- print @ if default-directory is on a remote machine, else hyphen.
5155 %[ -- print one [ for each recursive editing level.
5156 %] -- print one ] for each recursive editing level.
5157 %- -- print enough dashes to fill the mode line.
5158 %% -- print %.
5156Decimal digits after the % specify field width to which to pad. */); 5159Decimal digits after the % specify field width to which to pad. */);
5157 5160
5158 DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode), 5161 DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode),