aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-08-16 05:10:55 +0000
committerRichard M. Stallman2006-08-16 05:10:55 +0000
commit81b4d9abbf1448128159f3f25fa3fc4cd51a09b7 (patch)
treec3e4e99674b16842d6d28fa328c01c21f804d23a
parentc0acb3ee4ce9a7255b060f2ec311ae6b3fda3ce9 (diff)
downloademacs-81b4d9abbf1448128159f3f25fa3fc4cd51a09b7.tar.gz
emacs-81b4d9abbf1448128159f3f25fa3fc4cd51a09b7.zip
(Variable Definitions): Explain when the
standard value expression is evaluated.
-rw-r--r--lispref/customize.texi39
1 files changed, 25 insertions, 14 deletions
diff --git a/lispref/customize.texi b/lispref/customize.texi
index e3e78c46bb4..9e10e547b56 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -251,19 +251,30 @@ turn this feature back on, if someone would like to do the work.
251 251
252 Use @code{defcustom} to declare user-editable variables. 252 Use @code{defcustom} to declare user-editable variables.
253 253
254@defmac defcustom option default doc [keyword value]@dots{} 254@defmac defcustom option standard doc [keyword value]@dots{}
255Declare @var{option} as a customizable user option variable. Do not 255This construct declares @var{option} as a customizable user option
256quote @var{option}. The argument @var{doc} specifies the documentation 256variable. You should not quote @var{option}. The argument @var{doc}
257string for the variable. There is no need to start it with a @samp{*} 257specifies the documentation string for the variable. There is no need
258because @code{defcustom} automatically marks @var{option} as a 258to start it with a @samp{*}, because @code{defcustom} automatically
259@dfn{user option} (@pxref{Defining Variables}). 259marks @var{option} as a @dfn{user option} (@pxref{Defining
260 260Variables}).
261If @var{option} is void, @code{defcustom} initializes it to 261
262@var{default}. @var{default} should be an expression to compute the 262The argument @var{standard} is an expression that specifies the
263value; be careful in writing it, because it can be evaluated on more 263standard value for @var{option}. Evaluating the @code{defcustom} form
264than one occasion. You should normally avoid using backquotes in 264evaluates @var{standard}, but does not necessarily install the
265@var{default} because they are not expanded when editing the value, 265standard value. If @var{option} already has a default value,
266causing 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.
267 278
268If 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
269special actions when set through the customization buffer, the 280special actions when set through the customization buffer, the
@@ -406,7 +417,7 @@ type of @var{symbol}.
406@end defun 417@end defun
407 418
408Internally, @code{defcustom} uses the symbol property 419Internally, @code{defcustom} uses the symbol property
409@code{standard-value} to record the expression for the default value, 420@code{standard-value} to record the expression for the standard value,
410and @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
411customization buffer. Both properties are actually lists whose car is 422customization buffer. Both properties are actually lists whose car is
412an expression which evaluates to the value. 423an expression which evaluates to the value.