diff options
| author | Richard M. Stallman | 2005-08-09 12:09:14 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-08-09 12:09:14 +0000 |
| commit | 32808f83562a90037e5ae45e21159cb4b53a7f95 (patch) | |
| tree | 24008e4482ee93cd72e8b39e22cb88894f4e2421 | |
| parent | 0fb9f9aed49a6b8ab60d716acbf6014508c4c5df (diff) | |
| download | emacs-32808f83562a90037e5ae45e21159cb4b53a7f95.tar.gz emacs-32808f83562a90037e5ae45e21159cb4b53a7f95.zip | |
(Defining Minor Modes): Explain when init-value can be non-nil.
| -rw-r--r-- | lispref/modes.texi | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi index 053e7a511e8..098a2d57068 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi | |||
| @@ -1373,7 +1373,8 @@ symbol). It defines a command named @var{mode} to toggle the minor | |||
| 1373 | mode, with @var{doc} as its documentation string. It also defines a | 1373 | mode, with @var{doc} as its documentation string. It also defines a |
| 1374 | variable named @var{mode}, which is set to @code{t} or @code{nil} by | 1374 | variable named @var{mode}, which is set to @code{t} or @code{nil} by |
| 1375 | enabling or disabling the mode. The variable is initialized to | 1375 | enabling or disabling the mode. The variable is initialized to |
| 1376 | @var{init-value}. | 1376 | @var{init-value}. Except in unusual circumstances (see below), this |
| 1377 | value must be @code{nil}. | ||
| 1377 | 1378 | ||
| 1378 | The string @var{lighter} says what to display in the mode line | 1379 | The string @var{lighter} says what to display in the mode line |
| 1379 | when the mode is enabled; if it is @code{nil}, the mode is not displayed | 1380 | when the mode is enabled; if it is @code{nil}, the mode is not displayed |
| @@ -1424,6 +1425,14 @@ as setting the variable named @var{mode} and then executes the | |||
| 1424 | variable @code{@var{mode}-hook}. | 1425 | variable @code{@var{mode}-hook}. |
| 1425 | @end defmac | 1426 | @end defmac |
| 1426 | 1427 | ||
| 1428 | The initial value must be @code{nil} except in cases where (1) the | ||
| 1429 | mode is preloaded in Emacs, or (2) it is painless to for loading to | ||
| 1430 | enable the mode even though the user did not request it. For | ||
| 1431 | instance, if the mode has no effect unless something else is enabled, | ||
| 1432 | and will always be loaded by that time, enabling it by default is | ||
| 1433 | harmless. But these are unusual circumstances. Normally, the | ||
| 1434 | initial value must be @code{nil}. | ||
| 1435 | |||
| 1427 | @findex easy-mmode-define-minor-mode | 1436 | @findex easy-mmode-define-minor-mode |
| 1428 | The name @code{easy-mmode-define-minor-mode} is an alias | 1437 | The name @code{easy-mmode-define-minor-mode} is an alias |
| 1429 | for this macro. | 1438 | for this macro. |