bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57080: 29.0.60; [PATCH] Updates to mode line construct documentation


From: Phil Sainty
Subject: bug#57080: 29.0.60; [PATCH] Updates to mode line construct documentation (was: The %m modeline construct does not work for emacs-lisp-mode)
Date: Sat, 18 Mar 2023 20:30:58 +1300
User-agent: Orcon Webmail

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

Attachment: 0001-src-buffer.c-mode-line-format-Remove-docs-for-obsole.patch
Description: Text Data

Attachment: 0002-src-buffer.c-mode-line-format-Document-o-and-q-const.patch
Description: Text Data

Attachment: 0003-Improve-docs-for-global-mode-string-M-construct.patch
Description: Text Data

Attachment: 0004-doc-lispref-modes.texi-Improve-docs-for-obsolete-m-c.patch
Description: Text Data

Attachment: 0005-src-buffer.c-mode-line-format-Reorder-and-reformat-c.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]