aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sainty2022-08-14 23:17:38 +1200
committerPhil Sainty2023-03-18 19:30:50 +1300
commite1ad7b86e148dd31133e6d3b7927b985a23e1979 (patch)
tree4e19f2720cd3d0c566c69b5c97ca1f26a8fbf794
parentb2225d849c58ec68bf1dba325aad25505a053455 (diff)
downloademacs-fix/bug-57080-mode-line-format-docs.tar.gz
emacs-fix/bug-57080-mode-line-format-docs.zip
* src/buffer.c (mode-line-format): Reorder and reformat %-construct docsfix/bug-57080-mode-line-format-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. * 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 3da716a3b8a..c3abba368aa 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
@@ -2486,6 +2487,9 @@ The mnemonics of keyboard, terminal, and buffer coding systems.
2486@item %Z 2487@item %Z
2487Like @samp{%z}, but including the end-of-line format. 2488Like @samp{%z}, but including the end-of-line format.
2488 2489
2490@item %&
2491@samp{*} if the buffer is modified, and @samp{-} otherwise.
2492
2489@item %* 2493@item %*
2490@samp{%} if the buffer is read only (see @code{buffer-read-only}); @* 2494@samp{%} if the buffer is read only (see @code{buffer-read-only}); @*
2491@samp{*} if the buffer is modified (see @code{buffer-modified-p}); @* 2495@samp{*} if the buffer is modified (see @code{buffer-modified-p}); @*
@@ -2497,9 +2501,6 @@ Like @samp{%z}, but including the end-of-line format.
2497@samp{-} otherwise. This differs from @samp{%*} only for a modified 2501@samp{-} otherwise. This differs from @samp{%*} only for a modified
2498read-only buffer. @xref{Buffer Modification}. 2502read-only buffer. @xref{Buffer Modification}.
2499 2503
2500@item %&
2501@samp{*} if the buffer is modified, and @samp{-} otherwise.
2502
2503@item %@@ 2504@item %@@
2504@samp{@@} if the buffer's @code{default-directory} (@pxref{File Name 2505@samp{@@} if the buffer's @code{default-directory} (@pxref{File Name
2505Expansion}) is on a remote machine, and @samp{-} otherwise. 2506Expansion}) 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),