aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-12-17 22:20:40 +0000
committerRichard M. Stallman2006-12-17 22:20:40 +0000
commite1f2af9cacadedeb51e3dff4e0154c5618602333 (patch)
tree5081efcdd745b2e1cf02334ccd4b2cb5b736af87
parent99c8496ec52d9bf28681fa0b4033460e7b6f7d1a (diff)
downloademacs-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.texi53
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}
138This option specifies that the item was first introduced in Emacs 138This keyword specifies that the item was first introduced in Emacs
139version @var{version}, or that its default value was changed in that 139version @var{version}, or that its default value was changed in that
140version. The value @var{version} must be a string. 140version. 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}
144This option specifies that the item was first introduced in 144This 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
146value was changed in that version. The value of @var{package} is a 146value was changed in that version. The value of @var{package} is a
147symbol and @var{version} is a string. 147symbol 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,
290so list values will appear to have the wrong structure. 290so list values will appear to have the wrong structure.
291 291
292If you specify the @code{:set} option, to make the variable take other 292Every @code{defcustom} should specify @code{:group} at least once.
293
294If you specify the @code{:set} keyword, to make the variable take other
293special actions when set through the customization buffer, the 295special actions when set through the customization buffer, the
294variable's documentation string should tell the user specifically how 296variable's documentation string should tell the user specifically how
295to do the same job in hand-written Lisp code. 297to 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
309values are legitimate, and how to display the value. 311values 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}
314Specify @var{list} as the list of reasonable values for use in this 316Specify the list of reasonable values for use in this
315option. The user is not restricted to using only these values, but they 317option. The user is not restricted to using only these values, but they
316are offered as convenient alternatives. 318are offered as convenient alternatives.
317 319
@@ -399,7 +401,7 @@ setting this variable until after those others have been handled. Use
399those other variables already have their intended values. 401those 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
403operation of a certain feature. Assuming that the package is coded to 405operation of a certain feature. Assuming that the package is coded to
404check the value of the option, you still need to arrange for the package 406check the value of the option, you still need to arrange for the package
405to be loaded. You can do that with @code{:require}. @xref{Common 407to 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
416If a customization item has a type such as @code{hook} or @code{alist}, 418If a customization item has a type such as @code{hook} or
417which supports @code{:options}, you can add additional options to the 419@code{alist}, which supports @code{:options}, you can add additional
418item, outside the @code{defcustom} declaration, by calling 420values to the list from outside the @code{defcustom} declaration by
419@code{custom-add-option}. For example, if you define a function 421calling @code{custom-add-option}. For example, if you define a
420@code{my-lisp-mode-initialization} intended to be called from 422function @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
422options for @code{emacs-lisp-mode-hook}, but not by editing its 424reasonable values for @code{emacs-lisp-mode-hook}, but not by editing
423definition. You can do it thus: 425its 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
431To the customization @var{symbol}, add @var{option}. 433For the customization option @var{symbol}, add @var{value} to the
434list of reasonable values.
432 435
433The precise effect of adding @var{option} depends on the customization 436The precise effect of adding a value depends on the customization type
434type of @var{symbol}. 437of @var{symbol}.
435@end defun 438@end defun
436 439
437Internally, @code{defcustom} uses the symbol property 440Internally, @code{defcustom} uses the symbol property
@@ -567,9 +570,9 @@ value), with a checkbox to include or exclude or disable the key/value
567pair from the alist. The user will not be able to edit the keys 570pair from the alist. The user will not be able to edit the keys
568specified by the @code{:options} keyword argument. 571specified by the @code{:options} keyword argument.
569 572
570The argument to the @code{:options} keywords should be a list of option 573The argument to the @code{:options} keywords should be a list of
571specifications. Ordinarily, the options are simply atoms, which are the 574specifications for reasonable keys in the alist. Ordinarily, they are
572specified keys. For example: 575simply 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:
579specifies that there are three ``known'' keys, namely @code{"foo"}, 582specifies 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
582You may want to restrict the value type for specific keys, for example, 585You may want to restrict the value type for specific keys, for
583the value associated with the @code{"bar"} key can only be an integer. 586example, the value associated with the @code{"bar"} key can only be an
584You can specify this by using a list instead of an atom in the option 587integer. You can specify this by using a list instead of an atom in
585specification. The first element will specify the key, like before, 588the list. The first element will specify the key, like before, while
586while the second element will specify the value type. 589the 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")