aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2001-12-30 20:07:27 +0000
committerRichard M. Stallman2001-12-30 20:07:27 +0000
commitd9cc1d0ed374d1d432919d249985d80a1de0e80c (patch)
tree21776ec3c95eed2d4ecd59e58a36110a6fcfb7b8
parent1b8c66fec815e707a148955f7cdd4c7dac517686 (diff)
downloademacs-d9cc1d0ed374d1d432919d249985d80a1de0e80c.tar.gz
emacs-d9cc1d0ed374d1d432919d249985d80a1de0e80c.zip
Explain about ``system'' abbrevs.
-rw-r--r--lispref/abbrevs.texi67
1 files changed, 40 insertions, 27 deletions
diff --git a/lispref/abbrevs.texi b/lispref/abbrevs.texi
index 58e1ffaf646..332e4878c28 100644
--- a/lispref/abbrevs.texi
+++ b/lispref/abbrevs.texi
@@ -20,15 +20,17 @@ in the same major mode share one abbrev table. There is also a global
20abbrev table. Normally both are used. 20abbrev table. Normally both are used.
21 21
22 An abbrev table is represented as an obarray containing a symbol for 22 An abbrev table is represented as an obarray containing a symbol for
23each abbreviation. The symbol's name is the abbreviation; its value is 23each abbreviation. The symbol's name is the abbreviation; its value
24the expansion; its function definition is the hook function to do the 24is the expansion; its function definition is the hook function to do
25expansion (@pxref{Defining Abbrevs}); its property list cell contains 25the expansion (@pxref{Defining Abbrevs}); its property list cell
26the use count, the number of times the abbreviation has been expanded. 26typically contains the use count, the number of times the abbreviation
27Because these symbols are not interned in the usual obarray, they will 27has been expanded. (Alternatively, the use count is on the
28never appear as the result of reading a Lisp expression; in fact, 28@code{count} property and the system-abbrev flag is on the
29normally they are never used except by the code that handles abbrevs. 29@code{system-type} property.) Because these symbols are not interned
30Therefore, it is safe to use them in an extremely nonstandard way. 30in the usual obarray, they will never appear as the result of reading
31@xref{Creating Symbols}. 31a Lisp expression; in fact, normally they are never used except by the
32code that handles abbrevs. Therefore, it is safe to use them in an
33extremely nonstandard way. @xref{Creating Symbols}.
32 34
33 For the user-level commands for abbrevs, see @ref{Abbrevs,, Abbrev 35 For the user-level commands for abbrevs, see @ref{Abbrevs,, Abbrev
34Mode, emacs, The GNU Emacs Manual}. 36Mode, emacs, The GNU Emacs Manual}.
@@ -79,11 +81,12 @@ leaving it empty. It always returns @code{nil}.
79@end defun 81@end defun
80 82
81@defun define-abbrev-table tabname definitions 83@defun define-abbrev-table tabname definitions
82This function defines @var{tabname} (a symbol) as an abbrev table name, 84This function defines @var{tabname} (a symbol) as an abbrev table
83i.e., as a variable whose value is an abbrev table. It defines abbrevs 85name, i.e., as a variable whose value is an abbrev table. It defines
84in the table according to @var{definitions}, a list of elements of the 86abbrevs in the table according to @var{definitions}, a list of
85form @code{(@var{abbrevname} @var{expansion} @var{hook} 87elements of the form @code{(@var{abbrevname} @var{expansion}
86@var{usecount})}. The return value is always @code{nil}. 88@var{hook} @var{usecount} @r{[}@var{system-flag}@r{]})}. The return
89value is always @code{nil}.
87@end defun 90@end defun
88 91
89@defvar abbrev-table-name-list 92@defvar abbrev-table-name-list
@@ -124,13 +127,15 @@ abbrev, or @code{nil} if the user declines to confirm redefining an
124existing abbrev. 127existing abbrev.
125@end defun 128@end defun
126 129
127@defun define-abbrev table name expansion &optional hook count 130@defun define-abbrev table name expansion &optional hook count system-flag
128This function defines an abbrev named @var{name}, in @var{table}, to 131This function defines an abbrev named @var{name}, in @var{table}, to
129expand to @var{expansion} and call @var{hook}. The value of 132expand to @var{expansion} and call @var{hook}. The return value is a
130@var{count}, if specified, initializes the abbrev's usage-count. If 133symbol that represents the abbrev inside Emacs; its name is
131@var{count} is not specified or @code{nil}, the use count is initialized 134@var{name}.
132to zero. The return value is a symbol that represents the abbrev inside 135
133Emacs; its name is @var{name}. 136The value of @var{count}, if specified, initializes the abbrev's
137usage-count. If @var{count} is not specified or @code{nil}, the use
138count is initialized to zero.
134 139
135The argument @var{name} should be a string. The argument 140The argument @var{name} should be a string. The argument
136@var{expansion} is normally the desired expansion (a string), or 141@var{expansion} is normally the desired expansion (a string), or
@@ -150,6 +155,13 @@ the self-inserting input character that triggered the expansion. If
150of the character. By contrast, if @var{hook} returns @code{nil}, 155of the character. By contrast, if @var{hook} returns @code{nil},
151@code{expand-abbrev} also returns @code{nil}, as if expansion had not 156@code{expand-abbrev} also returns @code{nil}, as if expansion had not
152really occurred. 157really occurred.
158
159Normally the function @code{define-abbrev} sets the variable
160@code{abbrevs-changed} to @code{t}. But if @var{system-flag} is
161non-@code{nil}, that says the abbrev is a ``system'' abbrev. In that
162case, @code{define-abbrev} does not alter @code{abbrevs-changed}.
163Instead it marks the abbrev as a ``system'' abbrev with the
164@code{system-type} property.
153@end defun 165@end defun
154 166
155@defopt only-global-abbrevs 167@defopt only-global-abbrevs
@@ -195,16 +207,17 @@ the file to save the abbrevs in.
195@end defopt 207@end defopt
196 208
197@defvar abbrevs-changed 209@defvar abbrevs-changed
198This variable is set non-@code{nil} by defining or altering any 210This variable is set non-@code{nil} by defining or altering any
199abbrevs. This serves as a flag for various Emacs commands to offer to 211abbrevs (except ``system'' abbrevs). This serves as a flag for
200save your abbrevs. 212various Emacs commands to offer to save your abbrevs.
201@end defvar 213@end defvar
202 214
203@deffn Command write-abbrev-file &optional filename 215@deffn Command write-abbrev-file &optional filename
204Save all abbrev definitions, in all abbrev tables, in the file 216Save all abbrev definitions (except ``system'' abbrevs), in all abbrev
205@var{filename}, in the form of a Lisp program that when loaded will 217tables, in the file @var{filename}, in the form of a Lisp program that
206define the same abbrevs. If @var{filename} is @code{nil} or omitted, 218when loaded will define the same abbrevs. If @var{filename} is
207@code{abbrev-file-name} is used. This function returns @code{nil}. 219@code{nil} or omitted, @code{abbrev-file-name} is used. This function
220returns @code{nil}.
208@end deffn 221@end deffn
209 222
210@node Abbrev Expansion, Standard Abbrev Tables, Abbrev Files, Abbrevs 223@node Abbrev Expansion, Standard Abbrev Tables, Abbrev Files, Abbrevs