emacs-diffs
[Top][All Lists]
Advanced

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

master 7466909df44 3/4: Improve docs for global-mode-string / %M constru


From: Phil Sainty
Subject: master 7466909df44 3/4: Improve docs for global-mode-string / %M construct
Date: Sun, 26 Mar 2023 07:33:33 -0400 (EDT)

branch: master
commit 7466909df44e4030534988035da0c87b8126f79e
Author: Phil Sainty <psainty@orcon.net.nz>
Commit: Phil Sainty <psainty@orcon.net.nz>

    Improve docs for global-mode-string / %M construct
    
    * src/xdisp.c (global-mode-string): Update docstring.
    * doc/lispref/modes.texi: Update manual.
---
 doc/lispref/modes.texi | 25 +++++++++++++++----------
 src/xdisp.c            |  2 +-
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index fff1ea65b07..30baa7f4d80 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2349,18 +2349,19 @@ enabled separately in each buffer.
 
 @defvar global-mode-string
 This variable holds a mode line construct that, by default, appears in
-the mode line just after the @code{which-function-mode} minor mode if
-set, else after @code{mode-line-modes}.  Elements that are added to
-this construct should normally end in a space (to ensure that
-consecutive @code{global-mode-string} elements display properly).  For
-instance, the command @code{display-time} sets
-@code{global-mode-string} to refer to the variable
-@code{display-time-string}, which holds a string containing the time
-and load information.
+the mode line as part of @code{mode-line-misc-info}, just after the
+@code{which-function-mode} information if that minor mode is enabled,
+else after @code{mode-line-modes}.  Elements that are added to this
+construct should normally end in a space (to ensure that consecutive
+@code{global-mode-string} elements display properly).  For instance,
+the command @code{display-time} sets @code{global-mode-string} to
+refer to the variable @code{display-time-string}, which holds a string
+containing the time and load information.
 
 The @samp{%M} construct substitutes the value of
-@code{global-mode-string}, but that is obsolete, since the variable is
-included in the mode line from @code{mode-line-format}.
+@code{global-mode-string}.  This construct is not used by the default
+mode line, as the variable itself is used in
+@code{mode-line-misc-info}.
 @end defvar
 
 Here is a simplified version of the default value of
@@ -2440,6 +2441,10 @@ abbreviate.
 The current line number of point, counting within the accessible portion
 of the buffer.
 
+@item %M
+The value of @code{global-mode-string} (which is part of
+@code{mode-line-misc-info} by default).
+
 @item %n
 @samp{Narrow} when narrowing is in effect; nothing otherwise (see
 @code{narrow-to-region} in @ref{Narrowing}).
diff --git a/src/xdisp.c b/src/xdisp.c
index 7a4f683c973..754a7c16c76 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -36517,7 +36517,7 @@ This is used for internal purposes.  */);
   Vinhibit_redisplay = Qnil;
 
   DEFVAR_LISP ("global-mode-string", Vglobal_mode_string,
-    doc: /* String (or mode line construct) included (normally) in 
`mode-line-format'.  */);
+    doc: /* String (or mode line construct) included (normally) in 
`mode-line-misc-info'.  */);
   Vglobal_mode_string = Qnil;
 
   DEFVAR_LISP ("overlay-arrow-position", Voverlay_arrow_position,



reply via email to

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