Next: File Modes, Previous: Major Modes, Up: Modes [Index]
A minor mode is an optional editing mode that alters the behavior of Emacs in some well-defined way. Unlike major modes, any number of minor modes can be in effect at any time.
Some minor modes are buffer-local, and can be turned on (enabled) in certain buffers and off (disabled) in others.
Other minor modes are global: while enabled, they affect everything you do in the Emacs session, in all buffers.
Each minor mode is associated with a mode command, whose name consists of the
mode name followed by ‘-mode’. For instance, the mode command for ‘Auto Fill’
mode is auto-fill-mode
. But unlike a major mode command, which simply enables
the mode, the mode command for a minor mode can either enable or disable
it:
invoking the mode-command with no prefix argument toggles it on or off;
Most minor modes also have a mode variable, with the same name as the mode command. Its value is non-‘nil’ if the mode is enabled, and ‘nil’ if it is disabled. You should run the mode command instead of altering this variable. setting the mode variable through the Customize interface (see Easy Customization) will always properly enable or disable the mode, since Customize automatically runs the mode command for you.
Next: File Modes, Previous: Major Modes, Up: Modes [Index]