diff options
Diffstat (limited to 'lispref/customize.texi')
| -rw-r--r-- | lispref/customize.texi | 60 |
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}) |
| 135 | This option specifies that the item was first introduced in | 135 | This 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 |
| 137 | changed in that version. This keyword takes priority over :version. | 137 | value was changed in that version. The value of @var{package} is a |
| 138 | The value of @var{package} is a symbol and @var{version} is a string. | 138 | symbol and @var{version} is a string. |
| 139 | The @var{package} and @var{version} must appear in the alist | ||
| 140 | @code{customize-package-emacs-version-alist}. Since @var{package} must | ||
| 141 | be unique and the user might see it in an error message, a good choice | ||
| 142 | is the official name of the package, such as MH-E or Gnus. | ||
| 143 | 139 | ||
| 140 | This keyword takes priority over @code{:version}. | ||
| 141 | |||
| 142 | @var{package} should be the official name of the package, such as MH-E | ||
| 143 | or 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 | ||
| 146 | Packages that use the @code{:package-version} keyword must also update | 148 | Packages distributed as part of Emacs that use the |
| 147 | the @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 |
| 150 | This alist provides a mapping for the versions of Emacs that are | 153 | This 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{} |
| 252 | Declare @var{option} as a customizable user option variable. Do not | 255 | This construct declares @var{option} as a customizable user option |
| 253 | quote @var{option}. The argument @var{doc} specifies the documentation | 256 | variable. You should not quote @var{option}. The argument @var{doc} |
| 254 | 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 |
| 255 | because @code{defcustom} automatically marks @var{option} as a | 258 | to start it with a @samp{*}, because @code{defcustom} automatically |
| 256 | @dfn{user option} (@pxref{Defining Variables}). | 259 | marks @var{option} as a @dfn{user option} (@pxref{Defining |
| 257 | 260 | Variables}). | |
| 258 | If @var{option} is void, @code{defcustom} initializes it to | 261 | |
| 259 | @var{default}. @var{default} should be an expression to compute the | 262 | The argument @var{standard} is an expression that specifies the |
| 260 | value; be careful in writing it, because it can be evaluated on more | 263 | standard value for @var{option}. Evaluating the @code{defcustom} form |
| 261 | than one occasion. You should normally avoid using backquotes in | 264 | evaluates @var{standard}, but does not necessarily install the |
| 262 | @var{default} because they are not expanded when editing the value, | 265 | standard value. If @var{option} already has a default value, |
| 263 | 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. | ||
| 264 | 278 | ||
| 265 | 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 |
| 266 | special actions when set through the customization buffer, the | 280 | special actions when set through the customization buffer, the |
| @@ -403,7 +417,7 @@ type of @var{symbol}. | |||
| 403 | @end defun | 417 | @end defun |
| 404 | 418 | ||
| 405 | Internally, @code{defcustom} uses the symbol property | 419 | Internally, @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, |
| 407 | 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 |
| 408 | customization buffer. Both properties are actually lists whose car is | 422 | customization buffer. Both properties are actually lists whose car is |
| 409 | an expression which evaluates to the value. | 423 | an expression which evaluates to the value. |