aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2007-02-03 17:11:39 +0000
committerChong Yidong2007-02-03 17:11:39 +0000
commit1608076d4346ac9871021f8c961408fff7bc8f7d (patch)
tree2c9bd31883acdc7f4a5b1f064c077b5d7ed15ba2
parent632a4cc7099773926727cce256c61754fd023c98 (diff)
downloademacs-1608076d4346ac9871021f8c961408fff7bc8f7d.tar.gz
emacs-1608076d4346ac9871021f8c961408fff7bc8f7d.zip
(Defining Minor Modes): Document that a :require keyword or similar
may be required to make saved customization variables work.
-rw-r--r--lispref/modes.texi23
1 files changed, 19 insertions, 4 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 1d96568fc1d..3de0925283b 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -1387,9 +1387,18 @@ written a @code{defgroup} to define that group properly. @xref{Group
1387Definitions}. 1387Definitions}.
1388 1388
1389@item :global @var{global} 1389@item :global @var{global}
1390If non-@code{nil} specifies that the minor mode should be global. By 1390If non-@code{nil}, this specifies that the minor mode should be global
1391default, minor modes defined with @code{define-minor-mode} are 1391rather than buffer-local. It defaults to @code{nil}.
1392buffer-local. 1392
1393One of the effects of making a minor mode global is that the
1394@var{mode} variable becomes a customization variable; toggling it
1395through the Custom interface to turn the mode on and off, and its
1396value can be saved for future Emacs sessions (@pxref{Saving
1397Customizations,,, emacs, The GNU Emacs Manual}. For the saved
1398variable to work, you should ensure that the @code{define-minor-mode}
1399form is evaluated each time Emacs starts; for packages that are not
1400part of Emacs, the easiest way to do this is to specify a
1401@code{:require} keyword.
1393 1402
1394@item :init-value @var{init-value} 1403@item :init-value @var{init-value}
1395This is equivalent to specifying @var{init-value} positionally. 1404This is equivalent to specifying @var{init-value} positionally.
@@ -1479,7 +1488,7 @@ See the command \\[hungry-electric-delete]."
1479 :group 'hunger) 1488 :group 'hunger)
1480@end smallexample 1489@end smallexample
1481 1490
1482@defmac define-global-minor-mode global-mode mode turn-on keyword-args@dots{} 1491@defmac define-globalized-minor-mode global-mode mode turn-on keyword-args@dots{}
1483This defines a global toggle named @var{global-mode} whose meaning is 1492This defines a global toggle named @var{global-mode} whose meaning is
1484to enable or disable the buffer-local minor mode @var{mode} in all 1493to enable or disable the buffer-local minor mode @var{mode} in all
1485buffers. To turn on the minor mode in a buffer, it uses the function 1494buffers. To turn on the minor mode in a buffer, it uses the function
@@ -1491,6 +1500,12 @@ by visiting files, and buffers that use a major mode other than
1491Fundamental mode; but it does not detect the creation of a new buffer 1500Fundamental mode; but it does not detect the creation of a new buffer
1492in Fundamental mode. 1501in Fundamental mode.
1493 1502
1503This defines the customization option @var{global-mode} (@pxref{Customization}),
1504which can be toggled in the Custom interface to turn the minor mode on
1505and off. As with @code{define-minor-mode}, you should ensure that the
1506@code{define-globalized-minor-mode} form is evaluated each time Emacs
1507starts, for example by providing a @code{:require} keyword.
1508
1494Use @code{:group @var{group}} in @var{keyword-args} to specify the 1509Use @code{:group @var{group}} in @var{keyword-args} to specify the
1495custom group for the mode variable of the global minor mode. 1510custom group for the mode variable of the global minor mode.
1496@end defmac 1511@end defmac