# HG changeset patch # User Richard M. Stallman # Date 1116079181 0 # Node ID 37b336c94e1577419dc639cb74bb5d072f96d246 # Parent 6cec4d45253db5c2dad57eef145cdd7d2db96f30 (Defining Minor Modes): Define define-global-minor-mode. diff -r 6cec4d45253d -r 37b336c94e15 lispref/modes.texi --- a/lispref/modes.texi Sat May 14 13:58:01 2005 +0000 +++ b/lispref/modes.texi Sat May 14 13:59:41 2005 +0000 @@ -1184,8 +1184,9 @@ 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 @@ :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