Next: Modeline Format, Previous: Major Modes, Up: Modes [Contents][Index]
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 is unwieldy.
A minor mode is not usually a modification of single major mode. For example, Auto Fill mode may be used in 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 SXEmacs. 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. |