; Improve documentation of globalized minor modes
* doc/lispref/modes.texi (Defining Minor Modes): Document the subtlety with ':init-value t' for globalized modes.
This commit is contained in:
@@ -1861,7 +1861,17 @@ marking the @code{define-minor-mode} form as autoloaded.
|
||||
@item :init-value @var{init-value}
|
||||
This is the value to which the @var{mode} variable is initialized.
|
||||
Except in unusual circumstances (see below), this value must be
|
||||
@code{nil}.
|
||||
@code{nil}. If the mode is global (see below), and the initial value is
|
||||
@code{t}, i.e., the mode is turned on by default, you should consider
|
||||
forcing Emacs to run the mode function at startup, like this:
|
||||
|
||||
@lisp
|
||||
:initialize #'custom-initialize-delay
|
||||
@end lisp
|
||||
|
||||
@noindent
|
||||
otherwise, the minor mode might not appear in the @file{*Help*} buffer
|
||||
generated by @kbd{C-h m} (@pxref{Mode Help}).
|
||||
|
||||
@item :lighter @var{lighter}
|
||||
The string @var{lighter} says what to display in the mode line
|
||||
|
||||
Reference in New Issue
Block a user