From 9cf52b11bbeec82a0ede9fb89fce1033b275e467 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 15 Oct 2008 11:27:32 +0000 Subject: [PATCH] (Major Mode Conventions, Mode Line Variables): `mode-name' need not be a string. xref to "Mode Line Data" for details, and to "Emulating Mode Line" for computing a string value. --- doc/lispref/ChangeLog | 7 +++++++ doc/lispref/modes.texi | 13 +++++++++---- etc/NEWS | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index b481377cc2d..d00f0cb06a8 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,10 @@ +2008-10-15 Eli Zaretskii + + * modes.texi (Major Mode Conventions, Mode Line Variables): + `mode-name' need not be a string. xref to "Mode Line Data" for + details, and to "Emulating Mode Line" for computing a string + value. + 2008-10-14 Eli Zaretskii * processes.texi (System Processes): New section. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 3004ca3a934..3227aa3bdc3 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -317,8 +317,9 @@ which documentation to print. @item The major mode command should set the variable @code{mode-name} to the -``pretty'' name of the mode, as a string. This string appears in the -mode line. +``pretty'' name of the mode, usually a string (but see @ref{Mode Line +Data}, for other possible forms). The name of the mode appears +in the mode line. @item @cindex functions in modes @@ -1865,8 +1866,12 @@ effect. @defvar mode-name This buffer-local variable holds the ``pretty'' name of the current -buffer's major mode. Each major mode should set this variable so that the -mode name will appear in the mode line. +buffer's major mode. Each major mode should set this variable so that +the mode name will appear in the mode line. The value does not have +to be a string, but can use any of the data types valid in a mode-line +construct (@pxref{Mode Line Data}). To compute the string that will +identify the mode name in the mode line, use @code{format-mode-line} +(@pxref{Emulating Mode Line}). @end defvar @defvar mode-line-process diff --git a/etc/NEWS b/etc/NEWS index 0dde6961b9c..20ea28eaf20 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1068,6 +1068,7 @@ checking/manipulating elements directly, use the new functions `byte-compile-warning-enabled-p', `byte-compile-disable-warning', and `byte-compile-enable-warning.' ++++ ** `mode-name' is no longer guaranteed to be a string. Use `(format-mode-line mode-name)' to ensure a string value. -- 2.39.5