aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sainty2022-08-14 23:14:51 +1200
committerPhil Sainty2023-03-27 00:33:01 +1300
commit7466909df44e4030534988035da0c87b8126f79e (patch)
treec05b1a6f292058587533feaeedb4f292a6527388
parent73f186b0c9345ca386bce7f441589c3530685fae (diff)
downloademacs-7466909df44e4030534988035da0c87b8126f79e.tar.gz
emacs-7466909df44e4030534988035da0c87b8126f79e.zip
Improve docs for global-mode-string / %M construct
* src/xdisp.c (global-mode-string): Update docstring. * doc/lispref/modes.texi: Update manual.
-rw-r--r--doc/lispref/modes.texi25
-rw-r--r--src/xdisp.c2
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.
2349 2349
2350@defvar global-mode-string 2350@defvar global-mode-string
2351This variable holds a mode line construct that, by default, appears in 2351This variable holds a mode line construct that, by default, appears in
2352the mode line just after the @code{which-function-mode} minor mode if 2352the mode line as part of @code{mode-line-misc-info}, just after the
2353set, else after @code{mode-line-modes}. Elements that are added to 2353@code{which-function-mode} information if that minor mode is enabled,
2354this construct should normally end in a space (to ensure that 2354else after @code{mode-line-modes}. Elements that are added to this
2355consecutive @code{global-mode-string} elements display properly). For 2355construct should normally end in a space (to ensure that consecutive
2356instance, the command @code{display-time} sets 2356@code{global-mode-string} elements display properly). For instance,
2357@code{global-mode-string} to refer to the variable 2357the command @code{display-time} sets @code{global-mode-string} to
2358@code{display-time-string}, which holds a string containing the time 2358refer to the variable @code{display-time-string}, which holds a string
2359and load information. 2359containing the time and load information.
2360 2360
2361The @samp{%M} construct substitutes the value of 2361The @samp{%M} construct substitutes the value of
2362@code{global-mode-string}, but that is obsolete, since the variable is 2362@code{global-mode-string}. This construct is not used by the default
2363included in the mode line from @code{mode-line-format}. 2363mode line, as the variable itself is used in
2364@code{mode-line-misc-info}.
2364@end defvar 2365@end defvar
2365 2366
2366Here is a simplified version of the default value of 2367Here is a simplified version of the default value of
@@ -2440,6 +2441,10 @@ abbreviate.
2440The current line number of point, counting within the accessible portion 2441The current line number of point, counting within the accessible portion
2441of the buffer. 2442of the buffer.
2442 2443
2444@item %M
2445The value of @code{global-mode-string} (which is part of
2446@code{mode-line-misc-info} by default).
2447
2443@item %n 2448@item %n
2444@samp{Narrow} when narrowing is in effect; nothing otherwise (see 2449@samp{Narrow} when narrowing is in effect; nothing otherwise (see
2445@code{narrow-to-region} in @ref{Narrowing}). 2450@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. */);
36517 Vinhibit_redisplay = Qnil; 36517 Vinhibit_redisplay = Qnil;
36518 36518
36519 DEFVAR_LISP ("global-mode-string", Vglobal_mode_string, 36519 DEFVAR_LISP ("global-mode-string", Vglobal_mode_string,
36520 doc: /* String (or mode line construct) included (normally) in `mode-line-format'. */); 36520 doc: /* String (or mode line construct) included (normally) in `mode-line-misc-info'. */);
36521 Vglobal_mode_string = Qnil; 36521 Vglobal_mode_string = Qnil;
36522 36522
36523 DEFVAR_LISP ("overlay-arrow-position", Voverlay_arrow_position, 36523 DEFVAR_LISP ("overlay-arrow-position", Voverlay_arrow_position,