aboutsummaryrefslogtreecommitdiffstats
path: root/lispref/customize.texi
diff options
context:
space:
mode:
Diffstat (limited to 'lispref/customize.texi')
-rw-r--r--lispref/customize.texi60
1 files changed, 37 insertions, 23 deletions
diff --git a/lispref/customize.texi b/lispref/customize.texi
index 3aca1a90bcf..9e10e547b56 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -133,18 +133,21 @@ version. The value @var{version} must be a string.
133 133
134@item :package-version '(@var{package} . @var{version}) 134@item :package-version '(@var{package} . @var{version})
135This option specifies that the item was first introduced in 135This option specifies that the item was first introduced in
136@var{package} version @var{version}, or that its default value was 136@var{package} version @var{version}, or that its meaning or default
137changed in that version. This keyword takes priority over :version. 137value was changed in that version. The value of @var{package} is a
138The value of @var{package} is a symbol and @var{version} is a string. 138symbol and @var{version} is a string.
139The @var{package} and @var{version} must appear in the alist
140@code{customize-package-emacs-version-alist}. Since @var{package} must
141be unique and the user might see it in an error message, a good choice
142is the official name of the package, such as MH-E or Gnus.
143 139
140This keyword takes priority over @code{:version}.
141
142@var{package} should be the official name of the package, such as MH-E
143or Gnus. If the package @var{package} is released as part of Emacs,
144@var{package} and @var{version} should appear in the value of
145@code{customize-package-emacs-version-alist}.
144@end table 146@end table
145 147
146Packages that use the @code{:package-version} keyword must also update 148Packages distributed as part of Emacs that use the
147the @code{customize-package-emacs-version-alist} variable. 149@code{:package-version} keyword must also update the
150@code{customize-package-emacs-version-alist} variable.
148 151
149@defvar customize-package-emacs-version-alist 152@defvar customize-package-emacs-version-alist
150This alist provides a mapping for the versions of Emacs that are 153This alist provides a mapping for the versions of Emacs that are
@@ -248,19 +251,30 @@ turn this feature back on, if someone would like to do the work.
248 251
249 Use @code{defcustom} to declare user-editable variables. 252 Use @code{defcustom} to declare user-editable variables.
250 253
251@defmac defcustom option default doc [keyword value]@dots{} 254@defmac defcustom option standard doc [keyword value]@dots{}
252Declare @var{option} as a customizable user option variable. Do not 255This construct declares @var{option} as a customizable user option
253quote @var{option}. The argument @var{doc} specifies the documentation 256variable. You should not quote @var{option}. The argument @var{doc}
254string for the variable. There is no need to start it with a @samp{*} 257specifies the documentation string for the variable. There is no need
255because @code{defcustom} automatically marks @var{option} as a 258to start it with a @samp{*}, because @code{defcustom} automatically
256@dfn{user option} (@pxref{Defining Variables}). 259marks @var{option} as a @dfn{user option} (@pxref{Defining
257 260Variables}).
258If @var{option} is void, @code{defcustom} initializes it to 261
259@var{default}. @var{default} should be an expression to compute the 262The argument @var{standard} is an expression that specifies the
260value; be careful in writing it, because it can be evaluated on more 263standard value for @var{option}. Evaluating the @code{defcustom} form
261than one occasion. You should normally avoid using backquotes in 264evaluates @var{standard}, but does not necessarily install the
262@var{default} because they are not expanded when editing the value, 265standard value. If @var{option} already has a default value,
263causing list values to appear to have the wrong structure. 266@code{defcustom} does not change it. If the user has saved a
267customization for @var{option}, @code{defcustom} installs the user's
268customized value as @var{option}'s default value. If neither of those
269cases applies, @code{defcustom} installs the result of evaluating
270@var{standard} as the default value.
271
272The expression @var{standard} can be evaluated at various other times,
273too---whenever the customization facility needs to know @var{option}'s
274standard value. So be sure to use an expression which is harmless to
275evaluate at any time. We recommend avoiding backquotes in
276@var{standard}, because they are not expanded when editing the value,
277so list values will appear to have the wrong structure.
264 278
265If you specify the @code{:set} option, to make the variable take other 279If you specify the @code{:set} option, to make the variable take other
266special actions when set through the customization buffer, the 280special actions when set through the customization buffer, the
@@ -403,7 +417,7 @@ type of @var{symbol}.
403@end defun 417@end defun
404 418
405Internally, @code{defcustom} uses the symbol property 419Internally, @code{defcustom} uses the symbol property
406@code{standard-value} to record the expression for the default value, 420@code{standard-value} to record the expression for the standard value,
407and @code{saved-value} to record the value saved by the user with the 421and @code{saved-value} to record the value saved by the user with the
408customization buffer. Both properties are actually lists whose car is 422customization buffer. Both properties are actually lists whose car is
409an expression which evaluates to the value. 423an expression which evaluates to the value.