diff options
| author | Eli Zaretskii | 2006-11-27 07:28:16 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2006-11-27 07:28:16 +0000 |
| commit | 83b9737975414e0b5afaa0299dea3035404372ac (patch) | |
| tree | a7fd18f4a497797fbc95b3b801c1fd9e21ec52b4 | |
| parent | 4041a5e6a55792abde761bea219b7df1899ac02f (diff) | |
| download | emacs-83b9737975414e0b5afaa0299dea3035404372ac.tar.gz emacs-83b9737975414e0b5afaa0299dea3035404372ac.zip | |
(Customization, Common Keywords)
(Group Definitions, Variable Definitions, Composite Types)
(Type Keywords, Customization Types): Add index entries for various
customization keywords.
| -rw-r--r-- | lispref/customize.texi | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lispref/customize.texi b/lispref/customize.texi index 9e10e547b56..d47c86308c8 100644 --- a/lispref/customize.texi +++ b/lispref/customize.texi | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | @node Customization, Loading, Macros, Top | 7 | @node Customization, Loading, Macros, Top |
| 8 | @chapter Writing Customization Definitions | 8 | @chapter Writing Customization Definitions |
| 9 | 9 | ||
| 10 | @cindex customization definitions | ||
| 10 | This chapter describes how to declare user options for customization, | 11 | This chapter describes how to declare user options for customization, |
| 11 | and also customization groups for classifying them. We use the term | 12 | and also customization groups for classifying them. We use the term |
| 12 | @dfn{customization item} to include both kinds of customization | 13 | @dfn{customization item} to include both kinds of customization |
| @@ -23,6 +24,7 @@ definitions---as well as face definitions (@pxref{Defining Faces}). | |||
| 23 | @node Common Keywords | 24 | @node Common Keywords |
| 24 | @section Common Item Keywords | 25 | @section Common Item Keywords |
| 25 | 26 | ||
| 27 | @cindex customization keywords | ||
| 26 | All kinds of customization declarations (for variables and groups, and | 28 | All kinds of customization declarations (for variables and groups, and |
| 27 | for faces) accept keyword arguments for specifying various information. | 29 | for faces) accept keyword arguments for specifying various information. |
| 28 | This section describes some keywords that apply to all kinds. | 30 | This section describes some keywords that apply to all kinds. |
| @@ -34,6 +36,7 @@ display one name. | |||
| 34 | 36 | ||
| 35 | @table @code | 37 | @table @code |
| 36 | @item :tag @var{label} | 38 | @item :tag @var{label} |
| 39 | @kindex tag@r{, customization keyword} | ||
| 37 | Use @var{label}, a string, instead of the item's name, to label the | 40 | Use @var{label}, a string, instead of the item's name, to label the |
| 38 | item in customization menus and buffers. @strong{Don't use a tag | 41 | item in customization menus and buffers. @strong{Don't use a tag |
| 39 | which is substantially different from the item's real name; that would | 42 | which is substantially different from the item's real name; that would |
| @@ -45,6 +48,7 @@ specify a dash where normally a hyphen would be converted to a space: | |||
| 45 | :tag "Cursor In Non-selected Windows" | 48 | :tag "Cursor In Non-selected Windows" |
| 46 | @end example | 49 | @end example |
| 47 | 50 | ||
| 51 | @kindex group@r{, customization keyword} | ||
| 48 | @item :group @var{group} | 52 | @item :group @var{group} |
| 49 | Put this customization item in group @var{group}. When you use | 53 | Put this customization item in group @var{group}. When you use |
| 50 | @code{:group} in a @code{defgroup}, it makes the new group a subgroup of | 54 | @code{:group} in a @code{defgroup}, it makes the new group a subgroup of |
| @@ -55,6 +59,7 @@ more than one group. Displaying any of those groups will show this | |||
| 55 | item. Please don't overdo this, since the result would be annoying. | 59 | item. Please don't overdo this, since the result would be annoying. |
| 56 | 60 | ||
| 57 | @item :link @var{link-data} | 61 | @item :link @var{link-data} |
| 62 | @kindex link@r{, customization keyword} | ||
| 58 | Include an external link after the documentation string for this item. | 63 | Include an external link after the documentation string for this item. |
| 59 | This is a sentence containing an active field which references some | 64 | This is a sentence containing an active field which references some |
| 60 | other documentation. | 65 | other documentation. |
| @@ -114,11 +119,13 @@ An item can have more than one external link; however, most items have | |||
| 114 | none at all. | 119 | none at all. |
| 115 | 120 | ||
| 116 | @item :load @var{file} | 121 | @item :load @var{file} |
| 122 | @kindex load@r{, customization keyword} | ||
| 117 | Load file @var{file} (a string) before displaying this customization | 123 | Load file @var{file} (a string) before displaying this customization |
| 118 | item. Loading is done with @code{load-library}, and only if the file is | 124 | item. Loading is done with @code{load-library}, and only if the file is |
| 119 | not already loaded. | 125 | not already loaded. |
| 120 | 126 | ||
| 121 | @item :require @var{feature} | 127 | @item :require @var{feature} |
| 128 | @kindex require@r{, customization keyword} | ||
| 122 | Execute @code{(require '@var{feature})} when your saved customizations | 129 | Execute @code{(require '@var{feature})} when your saved customizations |
| 123 | set the value of this item. @var{feature} should be a symbol. | 130 | set the value of this item. @var{feature} should be a symbol. |
| 124 | 131 | ||
| @@ -127,11 +134,13 @@ a feature such as a minor mode, and just setting the variable won't have | |||
| 127 | any effect unless the code which implements the mode is loaded. | 134 | any effect unless the code which implements the mode is loaded. |
| 128 | 135 | ||
| 129 | @item :version @var{version} | 136 | @item :version @var{version} |
| 137 | @kindex version@r{, customization keyword} | ||
| 130 | This option specifies that the item was first introduced in Emacs | 138 | This option specifies that the item was first introduced in Emacs |
| 131 | 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 |
| 132 | version. The value @var{version} must be a string. | 140 | version. The value @var{version} must be a string. |
| 133 | 141 | ||
| 134 | @item :package-version '(@var{package} . @var{version}) | 142 | @item :package-version '(@var{package} . @var{version}) |
| 143 | @kindex package-version@r{, customization keyword} | ||
| 135 | This option specifies that the item was first introduced in | 144 | This option specifies that the item was first introduced in |
| 136 | @var{package} version @var{version}, or that its meaning or default | 145 | @var{package} version @var{version}, or that its meaning or default |
| 137 | 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 |
| @@ -179,6 +188,7 @@ choice is the official name of the package, such as MH-E or Gnus. | |||
| 179 | @node Group Definitions | 188 | @node Group Definitions |
| 180 | @section Defining Custom Groups | 189 | @section Defining Custom Groups |
| 181 | 190 | ||
| 191 | @cindex custom groups, how to define | ||
| 182 | Each Emacs Lisp package should have one main customization group which | 192 | Each Emacs Lisp package should have one main customization group which |
| 183 | contains all the options, faces and other groups in the package. If the | 193 | contains all the options, faces and other groups in the package. If the |
| 184 | package has a small number of options and faces, use just one group and | 194 | package has a small number of options and faces, use just one group and |
| @@ -221,6 +231,7 @@ also use this keyword in @code{defgroup}: | |||
| 221 | 231 | ||
| 222 | @table @code | 232 | @table @code |
| 223 | @item :prefix @var{prefix} | 233 | @item :prefix @var{prefix} |
| 234 | @kindex prefix@r{, @code{defgroup} keyword} | ||
| 224 | If the name of an item in the group starts with @var{prefix}, then the | 235 | If the name of an item in the group starts with @var{prefix}, then the |
| 225 | tag for that item is constructed (by default) by omitting @var{prefix}. | 236 | tag for that item is constructed (by default) by omitting @var{prefix}. |
| 226 | 237 | ||
| @@ -249,6 +260,8 @@ turn this feature back on, if someone would like to do the work. | |||
| 249 | @node Variable Definitions | 260 | @node Variable Definitions |
| 250 | @section Defining Customization Variables | 261 | @section Defining Customization Variables |
| 251 | 262 | ||
| 263 | @cindex customization variables, how to define | ||
| 264 | @cindex declare user-editable variables | ||
| 252 | Use @code{defcustom} to declare user-editable variables. | 265 | Use @code{defcustom} to declare user-editable variables. |
| 253 | 266 | ||
| 254 | @defmac defcustom option standard doc [keyword value]@dots{} | 267 | @defmac defcustom option standard doc [keyword value]@dots{} |
| @@ -297,6 +310,7 @@ values are legitimate, and how to display the value. | |||
| 297 | @xref{Customization Types}, for more information. | 310 | @xref{Customization Types}, for more information. |
| 298 | 311 | ||
| 299 | @item :options @var{list} | 312 | @item :options @var{list} |
| 313 | @kindex options@r{, @code{defcustom} keyword} | ||
| 300 | Specify @var{list} as the list of reasonable values for use in this | 314 | Specify @var{list} as the list of reasonable values for use in this |
| 301 | option. The user is not restricted to using only these values, but they | 315 | option. The user is not restricted to using only these values, but they |
| 302 | are offered as convenient alternatives. | 316 | are offered as convenient alternatives. |
| @@ -306,6 +320,7 @@ This is meaningful only for certain types, currently including | |||
| 306 | individual types for a description of how to use @code{:options}. | 320 | individual types for a description of how to use @code{:options}. |
| 307 | 321 | ||
| 308 | @item :set @var{setfunction} | 322 | @item :set @var{setfunction} |
| 323 | @kindex set@r{, @code{defcustom} keyword} | ||
| 309 | Specify @var{setfunction} as the way to change the value of this | 324 | Specify @var{setfunction} as the way to change the value of this |
| 310 | option. The function @var{setfunction} should take two arguments, a | 325 | option. The function @var{setfunction} should take two arguments, a |
| 311 | symbol (the option name) and the new value, and should do whatever is | 326 | symbol (the option name) and the new value, and should do whatever is |
| @@ -314,6 +329,7 @@ mean simply setting the option as a Lisp variable). The default for | |||
| 314 | @var{setfunction} is @code{set-default}. | 329 | @var{setfunction} is @code{set-default}. |
| 315 | 330 | ||
| 316 | @item :get @var{getfunction} | 331 | @item :get @var{getfunction} |
| 332 | @kindex get@r{, @code{defcustom} keyword} | ||
| 317 | Specify @var{getfunction} as the way to extract the value of this | 333 | Specify @var{getfunction} as the way to extract the value of this |
| 318 | option. The function @var{getfunction} should take one argument, a | 334 | option. The function @var{getfunction} should take one argument, a |
| 319 | symbol, and should return whatever customize should use as the | 335 | symbol, and should return whatever customize should use as the |
| @@ -327,6 +343,7 @@ is almost surely a mistake to specify @code{getfunction} for a value | |||
| 327 | that really is stored in a Lisp variable. | 343 | that really is stored in a Lisp variable. |
| 328 | 344 | ||
| 329 | @item :initialize @var{function} | 345 | @item :initialize @var{function} |
| 346 | @kindex initialize@r{, @code{defcustom} keyword} | ||
| 330 | @var{function} should be a function used to initialize the variable | 347 | @var{function} should be a function used to initialize the variable |
| 331 | when the @code{defcustom} is evaluated. It should take two arguments, | 348 | when the @code{defcustom} is evaluated. It should take two arguments, |
| 332 | the option name (a symbol) and the value. Here are some predefined | 349 | the option name (a symbol) and the value. Here are some predefined |
| @@ -374,6 +391,7 @@ variables and functions will be defined, so there will not be an error. | |||
| 374 | @end table | 391 | @end table |
| 375 | 392 | ||
| 376 | @item :set-after @var{variables} | 393 | @item :set-after @var{variables} |
| 394 | @kindex set-after@r{, @code{defcustom} keyword} | ||
| 377 | When setting variables according to saved customizations, make sure to | 395 | When setting variables according to saved customizations, make sure to |
| 378 | set the variables @var{variables} before this one; in other words, delay | 396 | set the variables @var{variables} before this one; in other words, delay |
| 379 | setting this variable until after those others have been handled. Use | 397 | setting this variable until after those others have been handled. Use |
| @@ -425,11 +443,13 @@ an expression which evaluates to the value. | |||
| 425 | @node Customization Types | 443 | @node Customization Types |
| 426 | @section Customization Types | 444 | @section Customization Types |
| 427 | 445 | ||
| 446 | @cindex customization types | ||
| 428 | When you define a user option with @code{defcustom}, you must specify | 447 | When you define a user option with @code{defcustom}, you must specify |
| 429 | its @dfn{customization type}. That is a Lisp object which describes (1) | 448 | its @dfn{customization type}. That is a Lisp object which describes (1) |
| 430 | which values are legitimate and (2) how to display the value in the | 449 | which values are legitimate and (2) how to display the value in the |
| 431 | customization buffer for editing. | 450 | customization buffer for editing. |
| 432 | 451 | ||
| 452 | @kindex type@r{, @code{defcustom} keyword} | ||
| 433 | You specify the customization type in @code{defcustom} with the | 453 | You specify the customization type in @code{defcustom} with the |
| 434 | @code{:type} keyword. The argument of @code{:type} is evaluated, but | 454 | @code{:type} keyword. The argument of @code{:type} is evaluated, but |
| 435 | only once when the @code{defcustom} is executed, so it isn't useful | 455 | only once when the @code{defcustom} is executed, so it isn't useful |
| @@ -905,10 +925,12 @@ purposes. This is useful for a type that appears inside of a | |||
| 905 | @code{choice}. | 925 | @code{choice}. |
| 906 | 926 | ||
| 907 | @item :match-alternatives @var{criteria} | 927 | @item :match-alternatives @var{criteria} |
| 928 | @kindex match-alternatives@r{, customization keyword} | ||
| 908 | Use @var{criteria} to match possible values. This is used only in | 929 | Use @var{criteria} to match possible values. This is used only in |
| 909 | @code{restricted-sexp}. | 930 | @code{restricted-sexp}. |
| 910 | 931 | ||
| 911 | @item :args @var{argument-list} | 932 | @item :args @var{argument-list} |
| 933 | @kindex args@r{, customization keyword} | ||
| 912 | Use the elements of @var{argument-list} as the arguments of the type | 934 | Use the elements of @var{argument-list} as the arguments of the type |
| 913 | construct. For instance, @code{(const :args (foo))} is equivalent to | 935 | construct. For instance, @code{(const :args (foo))} is equivalent to |
| 914 | @code{(const foo)}. You rarely need to write @code{:args} explicitly, | 936 | @code{(const foo)}. You rarely need to write @code{:args} explicitly, |
| @@ -986,6 +1008,7 @@ If @code{nil} is not a valid value for the alternative, then it is | |||
| 986 | essential to specify a valid default with @code{:value}. | 1008 | essential to specify a valid default with @code{:value}. |
| 987 | 1009 | ||
| 988 | @item :format @var{format-string} | 1010 | @item :format @var{format-string} |
| 1011 | @kindex format@r{, customization keyword} | ||
| 989 | This string will be inserted in the buffer to represent the value | 1012 | This string will be inserted in the buffer to represent the value |
| 990 | corresponding to the type. The following @samp{%} escapes are available | 1013 | corresponding to the type. The following @samp{%} escapes are available |
| 991 | for use in @var{format-string}: | 1014 | for use in @var{format-string}: |
| @@ -1024,14 +1047,18 @@ Display a literal @samp{%}. | |||
| 1024 | @end table | 1047 | @end table |
| 1025 | 1048 | ||
| 1026 | @item :action @var{action} | 1049 | @item :action @var{action} |
| 1050 | @kindex action@r{, customization keyword} | ||
| 1027 | Perform @var{action} if the user clicks on a button. | 1051 | Perform @var{action} if the user clicks on a button. |
| 1028 | 1052 | ||
| 1029 | @item :button-face @var{face} | 1053 | @item :button-face @var{face} |
| 1054 | @kindex button-face@r{, customization keyword} | ||
| 1030 | Use the face @var{face} (a face name or a list of face names) for button | 1055 | Use the face @var{face} (a face name or a list of face names) for button |
| 1031 | text displayed with @samp{%[@dots{}%]}. | 1056 | text displayed with @samp{%[@dots{}%]}. |
| 1032 | 1057 | ||
| 1033 | @item :button-prefix @var{prefix} | 1058 | @item :button-prefix @var{prefix} |
| 1034 | @itemx :button-suffix @var{suffix} | 1059 | @itemx :button-suffix @var{suffix} |
| 1060 | @kindex button-prefix@r{, customization keyword} | ||
| 1061 | @kindex button-suffix@r{, customization keyword} | ||
| 1035 | These specify the text to display before and after a button. | 1062 | These specify the text to display before and after a button. |
| 1036 | Each can be: | 1063 | Each can be: |
| 1037 | 1064 | ||
| @@ -1051,6 +1078,7 @@ Use @var{tag} (a string) as the tag for the value (or part of the value) | |||
| 1051 | that corresponds to this type. | 1078 | that corresponds to this type. |
| 1052 | 1079 | ||
| 1053 | @item :doc @var{doc} | 1080 | @item :doc @var{doc} |
| 1081 | @kindex doc@r{, customization keyword} | ||
| 1054 | Use @var{doc} as the documentation string for this value (or part of the | 1082 | Use @var{doc} as the documentation string for this value (or part of the |
| 1055 | value) that corresponds to this type. In order for this to work, you | 1083 | value) that corresponds to this type. In order for this to work, you |
| 1056 | must specify a value for @code{:format}, and use @samp{%d} or @samp{%h} | 1084 | must specify a value for @code{:format}, and use @samp{%d} or @samp{%h} |
| @@ -1061,6 +1089,7 @@ provide more information about the meanings of alternatives inside a | |||
| 1061 | @code{:choice} type or the parts of some other composite type. | 1089 | @code{:choice} type or the parts of some other composite type. |
| 1062 | 1090 | ||
| 1063 | @item :help-echo @var{motion-doc} | 1091 | @item :help-echo @var{motion-doc} |
| 1092 | @kindex help-echo@r{, customization keyword} | ||
| 1064 | When you move to this item with @code{widget-forward} or | 1093 | When you move to this item with @code{widget-forward} or |
| 1065 | @code{widget-backward}, it will display the string @var{motion-doc} in | 1094 | @code{widget-backward}, it will display the string @var{motion-doc} in |
| 1066 | the echo area. In addition, @var{motion-doc} is used as the mouse | 1095 | the echo area. In addition, @var{motion-doc} is used as the mouse |
| @@ -1069,6 +1098,7 @@ to yield a help string. If it is a function, it is called with one | |||
| 1069 | argument, the widget. | 1098 | argument, the widget. |
| 1070 | 1099 | ||
| 1071 | @item :match @var{function} | 1100 | @item :match @var{function} |
| 1101 | @kindex match@r{, customization keyword} | ||
| 1072 | Specify how to decide whether a value matches the type. The | 1102 | Specify how to decide whether a value matches the type. The |
| 1073 | corresponding value, @var{function}, should be a function that accepts | 1103 | corresponding value, @var{function}, should be a function that accepts |
| 1074 | two arguments, a widget and a value; it should return non-@code{nil} if | 1104 | two arguments, a widget and a value; it should return non-@code{nil} if |