Next: Dynamic Abbrevs, Previous: Editing Abbrevs, Up: Abbrevs
These commands allow you to keep abbrev definitions between editing sessions.
M-x write-abbrev-file reads a file name using the minibuffer and then writes a description of all current abbrev definitions into that file. This is used to save abbrev definitions for use in a later session. The text stored in the file is a series of Lisp expressions that, when executed, define the same abbrevs that you currently have.
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 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 .emacs
file. If either of these functions is called with nil
as the
argument, it uses the file name specified in the variable
abbrev-file-name
, which is by default "~/.abbrev_defs"
.
That file is your standard abbrev definition file, and Emacs loads
abbrevs from it automatically when it starts up.
Emacs will offer to save abbrevs automatically if you have changed
any of them, whenever it offers to save all files (for C-x s or
C-x C-c). It saves them in the file specified by
abbrev-file-name
. This feature can be inhibited by setting the
variable save-abbrevs
to nil
.
The commands M-x insert-abbrevs and M-x define-abbrevs are similar to the previous commands but work on text in an Emacs buffer. M-x insert-abbrevs inserts text into the current buffer after point, describing all current abbrev definitions; M-x define-abbrevs parses the entire current buffer and defines abbrevs accordingly.