diff options
| author | Richard M. Stallman | 2006-12-17 22:20:40 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-12-17 22:20:40 +0000 |
| commit | e1f2af9cacadedeb51e3dff4e0154c5618602333 (patch) | |
| tree | 5081efcdd745b2e1cf02334ccd4b2cb5b736af87 | |
| parent | 99c8496ec52d9bf28681fa0b4033460e7b6f7d1a (diff) | |
| download | emacs-e1f2af9cacadedeb51e3dff4e0154c5618602333.tar.gz emacs-e1f2af9cacadedeb51e3dff4e0154c5618602333.zip | |
Use "option" only for user options.
For the keyword values inside defcustom etc, say "keywords".
For :options value's elements, say "elements".
:group should not be omitted.
| -rw-r--r-- | lispref/customize.texi | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/lispref/customize.texi b/lispref/customize.texi index d47c86308c8..6d93d6fdb9b 100644 --- a/lispref/customize.texi +++ b/lispref/customize.texi | |||
| @@ -135,13 +135,13 @@ any effect unless the code which implements the mode is loaded. | |||
| 135 | 135 | ||
| 136 | @item :version @var{version} | 136 | @item :version @var{version} |
| 137 | @kindex version@r{, customization keyword} | 137 | @kindex version@r{, customization keyword} |
| 138 | This option specifies that the item was first introduced in Emacs | 138 | This keyword specifies that the item was first introduced in Emacs |
| 139 | version @var{version}, or that its default value was changed in that | 139 | version @var{version}, or that its default value was changed in that |
| 140 | version. The value @var{version} must be a string. | 140 | version. The value @var{version} must be a string. |
| 141 | 141 | ||
| 142 | @item :package-version '(@var{package} . @var{version}) | 142 | @item :package-version '(@var{package} . @var{version}) |
| 143 | @kindex package-version@r{, customization keyword} | 143 | @kindex package-version@r{, customization keyword} |
| 144 | This option specifies that the item was first introduced in | 144 | This keyword specifies that the item was first introduced in |
| 145 | @var{package} version @var{version}, or that its meaning or default | 145 | @var{package} version @var{version}, or that its meaning or default |
| 146 | value was changed in that version. The value of @var{package} is a | 146 | value was changed in that version. The value of @var{package} is a |
| 147 | symbol and @var{version} is a string. | 147 | symbol and @var{version} is a string. |
| @@ -289,7 +289,9 @@ evaluate at any time. We recommend avoiding backquotes in | |||
| 289 | @var{standard}, because they are not expanded when editing the value, | 289 | @var{standard}, because they are not expanded when editing the value, |
| 290 | so list values will appear to have the wrong structure. | 290 | so list values will appear to have the wrong structure. |
| 291 | 291 | ||
| 292 | If you specify the @code{:set} option, to make the variable take other | 292 | Every @code{defcustom} should specify @code{:group} at least once. |
| 293 | |||
| 294 | If you specify the @code{:set} keyword, to make the variable take other | ||
| 293 | special actions when set through the customization buffer, the | 295 | special actions when set through the customization buffer, the |
| 294 | variable's documentation string should tell the user specifically how | 296 | variable's documentation string should tell the user specifically how |
| 295 | to do the same job in hand-written Lisp code. | 297 | to do the same job in hand-written Lisp code. |
| @@ -309,9 +311,9 @@ Use @var{type} as the data type for this option. It specifies which | |||
| 309 | values are legitimate, and how to display the value. | 311 | values are legitimate, and how to display the value. |
| 310 | @xref{Customization Types}, for more information. | 312 | @xref{Customization Types}, for more information. |
| 311 | 313 | ||
| 312 | @item :options @var{list} | 314 | @item :options @var{value-list} |
| 313 | @kindex options@r{, @code{defcustom} keyword} | 315 | @kindex options@r{, @code{defcustom} keyword} |
| 314 | Specify @var{list} as the list of reasonable values for use in this | 316 | Specify the list of reasonable values for use in this |
| 315 | option. The user is not restricted to using only these values, but they | 317 | option. The user is not restricted to using only these values, but they |
| 316 | are offered as convenient alternatives. | 318 | are offered as convenient alternatives. |
| 317 | 319 | ||
| @@ -399,7 +401,7 @@ setting this variable until after those others have been handled. Use | |||
| 399 | those other variables already have their intended values. | 401 | those other variables already have their intended values. |
| 400 | @end table | 402 | @end table |
| 401 | 403 | ||
| 402 | The @code{:require} option is useful for an option that turns on the | 404 | The @code{:require} keyword is useful for an option that turns on the |
| 403 | operation of a certain feature. Assuming that the package is coded to | 405 | operation of a certain feature. Assuming that the package is coded to |
| 404 | check the value of the option, you still need to arrange for the package | 406 | check the value of the option, you still need to arrange for the package |
| 405 | to be loaded. You can do that with @code{:require}. @xref{Common | 407 | to be loaded. You can do that with @code{:require}. @xref{Common |
| @@ -413,25 +415,26 @@ Keywords}. Here is an example, from the library @file{saveplace.el}: | |||
| 413 | :group 'save-place) | 415 | :group 'save-place) |
| 414 | @end example | 416 | @end example |
| 415 | 417 | ||
| 416 | If a customization item has a type such as @code{hook} or @code{alist}, | 418 | If a customization item has a type such as @code{hook} or |
| 417 | which supports @code{:options}, you can add additional options to the | 419 | @code{alist}, which supports @code{:options}, you can add additional |
| 418 | item, outside the @code{defcustom} declaration, by calling | 420 | values to the list from outside the @code{defcustom} declaration by |
| 419 | @code{custom-add-option}. For example, if you define a function | 421 | calling @code{custom-add-option}. For example, if you define a |
| 420 | @code{my-lisp-mode-initialization} intended to be called from | 422 | function @code{my-lisp-mode-initialization} intended to be called from |
| 421 | @code{emacs-lisp-mode-hook}, you might want to add that to the list of | 423 | @code{emacs-lisp-mode-hook}, you might want to add that to the list of |
| 422 | options for @code{emacs-lisp-mode-hook}, but not by editing its | 424 | reasonable values for @code{emacs-lisp-mode-hook}, but not by editing |
| 423 | definition. You can do it thus: | 425 | its definition. You can do it thus: |
| 424 | 426 | ||
| 425 | @example | 427 | @example |
| 426 | (custom-add-option 'emacs-lisp-mode-hook | 428 | (custom-add-option 'emacs-lisp-mode-hook |
| 427 | 'my-lisp-mode-initialization) | 429 | 'my-lisp-mode-initialization) |
| 428 | @end example | 430 | @end example |
| 429 | 431 | ||
| 430 | @defun custom-add-option symbol option | 432 | @defun custom-add-option symbol value |
| 431 | To the customization @var{symbol}, add @var{option}. | 433 | For the customization option @var{symbol}, add @var{value} to the |
| 434 | list of reasonable values. | ||
| 432 | 435 | ||
| 433 | The precise effect of adding @var{option} depends on the customization | 436 | The precise effect of adding a value depends on the customization type |
| 434 | type of @var{symbol}. | 437 | of @var{symbol}. |
| 435 | @end defun | 438 | @end defun |
| 436 | 439 | ||
| 437 | Internally, @code{defcustom} uses the symbol property | 440 | Internally, @code{defcustom} uses the symbol property |
| @@ -567,9 +570,9 @@ value), with a checkbox to include or exclude or disable the key/value | |||
| 567 | pair from the alist. The user will not be able to edit the keys | 570 | pair from the alist. The user will not be able to edit the keys |
| 568 | specified by the @code{:options} keyword argument. | 571 | specified by the @code{:options} keyword argument. |
| 569 | 572 | ||
| 570 | The argument to the @code{:options} keywords should be a list of option | 573 | The argument to the @code{:options} keywords should be a list of |
| 571 | specifications. Ordinarily, the options are simply atoms, which are the | 574 | specifications for reasonable keys in the alist. Ordinarily, they are |
| 572 | specified keys. For example: | 575 | simply atoms, which stand for themselves as. For example: |
| 573 | 576 | ||
| 574 | @smallexample | 577 | @smallexample |
| 575 | :options '("foo" "bar" "baz") | 578 | :options '("foo" "bar" "baz") |
| @@ -579,11 +582,11 @@ specified keys. For example: | |||
| 579 | specifies that there are three ``known'' keys, namely @code{"foo"}, | 582 | specifies that there are three ``known'' keys, namely @code{"foo"}, |
| 580 | @code{"bar"} and @code{"baz"}, which will always be shown first. | 583 | @code{"bar"} and @code{"baz"}, which will always be shown first. |
| 581 | 584 | ||
| 582 | You may want to restrict the value type for specific keys, for example, | 585 | You may want to restrict the value type for specific keys, for |
| 583 | the value associated with the @code{"bar"} key can only be an integer. | 586 | example, the value associated with the @code{"bar"} key can only be an |
| 584 | You can specify this by using a list instead of an atom in the option | 587 | integer. You can specify this by using a list instead of an atom in |
| 585 | specification. The first element will specify the key, like before, | 588 | the list. The first element will specify the key, like before, while |
| 586 | while the second element will specify the value type. | 589 | the second element will specify the value type. For example: |
| 587 | 590 | ||
| 588 | @smallexample | 591 | @smallexample |
| 589 | :options '("foo" ("bar" integer) "baz") | 592 | :options '("foo" ("bar" integer) "baz") |