24.3 Minor Modes

A minor mode provides optional features that users may enable or disable independently of the choice of major mode. Minor modes can be enabled individually or in combination.

Most minor modes implement features that are independent of the major mode, and can thus be used with most major modes. For example, Auto Fill mode works with any major mode that permits text insertion. A few minor modes, however, are specific to a particular major mode. For example, Diff Auto Refine mode is a minor mode that is intended to be used only with Diff mode.

Ideally, a minor mode should have its desired effect regardless of the other minor modes in effect. It should be possible to activate and deactivate minor modes in any order.

Variable: local-minor-modes

This buffer-local variable lists the currently enabled minor modes in the current buffer, and is a list of symbols.

Variable: global-minor-modes

This variable lists the currently enabled global minor modes, and is a list of symbols.

Variable: minor-mode-list

The value of this variable is a list of all minor mode commands.