@c This is part of the Emacs manual.
@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
-@node Abbrevs, Picture, Building, Top
+@node Abbrevs, Picture, Maintaining, Top
@chapter Abbrevs
@cindex abbrevs
@cindex expansion (of abbrevs)
Abbrevs}.
``Hippie'' expansion generalizes abbreviation expansion. @xref{Hippie
-Expand, , ``Hippie'' Expansion, autotype, Features for Automatic
+Expand, , Hippie Expansion, autotype, Features for Automatic
Typing}.
@menu
@item C-x a i l
Define a word in the buffer as a mode-specific abbrev
(@code{inverse-add-mode-abbrev}).
+@item M-x define-global-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET}
+Define @var{abbrev} as an abbrev expanding into @var{exp}.
+@item M-x define-mode-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET}
+Define @var{abbrev} as a mode-specific abbrev expanding into @var{exp}.
@item M-x kill-all-abbrevs
This command discards all abbrev definitions currently in effect,
leaving a blank slate.
meaning of the two text strings they use (one from the buffer and one
read with the minibuffer).
+@findex define-mode-abbrev
+@findex define-global-abbrev
+ You can define an abbrev without inserting either the abbrev or its
+expansion in the buffer using the command @code{define-global-abbrev}.
+It reads two arguments--the abbrev, and its expansion. The command
+@code{define-mode-abbrev} does likewise for a mode-specific abbrev.
+
To change the definition of an abbrev, just define a new definition.
When the abbrev has a prior definition, the abbrev definition commands
-ask for confirmation for replacing it.
+ask for confirmation before replacing it.
To remove an abbrev definition, give a negative argument to the abbrev
definition command: @kbd{C-u - C-x a g} or @kbd{C-u - C-x a l}. The
@table @kbd
@item M-x list-abbrevs
-Display a list of all abbrev definitions. With numeric argument, list
+Display a list of all abbrev definitions. With a numeric argument, list
only local abbrevs.
@item M-x edit-abbrevs
Edit a list of abbrevs; you can add, alter or remove definitions.
@findex read-abbrev-file
@findex quietly-read-abbrev-file
@vindex abbrev-file-name
- @kbd{M-x read-abbrev-file} reads a file name using the minibuffer and
-then reads the file, defining abbrevs according to the contents of the
-file. @kbd{M-x quietly-read-abbrev-file} is the same except that it
-does not display a message in the echo area saying that it is doing its
-work; it is actually useful primarily in the @file{.emacs} file. If an
-empty argument is given to either of these functions, they use the file
-name specified in the variable @code{abbrev-file-name}, which is by
-default @code{"~/.abbrev_defs"}.
+ @kbd{M-x read-abbrev-file} reads a file name using the minibuffer
+and then reads the file, defining abbrevs according to the contents of
+the file. The function @code{quietly-read-abbrev-file} is similar
+except that it does not display a message in the echo area; you cannot
+invoke it interactively, and it is used primarily in the @file{.emacs}
+file. If either of these functions is called with @code{nil} as the
+argument, it uses the file name specified in the variable
+@code{abbrev-file-name}, which is by default @code{"~/.abbrev_defs"}.
+That file is your standard abbrev definition file, and Emacs loads
+abbrevs from it automatically when it starts up.
@vindex save-abbrevs
- Emacs will offer to save abbrevs automatically if you have changed any of
-them, whenever it offers to save all files (for @kbd{C-x s} or @kbd{C-x
-C-c}). This feature can be inhibited by setting the variable
-@code{save-abbrevs} to @code{nil}.
+ Emacs will offer to save abbrevs automatically if you have changed
+any of them, whenever it offers to save all files (for @kbd{C-x s} or
+@kbd{C-x C-c}). It saves them in the file specified by
+@code{abbrev-file-name}. This feature can be inhibited by setting the
+variable @code{save-abbrevs} to @code{nil}.
@findex insert-abbrevs
@findex define-abbrevs
@vindex dabbrev-case-fold-search
This feature is controlled by the variable
@code{dabbrev-case-fold-search}. If it is @code{t}, case is ignored in
-this search; if @code{nil}, the word and the expansion must match in
-case. If the value of @code{dabbrev-case-fold-search} is
+this search; if it is @code{nil}, the word and the expansion must match
+in case. If the value of @code{dabbrev-case-fold-search} is
@code{case-fold-search}, which is true by default, then the variable
@code{case-fold-search} controls whether to ignore case while searching
for expansions.
@vindex dabbrev-case-fold-search
The variable @code{dabbrev-case-replace} controls whether to preserve
the case pattern of the abbrev. If it is @code{t}, the abbrev's case
-pattern is preserved in most cases; if @code{nil}, the expansion is
+pattern is preserved in most cases; if it is @code{nil}, the expansion is
always copied verbatim. If the value of @code{dabbrev-case-replace} is
@code{case-replace}, which is true by default, then the variable
@code{case-replace} controls whether to copy the expansion verbatim.