aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-03-08 03:06:04 +0000
committerRichard M. Stallman2005-03-08 03:06:04 +0000
commit937dbf8c44ef25f3453372a4ebe6e3708d41095b (patch)
treeedf0b7abf7589d840e42df79f532cc6d61bc80e6
parent2634c6e41abdbdff6f61be884aa7f921e82c0885 (diff)
downloademacs-937dbf8c44ef25f3453372a4ebe6e3708d41095b.tar.gz
emacs-937dbf8c44ef25f3453372a4ebe6e3708d41095b.zip
(Common Keywords): Clarify :require. Mention :version here.
(Variable Definitions, Group Definitions): Not here. (Variable Definitions): Clarify symbol arg to :initialize and :set fns.
-rw-r--r--lispref/customize.texi57
1 files changed, 20 insertions, 37 deletions
diff --git a/lispref/customize.texi b/lispref/customize.texi
index 225a487af9b..a1a61ab6b09 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -84,13 +84,17 @@ item. Loading is done with @code{load-library}, and only if the file is
84not already loaded. 84not already loaded.
85 85
86@item :require @var{feature} 86@item :require @var{feature}
87Require feature @var{feature} (a symbol) when installing a value for 87Execute @code{(require '@var{feature})} when your saved customizations
88this item (an option or a face) that was saved using the customization 88set the value of this item. @var{feature} should be a symbol.
89feature. This is done by calling @code{require}.
90 89
91The most common reason to use @code{:require} is when a variable enables 90The most common reason to use @code{:require} is when a variable enables
92a feature such as a minor mode, and just setting the variable won't have 91a feature such as a minor mode, and just setting the variable won't have
93any effect unless the code which implements the mode is loaded. 92any effect unless the code which implements the mode is loaded.
93
94@item :version @var{version}
95This option specifies that the item was first introduced in Emacs
96version @var{version}, or that its default value was changed in that
97version. The value @var{version} must be a string.
94@end table 98@end table
95 99
96@node Group Definitions 100@node Group Definitions
@@ -130,17 +134,9 @@ is a symbol, and @var{widget} is a widget type for editing that symbol.
130Useful widgets are @code{custom-variable} for a variable, 134Useful widgets are @code{custom-variable} for a variable,
131@code{custom-face} for a face, and @code{custom-group} for a group. 135@code{custom-face} for a face, and @code{custom-group} for a group.
132 136
133When a new group is introduced into Emacs, use this keyword in 137When you introduce a new group into Emacs, use the @code{:version}
134@code{defgroup}: 138keyword in the @code{defgroup}; then you need not use it for
135 139the individual members of the group.
136@table @code
137@item :version @var{version}
138This option specifies that the group was first introduced in Emacs
139version @var{version}. The value @var{version} must be a string.
140@end table
141
142Tag the group with a version like this when it is introduced, rather
143than the individual members (@pxref{Variable Definitions}).
144 140
145In addition to the common keywords (@pxref{Common Keywords}), you can 141In addition to the common keywords (@pxref{Common Keywords}), you can
146also use this keyword in @code{defgroup}: 142also use this keyword in @code{defgroup}:
@@ -223,26 +219,13 @@ This is meaningful only for certain types, currently including
223@code{hook}, @code{plist} and @code{alist}. See the definition of the 219@code{hook}, @code{plist} and @code{alist}. See the definition of the
224individual types for a description of how to use @code{:options}. 220individual types for a description of how to use @code{:options}.
225 221
226@item :version @var{version}
227This option specifies that the variable was first introduced, or its
228default value was changed, in Emacs version @var{version}. The value
229@var{version} must be a string. For example,
230
231@example
232(defcustom foo-max 34
233 "*Maximum number of foo's allowed."
234 :type 'integer
235 :group 'foo
236 :version "20.3")
237@end example
238
239@item :set @var{setfunction} 222@item :set @var{setfunction}
240Specify @var{setfunction} as the way to change the value of this option. 223Specify @var{setfunction} as the way to change the value of this
241The function @var{setfunction} should take two arguments, a symbol and 224option. The function @var{setfunction} should take two arguments, a
242the new value, and should do whatever is necessary to update the value 225symbol (the option name) and the new value, and should do whatever is
243properly for this option (which may not mean simply setting the option 226necessary to update the value properly for this option (which may not
244as a Lisp variable). The default for @var{setfunction} is 227mean simply setting the option as a Lisp variable). The default for
245@code{set-default}. 228@var{setfunction} is @code{set-default}.
246 229
247@item :get @var{getfunction} 230@item :get @var{getfunction}
248Specify @var{getfunction} as the way to extract the value of this 231Specify @var{getfunction} as the way to extract the value of this
@@ -258,10 +241,10 @@ is almost surely a mistake to specify @code{getfunction} for a value
258that really is stored in a Lisp variable. 241that really is stored in a Lisp variable.
259 242
260@item :initialize @var{function} 243@item :initialize @var{function}
261@var{function} should be a function used to initialize the variable when 244@var{function} should be a function used to initialize the variable
262the @code{defcustom} is evaluated. It should take two arguments, the 245when the @code{defcustom} is evaluated. It should take two arguments,
263symbol and value. Here are some predefined functions meant for use in 246the option name (a symbol) and the value. Here are some predefined
264this way: 247functions meant for use in this way:
265 248
266@table @code 249@table @code
267@item custom-initialize-set 250@item custom-initialize-set