From 6d35c807e5ff5d00f734f88562e687a857515513 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Sep 2025 12:22:42 +0300 Subject: [PATCH] ; Improve documentation of globalized minor modes * doc/lispref/modes.texi (Defining Minor Modes): Document the subtlety with ':init-value t' for globalized modes. --- doc/lispref/modes.texi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 421ec136c7c..c5c6c10a6fa 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -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