GNU bug report logs -
#57080
28.1; The %m modeline construct does not work for emacs-lisp-mode
Previous Next
Reported by: diredwolf <diredwolf1 <at> gmail.com>
Date: Tue, 9 Aug 2022 16:18:01 UTC
Severity: normal
Found in version 28.1
Done: Phil Sainty <psainty <at> orcon.net.nz>
Bug is archived. No further changes may be made.
Full log
Message #31 received at 57080 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Does anyone object to me merging branch
fix/bug-57080-mode-line-format-docs
( https://lists.gnu.org/archive/html/emacs-diffs/2023-03/msg00453.html )
to the emacs-29 branch?
It addresses the issue from this bug along with several related things
that I found in the process of looking at that.
* The %m documentation was not entirely accurate (as discussed here).
* The %M documentation was also not up to date.
* The %t construct was obsolete but still documented.
* The %o and %q constructs were lacking documentation.
* The `mode-line-format' docstring for all of the constructs was
not as easy to read as it could have been.
I'm attaching the patch series. The individual commit messages have
more details.
The final reformatting of the `mode-line-format' docstring sorts the
constructs by letter (which makes everything easier to find); eliminates
multiple constructs being crammed into single lines (which also makes
everything easier to find); and rephrases some things for (IMHO) easier
readability and comprehension.
This is the 'before' state:
%b -- print buffer name. %f -- print visited file name.
%F -- print frame name.
%* -- print %, * or hyphen. %+ -- print *, % or hyphen.
%& is like %*, but ignore read-only-ness.
% means buffer is read-only and * means it is modified.
For a modified read-only buffer, %* gives % and %+ gives *.
%s -- print process status. %l -- print the current line number.
%c -- print the current column number (this makes editing slower).
Columns are numbered starting from the left margin, and the
leftmost column is displayed as zero.
To make the column number update correctly in all cases,
`column-number-mode' must be non-nil.
%C -- Like %c, but the leftmost column is displayed as one.
%i -- print the size of the buffer.
%I -- like %i, but use k, M, G, etc., to abbreviate.
%o -- print percent of window travel through buffer, or Top, Bot or
All.
%p -- print percent of buffer above top of window, or Top, Bot or All.
%P -- print percent of buffer above bottom of window, perhaps plus
Top,
or print Bottom or All.
%q -- print percent of buffer above both the top and the bottom of the
window, separated by ‘-’, or ‘All’.
%n -- print Narrow if appropriate.
%z -- print mnemonics of keyboard, terminal, and buffer coding
systems.
%Z -- like %z, but including the end-of-line format.
%e -- print error message about full memory.
%@ -- print @ or hyphen. @ means that default-directory is on a
remote machine.
%[ -- print one [ for each recursive editing level. %] similar.
%% -- print %. %- -- print infinitely many dashes.
And this is the 'after' state (which is only 3 lines longer):
%b -- print buffer name.
%c -- print the current column number (this makes editing slower).
Columns are numbered starting from the left margin, and the
leftmost column is displayed as zero.
To make the column number update correctly in all cases,
`column-number-mode' must be non-nil.
%C -- Like %c, but the leftmost column is displayed as one.
%e -- print error message about full memory.
%f -- print visited file name.
%F -- print frame name.
%i -- print the size of the buffer.
%I -- like %i, but use k, M, G, etc., to abbreviate.
%l -- print the current line number.
%n -- print Narrow if appropriate.
%o -- print percent of window travel through buffer, or Top, Bot or
All.
%p -- print percent of buffer above top of window, or Top, Bot or All.
%P -- print percent of buffer above bottom of window, perhaps plus
Top,
or print Bottom or All.
%q -- print percent of buffer above both the top and the bottom of the
window, separated by ‘-’, or ‘All’.
%s -- print process status.
%z -- print mnemonics of keyboard, terminal, and buffer coding
systems.
%Z -- like %z, but including the end-of-line format.
%& -- print * if the buffer is modified, otherwise hyphen.
%+ -- print *, % or hyphen (modified, read-only, neither).
%* -- print %, * or hyphen (read-only, modified, neither).
For a modified read-only buffer, %+ prints * and %* prints %.
%@ -- print @ if default-directory is on a remote machine, else
hyphen.
%[ -- print one [ for each recursive editing level.
%] -- print one ] for each recursive editing level.
%- -- print enough dashes to fill the mode line.
%% -- print %.
I untabified the indentation, as that didn't render correctly with a
tab-width of anything other than 8, which might be a problem for other
docstrings as well. Should help-mode set tab-width to 8 ??
-Phil
[0001-src-buffer.c-mode-line-format-Remove-docs-for-obsole.patch (text/x-diff, attachment)]
[0002-src-buffer.c-mode-line-format-Document-o-and-q-const.patch (text/x-diff, attachment)]
[0003-Improve-docs-for-global-mode-string-M-construct.patch (text/x-diff, attachment)]
[0004-doc-lispref-modes.texi-Improve-docs-for-obsolete-m-c.patch (text/x-diff, attachment)]
[0005-src-buffer.c-mode-line-format-Reorder-and-reformat-c.patch (text/x-diff, attachment)]
This bug report was last modified 2 years and 149 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.