[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

AD.1 Minor Modes

Minor modes are optional features which you can turn on or off. For example, Auto Fill mode is a minor mode in which SPC breaks lines between words as you type. All the minor modes are independent of each other and of the selected major mode. Most minor modes say in the mode line when they are on; for example, `Fill' in the mode line means that Auto Fill mode is on.

Append -mode to the name of a minor mode to get the name of a command function that turns the mode on or off. Thus, the command to enable or disable Auto Fill mode is called M-x auto-fill-mode. These commands are usually invoked with M-x, but you can bind keys to them if you wish. With no argument, the function turns the mode on if it was off and off if it was on. This is known as toggling. A positive argument always turns the mode on, and an explicit zero argument or a negative argument always turns it off.

Some minor modes are global: while enabled, they affect everything you do in the Emacs session, in all buffers. Other minor modes are buffer-local; they apply only to the current buffer, so you can enable the mode in certain buffers and not others.

For most minor modes, the command name is also the name of a variable which directly controls the mode. The mode is enabled whenever this variable's value is non-nil, and the minor-mode command works by setting the variable. For example, the command outline-minor-mode works by setting the value of outline-minor-mode as a variable; it is this variable that directly turns Outline minor mode on and off. To check whether a given minor mode works this way, use C-h v to ask for documentation on the variable name.

These minor-mode variables provide a good way for Lisp programs to turn minor modes on and off; they are also useful in a file's local variables list. But please think twice before setting minor modes with a local variables list, because most minor modes are matter of user preference--other users editing the same file might not want the same minor modes you prefer.

The buffer-local minor modes include Abbrev mode, Auto Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, ISO Accents mode, Outline minor mode, Overwrite mode, and Binary Overwrite mode.

Abbrev mode allows you to define abbreviations that automatically expand as you type them. For example, `amd' might expand to `abbrev mode'. See section X. Abbrevs, for full information.

Auto Fill mode allows you to enter filled text without breaking lines explicitly. Emacs inserts newlines as necessary to prevent lines from becoming too long. See section T.5 Filling Text.

Auto Save mode causes the contents of a buffer to be saved periodically to reduce the amount of work you can lose in case of a system crash. See section M.5 Auto-Saving: Protection Against Disasters.

Enriched mode enables editing and saving of formatted text. See section T.11 Editing Formatted Text.

Flyspell mode automatically highlights misspelled words. See section L.4 Checking and Correcting Spelling.

Font-Lock mode automatically highlights certain textual units found in programs, such as comments, strings, and function names being defined. This requires a window system that can display multiple fonts. See section J.1 Using Multiple Typefaces.

ISO Accents mode makes the characters ``', `'', `"', `^', `/' and `~' combine with the following letter, to produce an accented letter in the ISO Latin-1 character set. The newer and more general feature of input methods more or less supersedes ISO Accents mode. See section Q.13 Single-byte Character Set Support.

Outline minor mode provides the same facilities as the major mode called Outline mode; but since it is a minor mode instead, you can combine it with any major mode. See section T.8 Outline Mode.

Overwrite mode causes ordinary printing characters to replace existing text instead of shoving it to the right. For example, if point is in front of the `B' in `FOOBAR', then in Overwrite mode typing a G changes it to `FOOGAR', instead of producing `FOOGBAR' as usual. In Overwrite mode, the command C-q inserts the next character whatever it may be, even if it is a digit--this gives you a way to insert a character instead of replacing an existing character.

The command overwrite-mode is an exception to the rule that commands which toggle minor modes are normally not bound to keys: it is bound to the INSERT function key. This is because many other programs bind INSERT to similar functions.

Binary Overwrite mode is a variant of Overwrite mode for editing binary files; it treats newlines and tabs like other characters, so that they overwrite other characters and can be overwritten by them. In Binary Overwrite mode, digits after C-q specify an octal character code, as usual.

The following minor modes normally apply to all buffers at once. Since each is enabled or disabled by the value of a variable, you can set them differently for particular buffers, by explicitly making the corresponding variables local in those buffers. See section AD.2.4 Local Variables.

Icomplete mode displays an indication of available completions when you are in the minibuffer and completion is active. See section E.3.4 Completion Options.

Line Number mode enables continuous display in the mode line of the line number of point, and Column Number mode enables display of the column number. See section B.3 The Mode Line.

Scroll Bar mode gives each window a scroll bar (see section P.13 Scroll Bars). Menu Bar mode gives each frame a menu bar (see section P.15 Menu Bars). Both of these modes are enabled by default when you use the X Window System.

In Transient Mark mode, every change in the buffer contents "deactivates" the mark, so that commands that operate on the region will get an error. This means you must either set the mark, or explicitly "reactivate" it, before each command that uses the region. The advantage of Transient Mark mode is that Emacs can display the region highlighted (currently only when using X). See section H. The Mark and the Region.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 2, 2002 using texi2html