Function: easy-mmode-define-global-mode
easy-mmode-define-global-mode is a function alias for
define-globalized-minor-mode, defined in easy-mmode.el.gz.
This macro is obsolete since 30.1; use define-globalized-minor-mode
instead.
Signature
(easy-mmode-define-global-mode GLOBAL-MODE MODE TURN-ON [KEY VALUE]... BODY...)
Documentation
Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE.
TURN-ON is a function that will be called with no args in every buffer and that should try to turn MODE on if applicable for that buffer.
Each of KEY VALUE is a pair of CL-style keyword arguments.
The :predicate key specifies in which major modes should the
globalized minor mode be switched on. The value should be t (meaning
switch on the minor mode in all major modes), nil (meaning don't
switch on in any major mode), a list of modes (meaning switch on only
in those modes and their descendants), or a list (not MODES...),
meaning switch on in any major mode except MODES. The value can also
mix all of these forms, see the Info node (elisp)Defining Minor Modes
for details. The :predicate key causes the macro to create a user option
named the same as MODE, but ending with "-modes" instead of "-mode".
That user option can then be used to customize in which modes this
globalized minor mode will be switched on.
As the minor mode defined by this function is always global, any
:global keyword is ignored.
Other keywords have the same meaning as in define-minor-mode,
which see. In particular, :group specifies the custom group.
The most useful keywords are those that are passed on to the defcustom.
It normally makes no sense to pass the :lighter or :keymap keywords
to define-globalized-minor-mode, since these are usually passed to
the buffer-local version of the minor mode.
BODY contains code to execute each time the mode is enabled or disabled. It is executed after toggling the mode, and before running GLOBAL-MODE-hook.
If MODE's set-up depends on the major mode in effect when it was enabled, then disabling and reenabling MODE should make MODE work correctly with the current major mode. This is important to prevent problems with derived modes, that is, major modes that call another major mode in their body.
When a major mode is initialized, MODE is actually turned on just after running the major mode's hook. However, MODE is not turned on if the hook has explicitly disabled it.
Probably introduced at or before Emacs version 22.1.
Aliases
easy-mmode-define-global-mode (obsolete since 30.1)
define-global-minor-mode (obsolete since 31.1)