diff options
| author | Richard M. Stallman | 2006-08-16 05:10:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-08-16 05:10:55 +0000 |
| commit | 81b4d9abbf1448128159f3f25fa3fc4cd51a09b7 (patch) | |
| tree | c3e4e99674b16842d6d28fa328c01c21f804d23a | |
| parent | c0acb3ee4ce9a7255b060f2ec311ae6b3fda3ce9 (diff) | |
| download | emacs-81b4d9abbf1448128159f3f25fa3fc4cd51a09b7.tar.gz emacs-81b4d9abbf1448128159f3f25fa3fc4cd51a09b7.zip | |
(Variable Definitions): Explain when the
standard value expression is evaluated.
| -rw-r--r-- | lispref/customize.texi | 39 |
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{} |
| 255 | Declare @var{option} as a customizable user option variable. Do not | 255 | This construct declares @var{option} as a customizable user option |
| 256 | quote @var{option}. The argument @var{doc} specifies the documentation | 256 | variable. You should not quote @var{option}. The argument @var{doc} |
| 257 | string for the variable. There is no need to start it with a @samp{*} | 257 | specifies the documentation string for the variable. There is no need |
| 258 | because @code{defcustom} automatically marks @var{option} as a | 258 | to start it with a @samp{*}, because @code{defcustom} automatically |
| 259 | @dfn{user option} (@pxref{Defining Variables}). | 259 | marks @var{option} as a @dfn{user option} (@pxref{Defining |
| 260 | 260 | Variables}). | |
| 261 | If @var{option} is void, @code{defcustom} initializes it to | 261 | |
| 262 | @var{default}. @var{default} should be an expression to compute the | 262 | The argument @var{standard} is an expression that specifies the |
| 263 | value; be careful in writing it, because it can be evaluated on more | 263 | standard value for @var{option}. Evaluating the @code{defcustom} form |
| 264 | than one occasion. You should normally avoid using backquotes in | 264 | evaluates @var{standard}, but does not necessarily install the |
| 265 | @var{default} because they are not expanded when editing the value, | 265 | standard value. If @var{option} already has a default value, |
| 266 | causing list values to appear to have the wrong structure. | 266 | @code{defcustom} does not change it. If the user has saved a |
| 267 | customization for @var{option}, @code{defcustom} installs the user's | ||
| 268 | customized value as @var{option}'s default value. If neither of those | ||
| 269 | cases applies, @code{defcustom} installs the result of evaluating | ||
| 270 | @var{standard} as the default value. | ||
| 271 | |||
| 272 | The expression @var{standard} can be evaluated at various other times, | ||
| 273 | too---whenever the customization facility needs to know @var{option}'s | ||
| 274 | standard value. So be sure to use an expression which is harmless to | ||
| 275 | evaluate at any time. We recommend avoiding backquotes in | ||
| 276 | @var{standard}, because they are not expanded when editing the value, | ||
| 277 | so list values will appear to have the wrong structure. | ||
| 267 | 278 | ||
| 268 | If you specify the @code{:set} option, to make the variable take other | 279 | If you specify the @code{:set} option, to make the variable take other |
| 269 | special actions when set through the customization buffer, the | 280 | special actions when set through the customization buffer, the |
| @@ -406,7 +417,7 @@ type of @var{symbol}. | |||
| 406 | @end defun | 417 | @end defun |
| 407 | 418 | ||
| 408 | Internally, @code{defcustom} uses the symbol property | 419 | Internally, @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, |
| 410 | and @code{saved-value} to record the value saved by the user with the | 421 | and @code{saved-value} to record the value saved by the user with the |
| 411 | customization buffer. Both properties are actually lists whose car is | 422 | customization buffer. Both properties are actually lists whose car is |
| 412 | an expression which evaluates to the value. | 423 | an expression which evaluates to the value. |