comparison doc/lispref/modes.texi @ 98729:a0397c75f952

(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.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 15 Oct 2008 11:25:22 +0000
parents 8eba27dae69a
children 7d1d2a142ab5
comparison
equal deleted inserted replaced
98728:a962df9a86fb 98729:a0397c75f952
315 major mode command symbol. This is how @code{describe-mode} discovers 315 major mode command symbol. This is how @code{describe-mode} discovers
316 which documentation to print. 316 which documentation to print.
317 317
318 @item 318 @item
319 The major mode command should set the variable @code{mode-name} to the 319 The major mode command should set the variable @code{mode-name} to the
320 ``pretty'' name of the mode, as a string. This string appears in the 320 ``pretty'' name of the mode, usually a string (but see @ref{Mode Line
321 mode line. 321 Data}, for other possible forms). The name of the mode appears
322 in the mode line.
322 323
323 @item 324 @item
324 @cindex functions in modes 325 @cindex functions in modes
325 Since all global names are in the same name space, all the global 326 Since all global names are in the same name space, all the global
326 variables, constants, and functions that are part of the mode should 327 variables, constants, and functions that are part of the mode should
1863 1864
1864 The following three variables are used in @code{mode-line-modes}: 1865 The following three variables are used in @code{mode-line-modes}:
1865 1866
1866 @defvar mode-name 1867 @defvar mode-name
1867 This buffer-local variable holds the ``pretty'' name of the current 1868 This buffer-local variable holds the ``pretty'' name of the current
1868 buffer's major mode. Each major mode should set this variable so that the 1869 buffer's major mode. Each major mode should set this variable so that
1869 mode name will appear in the mode line. 1870 the mode name will appear in the mode line. The value does not have
1871 to be a string, but can use any of the data types valid in a mode-line
1872 construct (@pxref{Mode Line Data}). To compute the string that will
1873 identify the mode name in the mode line, use @code{format-mode-line}
1874 (@pxref{Emulating Mode Line}).
1870 @end defvar 1875 @end defvar
1871 1876
1872 @defvar mode-line-process 1877 @defvar mode-line-process
1873 This buffer-local variable contains the mode-line information on process 1878 This buffer-local variable contains the mode-line information on process
1874 status in modes used for communicating with subprocesses. It is 1879 status in modes used for communicating with subprocesses. It is