From: Richard M. Stallman Date: Sat, 14 May 2005 13:59:41 +0000 (+0000) Subject: (Defining Minor Modes): Define define-global-minor-mode. X-Git-Tag: ttn-vms-21-2-B4~311 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cbb8b77d19659d71935728011e2ac39411f229dd;p=emacs.git (Defining Minor Modes): Define define-global-minor-mode. --- 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 Definitions}. @item :global @var{global} -If non-@code{nil} specifies that the minor mode should be global. -By default, minor modes are buffer-local. +If non-@code{nil} specifies that the minor mode should be global. By +default, minor modes defined with @code{define-minor-mode} are +buffer-local. @item :init-value @var{init-value} This is equivalent to specifying @var{init-value} positionally. @@ -1266,6 +1267,17 @@ See the command \\[hungry-electric-delete]." :group 'hunger) @end smallexample +@defmac define-global-minor-mode global-mode mode turn-on keyword-args... +This defines a global minor mode named @var{global-mode} whose meaning +is to enable the buffer-local minor mode @var{mode} in every buffer. +To turn on the minor mode in a buffer, it uses the function +@var{turn-on}; to turn off the minor mode, it calls @code{mode} with +@minus{}1 as argument. + +Use @code{:group @var{group}} in @var{keyword-args} to specify the +custom group for the mode variable of the global minor mode. +@end defmac + @node Mode Line Format @section Mode-Line Format @cindex mode line