annotate lispref/abbrevs.texi @ 23989:38295026616a

(recover-session): Preserve point when inserting explanation.
author Andreas Schwab <schwab@suse.de>
date Mon, 04 Jan 1999 11:57:27 +0000
parents 90da2489c498
children 467b88fab665
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 @c -*-texinfo-*-
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2 @c This is part of the GNU Emacs Lisp Reference Manual.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4 @c See the file elisp.texi for copying conditions.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 @setfilename ../info/abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 @node Abbrevs, Processes, Syntax Tables, Top
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 @chapter Abbrevs And Abbrev Expansion
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 @cindex abbrev
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 @cindex abbrev table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 An abbreviation or @dfn{abbrev} is a string of characters that may be
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 expanded to a longer string. The user can insert the abbrev string and
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 find it replaced automatically with the expansion of the abbrev. This
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 saves typing.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 The set of abbrevs currently in effect is recorded in an @dfn{abbrev
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 table}. Each buffer has a local abbrev table, but normally all buffers
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 in the same major mode share one abbrev table. There is also a global
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 abbrev table. Normally both are used.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 An abbrev table is represented as an obarray containing a symbol for
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
22 each abbreviation. The symbol's name is the abbreviation; its value is
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 the expansion; its function definition is the hook function to do the
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
24 expansion (@pxref{Defining Abbrevs}); its property list cell contains
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
25 the use count, the number of times the abbreviation has been expanded.
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
26 Because these symbols are not interned in the usual obarray, they will
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
27 never appear as the result of reading a Lisp expression; in fact,
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
28 normally they are never used except by the code that handles abbrevs.
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
29 Therefore, it is safe to use them in an extremely nonstandard way.
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
30 @xref{Creating Symbols}.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 For the user-level commands for abbrevs, see @ref{Abbrevs,, Abbrev
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 Mode, emacs, The GNU Emacs Manual}.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 @menu
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 * Abbrev Mode:: Setting up Emacs for abbreviation.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 * Tables: Abbrev Tables. Creating and working with abbrev tables.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 * Defining Abbrevs:: Specifying abbreviations and their expansions.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 * Files: Abbrev Files. Saving abbrevs in files.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 * Expansion: Abbrev Expansion. Controlling expansion; expansion subroutines.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 * Standard Abbrev Tables:: Abbrev tables used by various major modes.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 @end menu
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 @node Abbrev Mode, Abbrev Tables, Abbrevs, Abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 @comment node-name, next, previous, up
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 @section Setting Up Abbrev Mode
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 Abbrev mode is a minor mode controlled by the value of the variable
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 @code{abbrev-mode}.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 @defvar abbrev-mode
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 A non-@code{nil} value of this variable turns on the automatic expansion
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 of abbrevs when their abbreviations are inserted into a buffer.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 If the value is @code{nil}, abbrevs may be defined, but they are not
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 expanded automatically.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56
21682
90da2489c498 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 21007
diff changeset
57 This variable automatically becomes buffer-local when set in any fashion.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 @defvar default-abbrev-mode
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
61 This is the value of @code{abbrev-mode} for buffers that do not override it.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 This is the same as @code{(default-value 'abbrev-mode)}.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 @node Abbrev Tables, Defining Abbrevs, Abbrev Mode, Abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 @section Abbrev Tables
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 This section describes how to create and manipulate abbrev tables.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 @defun make-abbrev-table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 This function creates and returns a new, empty abbrev table---an obarray
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 containing no symbols. It is a vector filled with zeros.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 @end defun
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 @defun clear-abbrev-table table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 This function undefines all the abbrevs in abbrev table @var{table},
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 leaving it empty. The function returns @code{nil}.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 @end defun
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 @defun define-abbrev-table tabname definitions
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 This function defines @var{tabname} (a symbol) as an abbrev table name,
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 i.e., as a variable whose value is an abbrev table. It defines abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 in the table according to @var{definitions}, a list of elements of the
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 form @code{(@var{abbrevname} @var{expansion} @var{hook}
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
85 @var{usecount})}. The return value is always @code{nil}.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 @end defun
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 @defvar abbrev-table-name-list
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 This is a list of symbols whose values are abbrev tables.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 @code{define-abbrev-table} adds the new abbrev table name to this list.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 @defun insert-abbrev-table-description name &optional human
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 This function inserts before point a description of the abbrev table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 named @var{name}. The argument @var{name} is a symbol whose value is an
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
96 abbrev table. The return value is always @code{nil}.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 If @var{human} is non-@code{nil}, the description is human-oriented.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 Otherwise the description is a Lisp expression---a call to
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
100 @code{define-abbrev-table} that would define @var{name} exactly as it
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 is currently defined.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 @end defun
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 @node Defining Abbrevs, Abbrev Files, Abbrev Tables, Abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 @comment node-name, next, previous, up
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 @section Defining Abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 These functions define an abbrev in a specified abbrev table.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 @code{define-abbrev} is the low-level basic function, while
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 @code{add-abbrev} is used by commands that ask for information from the
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 user.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 @defun add-abbrev table type arg
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
114 This function adds an abbreviation to abbrev table @var{table} based on
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
115 information from the user. The argument @var{type} is a string
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
116 describing in English the kind of abbrev this will be (typically,
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
117 @code{"global"} or @code{"mode-specific"}); this is used in prompting
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
118 the user. The argument @var{arg} is the number of words in the
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
119 expansion.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
121 The return value is the symbol that internally represents the new
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 abbrev, or @code{nil} if the user declines to confirm redefining an
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 existing abbrev.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 @end defun
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 @defun define-abbrev table name expansion hook
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
127 This function defines an abbrev named @var{name}, in @var{table}, to
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
128 expand to @var{expansion} and call @var{hook}. The return value is a
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
129 symbol that represents the abbrev inside Emacs; its name is @var{name}.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 The argument @var{name} should be a string. The argument
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
132 @var{expansion} is normally the desired expansion (a string), or
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
133 @code{nil} to undefine the abbrev. If it is anything but a string or
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
134 @code{nil}, then the abbreviation ``expands'' solely by running
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
135 @var{hook}.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 The argument @var{hook} is a function or @code{nil}. If @var{hook} is
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 non-@code{nil}, then it is called with no arguments after the abbrev is
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 replaced with @var{expansion}; point is located at the end of
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
140 @var{expansion} when @var{hook} is called.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 The use count of the abbrev is initialized to zero.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 @end defun
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 @defopt only-global-abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 If this variable is non-@code{nil}, it means that the user plans to use
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 global abbrevs only. This tells the commands that define mode-specific
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 abbrevs to define global ones instead. This variable does not alter the
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
149 behavior of the functions in this section; it is examined by their
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 callers.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 @end defopt
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 @node Abbrev Files, Abbrev Expansion, Defining Abbrevs, Abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 @section Saving Abbrevs in Files
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 A file of saved abbrev definitions is actually a file of Lisp code.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 The abbrevs are saved in the form of a Lisp program to define the same
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 abbrev tables with the same contents. Therefore, you can load the file
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 with @code{load} (@pxref{How Programs Do Loading}). However, the
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 function @code{quietly-read-abbrev-file} is provided as a more
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 convenient interface.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 User-level facilities such as @code{save-some-buffers} can save
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 abbrevs in a file automatically, under the control of variables
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 described here.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 @defopt abbrev-file-name
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 This is the default file name for reading and saving abbrevs.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 @end defopt
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 @defun quietly-read-abbrev-file filename
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 This function reads abbrev definitions from a file named @var{filename},
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 previously written with @code{write-abbrev-file}. If @var{filename} is
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 @code{nil}, the file specified in @code{abbrev-file-name} is used.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 @code{save-abbrevs} is set to @code{t} so that changes will be saved.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 This function does not display any messages. It returns @code{nil}.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 @end defun
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 @defopt save-abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 A non-@code{nil} value for @code{save-abbrev} means that Emacs should
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 save abbrevs when files are saved. @code{abbrev-file-name} specifies
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 the file to save the abbrevs in.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 @end defopt
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 @defvar abbrevs-changed
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 This variable is set non-@code{nil} by defining or altering any
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 abbrevs. This serves as a flag for various Emacs commands to offer to
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 save your abbrevs.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 @deffn Command write-abbrev-file filename
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 Save all abbrev definitions, in all abbrev tables, in the file
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
194 @var{filename}, in the form of a Lisp program that when loaded will
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 define the same abbrevs. This function returns @code{nil}.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 @end deffn
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 @node Abbrev Expansion, Standard Abbrev Tables, Abbrev Files, Abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 @comment node-name, next, previous, up
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 @section Looking Up and Expanding Abbreviations
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
202 Abbrevs are usually expanded by certain interactive commands,
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 including @code{self-insert-command}. This section describes the
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
204 subroutines used in writing such commands, as well as the variables they
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
205 use for communication.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 @defun abbrev-symbol abbrev &optional table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 This function returns the symbol representing the abbrev named
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 @var{abbrev}. The value returned is @code{nil} if that abbrev is not
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 defined. The optional second argument @var{table} is the abbrev table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 to look it up in. If @var{table} is @code{nil}, this function tries
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 first the current buffer's local abbrev table, and second the global
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 abbrev table.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 @end defun
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
216 @defun abbrev-expansion abbrev &optional table
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
217 This function returns the string that @var{abbrev} would expand into (as
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
218 defined by the abbrev tables used for the current buffer). The optional
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
219 argument @var{table} specifies the abbrev table to use, as in
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
220 @code{abbrev-symbol}.
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
221 @end defun
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
222
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
223 @deffn Command expand-abbrev
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
224 This command expands the abbrev before point, if any.
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
225 If point does not follow an abbrev, this command does nothing.
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
226 The command returns @code{t} if it did expansion, @code{nil} otherwise.
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
227 @end deffn
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
228
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
229 @deffn Command abbrev-prefix-mark &optional arg
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
230 Mark current point as the beginning of an abbrev. The next call to
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
231 @code{expand-abbrev} will use the text from here to point (where it is
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
232 then) as the abbrev to expand, rather than using the previous word as
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
233 usual.
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
234 @end deffn
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
235
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 @defopt abbrev-all-caps
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 When this is set non-@code{nil}, an abbrev entered entirely in upper
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 case is expanded using all upper case. Otherwise, an abbrev entered
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 entirely in upper case is expanded by capitalizing each word of the
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 expansion.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 @end defopt
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 @defvar abbrev-start-location
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 This is the buffer position for @code{expand-abbrev} to use as the start
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 of the next abbrev to be expanded. (@code{nil} means use the word
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 before point instead.) @code{abbrev-start-location} is set to
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247 @code{nil} each time @code{expand-abbrev} is called. This variable is
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 also set by @code{abbrev-prefix-mark}.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 @defvar abbrev-start-location-buffer
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 The value of this variable is the buffer for which
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 @code{abbrev-start-location} has been set. Trying to expand an abbrev
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 in any other buffer clears @code{abbrev-start-location}. This variable
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 is set by @code{abbrev-prefix-mark}.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 @defvar last-abbrev
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
259 This is the @code{abbrev-symbol} of the most recent abbrev expanded. This
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 information is left by @code{expand-abbrev} for the sake of the
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
261 @code{unexpand-abbrev} command (@pxref{Expanding Abbrevs,, Expanding
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
262 Abbrevs, emacs, The GNU Emacs Manual}).
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 @defvar last-abbrev-location
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
266 This is the location of the most recent abbrev expanded. This contains
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 information left by @code{expand-abbrev} for the sake of the
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 @code{unexpand-abbrev} command.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 @defvar last-abbrev-text
21007
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
272 This is the exact expansion text of the most recent abbrev expanded,
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
273 after case conversion (if any). Its value is @code{nil} if the abbrev
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
274 has already been unexpanded. This contains information left by
66d807bdc5b4 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7688
diff changeset
275 @code{expand-abbrev} for the sake of the @code{unexpand-abbrev} command.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 @c Emacs 19 feature
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 @defvar pre-abbrev-expand-hook
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 This is a normal hook whose functions are executed, in sequence, just
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281 before any expansion of an abbrev. @xref{Hooks}. Since it is a normal
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 hook, the hook functions receive no arguments. However, they can find
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 the abbrev to be expanded by looking in the buffer before point.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 The following sample code shows a simple use of
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 @code{pre-abbrev-expand-hook}. If the user terminates an abbrev with a
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 punctuation character, the hook function asks for confirmation. Thus,
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 this hook allows the user to decide whether to expand the abbrev, and
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 aborts expansion if it is not confirmed.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 @smallexample
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 (add-hook 'pre-abbrev-expand-hook 'query-if-not-space)
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 ;; @r{This is the function invoked by @code{pre-abbrev-expand-hook}.}
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 ;; @r{If the user terminated the abbrev with a space, the function does}
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298 ;; @r{nothing (that is, it returns so that the abbrev can expand). If the}
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 ;; @r{user entered some other character, this function asks whether}
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300 ;; @r{expansion should continue.}
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
302 ;; @r{If the user answers the prompt with @kbd{y}, the function returns}
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 ;; @r{@code{nil} (because of the @code{not} function), but that is}
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 ;; @r{acceptable; the return value has no effect on expansion.}
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 (defun query-if-not-space ()
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307 (if (/= ?\ (preceding-char))
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 (if (not (y-or-n-p "Do you want to expand this abbrev? "))
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 (error "Not expanding this abbrev"))))
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 @end smallexample
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312 @node Standard Abbrev Tables, , Abbrev Expansion, Abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 @comment node-name, next, previous, up
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314 @section Standard Abbrev Tables
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 Here we list the variables that hold the abbrev tables for the
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 preloaded major modes of Emacs.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319 @defvar global-abbrev-table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 This is the abbrev table for mode-independent abbrevs. The abbrevs
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 defined in it apply to all buffers. Each buffer may also have a local
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 abbrev table, whose abbrev definitions take precedence over those in the
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 global table.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 @defvar local-abbrev-table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 The value of this buffer-local variable is the (mode-specific)
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 abbreviation table of the current buffer.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331 @defvar fundamental-mode-abbrev-table
7688
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
332 This is the local abbrev table used in Fundamental mode; in other words,
ab6b8aa5002e entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 6552
diff changeset
333 it is the local abbrev table in all buffers in Fundamental mode.
6552
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 @defvar text-mode-abbrev-table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337 This is the local abbrev table used in Text mode.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 @end defvar
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 @defvar lisp-mode-abbrev-table
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 This is the local abbrev table used in Lisp mode and Emacs Lisp mode.
3b84ed22f747 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 @end defvar