GNU Info

Info Node: (elisp)Minor Modes

(elisp)Minor Modes


Next: Mode Line Format Prev: Major Modes Up: Modes
Enter node , (file) or (file)node

Minor Modes
===========

   A "minor mode" provides features that users may enable or disable
independently of the choice of major mode.  Minor modes can be enabled
individually or in combination.  Minor modes would be better named
"generally available, optional feature modes," except that such a name
would be unwieldy.

   A minor mode is not usually meant as a variation of a single major
mode.  Usually they are general and can apply to many major modes.  For
example, Auto Fill mode works with any major mode that permits text
insertion.  To be general, a minor mode must be effectively independent
of the things major modes do.

   A minor mode is often much more difficult to implement than a major
mode.  One reason is that you should be able to activate and deactivate
minor modes in any order.  A minor mode should be able to have its
desired effect regardless of the major mode and regardless of the other
minor modes in effect.

   Often the biggest problem in implementing a minor mode is finding a
way to insert the necessary hook into the rest of Emacs.  Minor mode
keymaps make this easier than it used to be.

Minor Mode Conventions
Tips for writing a minor mode.
Keymaps and Minor Modes
How a minor mode can have its own keymap.
Defining Minor Modes
A convenient facility for defining minor modes.

automatically generated by info2www version 1.2.2.9