diff options
| author | Luc Teirlinck | 2005-07-14 01:07:23 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2005-07-14 01:07:23 +0000 |
| commit | d5b3141dac8211b99290cb25299c0e77673038d1 (patch) | |
| tree | bd4d328bcc8c5dd4ab9c7bcb6d8fd194e0c43444 | |
| parent | fd90b80c174c9736f0ebc0a1dcaa08ae2d7dae87 (diff) | |
| download | emacs-d5b3141dac8211b99290cb25299c0e77673038d1.tar.gz emacs-d5b3141dac8211b99290cb25299c0e77673038d1.zip | |
(Variable Definitions): Add `custom-initialize-safe-set' and
`custom-initialize-safe-default'.
`standard-value' is a list too.
(Defining New Types): Use @key{RET} instead of @key{ret}.
| -rw-r--r-- | lispref/customize.texi | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lispref/customize.texi b/lispref/customize.texi index baaceae47f0..8ee82f088a8 100644 --- a/lispref/customize.texi +++ b/lispref/customize.texi | |||
| @@ -12,7 +12,7 @@ and also customization groups for classifying them. We use the term | |||
| 12 | definitions---as well as face definitions (@pxref{Defining Faces}). | 12 | definitions---as well as face definitions (@pxref{Defining Faces}). |
| 13 | 13 | ||
| 14 | @menu | 14 | @menu |
| 15 | * Common Keywords:: Common keyword arguments for all kinds of | 15 | * Common Keywords:: Common keyword arguments for all kinds of |
| 16 | customization declarations. | 16 | customization declarations. |
| 17 | * Group Definitions:: Writing customization group definitions. | 17 | * Group Definitions:: Writing customization group definitions. |
| 18 | * Variable Definitions:: Declaring user options. | 18 | * Variable Definitions:: Declaring user options. |
| @@ -270,6 +270,22 @@ This is the default @code{:initialize} function. | |||
| 270 | Use the @code{:set} function to initialize the variable, if it is | 270 | Use the @code{:set} function to initialize the variable, if it is |
| 271 | already set or has been customized; otherwise, just use | 271 | already set or has been customized; otherwise, just use |
| 272 | @code{set-default}. | 272 | @code{set-default}. |
| 273 | |||
| 274 | @item custom-initialize-safe-set | ||
| 275 | @itemx custom-initialize-safe-default | ||
| 276 | These functions behave like @code{custom-initialize-set} | ||
| 277 | (@code{custom-initialize-default}, respectively), but catch errors. | ||
| 278 | If an error occurs during initialization, they set the variable to | ||
| 279 | @code{nil} using @code{set-default}, and throw no error. | ||
| 280 | |||
| 281 | These two functions are only meant for options defined in pre-loaded | ||
| 282 | files, where some variables or functions used to compute the option's | ||
| 283 | value may not yet be defined. The option normally gets updated in | ||
| 284 | @file{startup.el}, ignoring the previously computed value. Because of | ||
| 285 | this typical usage, the value which these two functions compute | ||
| 286 | normally only matters when, after startup, one unsets the option's | ||
| 287 | value and then reevaluates the defcustom. By that time, the necessary | ||
| 288 | variables and functions will be defined, so there will not be an error. | ||
| 273 | @end table | 289 | @end table |
| 274 | 290 | ||
| 275 | @item :set-after @var{variables} | 291 | @item :set-after @var{variables} |
| @@ -318,8 +334,8 @@ type of @var{symbol}. | |||
| 318 | Internally, @code{defcustom} uses the symbol property | 334 | Internally, @code{defcustom} uses the symbol property |
| 319 | @code{standard-value} to record the expression for the default value, | 335 | @code{standard-value} to record the expression for the default value, |
| 320 | and @code{saved-value} to record the value saved by the user with the | 336 | and @code{saved-value} to record the value saved by the user with the |
| 321 | customization buffer. The @code{saved-value} property is actually a | 337 | customization buffer. Both properties are actually lists whose car is |
| 322 | list whose car is an expression which evaluates to the value. | 338 | an expression which evaluates to the value. |
| 323 | 339 | ||
| 324 | @node Customization Types | 340 | @node Customization Types |
| 325 | @section Customization Types | 341 | @section Customization Types |
| @@ -1088,8 +1104,8 @@ widget. For the purpose of defining new customization types, the | |||
| 1088 | argument with the same syntax as the keyword argument to | 1104 | argument with the same syntax as the keyword argument to |
| 1089 | @code{defcustom} with the same name. The third argument is a | 1105 | @code{defcustom} with the same name. The third argument is a |
| 1090 | documentation string for the new widget. You will be able to see that | 1106 | documentation string for the new widget. You will be able to see that |
| 1091 | string with the @kbd{M-x widget-browse @key{ret} binary-tree-of-string | 1107 | string with the @kbd{M-x widget-browse @key{RET} binary-tree-of-string |
| 1092 | @key{ret}} command. | 1108 | @key{RET}} command. |
| 1093 | 1109 | ||
| 1094 | After these mandatory arguments follow the keyword arguments. The most | 1110 | After these mandatory arguments follow the keyword arguments. The most |
| 1095 | important is @code{:type}, which describes the data type we want to match | 1111 | important is @code{:type}, which describes the data type we want to match |