[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
34.1 Abbrev Concepts
An abbrev is a word which has been defined to expand into a specified expansion. When you insert a word-separator character following the abbrev, that expands the abbrev—replacing the abbrev with its expansion. For example, if ‘foo’ is defined as an abbrev expanding to ‘find outer otter’, then you can insert ‘find outer otter.’ into the buffer by typing f o o ..
Abbrevs expand only when Abbrev mode (a minor mode) is enabled.
Disabling Abbrev mode does not cause abbrev definitions to be forgotten,
but they do not expand until Abbrev mode is enabled again. The command
M-x abbrev-mode toggles Abbrev mode; with a numeric argument, it
turns Abbrev mode on if the argument is positive, off otherwise.
See section Minor Modes. abbrev-mode
is also a variable; Abbrev mode is
on when the variable is non-nil
. The variable abbrev-mode
automatically becomes local to the current buffer when it is set.
Abbrevs can have mode-specific definitions, active only in one major mode. Abbrevs can also have global definitions that are active in all major modes. The same abbrev can have a global definition and various mode-specific definitions for different major modes. A mode-specific definition for the current major mode overrides a global definition.
You can define abbrevs interactively during the editing session. You can also save lists of abbrev definitions in files for use in later sessions. Some users keep extensive lists of abbrevs that they load in every session.