aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-05-14 13:59:41 +0000
committerRichard M. Stallman2005-05-14 13:59:41 +0000
commitcbb8b77d19659d71935728011e2ac39411f229dd (patch)
tree48f157483a610b4b06919b6222bb2cba65589274
parenta61d42f160ba901bc39d42ca056752f83d6779b6 (diff)
downloademacs-cbb8b77d19659d71935728011e2ac39411f229dd.tar.gz
emacs-cbb8b77d19659d71935728011e2ac39411f229dd.zip
(Defining Minor Modes): Define define-global-minor-mode.
-rw-r--r--lispref/modes.texi16
1 files changed, 14 insertions, 2 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 4e6085566c4..c3247b4ca57 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -1184,8 +1184,9 @@ written a @code{defgroup} to define that group properly. @xref{Group
1184Definitions}. 1184Definitions}.
1185 1185
1186@item :global @var{global} 1186@item :global @var{global}
1187If non-@code{nil} specifies that the minor mode should be global. 1187If non-@code{nil} specifies that the minor mode should be global. By
1188By default, minor modes are buffer-local. 1188default, minor modes defined with @code{define-minor-mode} are
1189buffer-local.
1189 1190
1190@item :init-value @var{init-value} 1191@item :init-value @var{init-value}
1191This is equivalent to specifying @var{init-value} positionally. 1192This is equivalent to specifying @var{init-value} positionally.
@@ -1266,6 +1267,17 @@ See the command \\[hungry-electric-delete]."
1266 :group 'hunger) 1267 :group 'hunger)
1267@end smallexample 1268@end smallexample
1268 1269
1270@defmac define-global-minor-mode global-mode mode turn-on keyword-args...
1271This defines a global minor mode named @var{global-mode} whose meaning
1272is to enable the buffer-local minor mode @var{mode} in every buffer.
1273To turn on the minor mode in a buffer, it uses the function
1274@var{turn-on}; to turn off the minor mode, it calls @code{mode} with
1275@minus{}1 as argument.
1276
1277Use @code{:group @var{group}} in @var{keyword-args} to specify the
1278custom group for the mode variable of the global minor mode.
1279@end defmac
1280
1269@node Mode Line Format 1281@node Mode Line Format
1270@section Mode-Line Format 1282@section Mode-Line Format
1271@cindex mode line 1283@cindex mode line