aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-11-27 07:28:16 +0000
committerEli Zaretskii2006-11-27 07:28:16 +0000
commit83b9737975414e0b5afaa0299dea3035404372ac (patch)
treea7fd18f4a497797fbc95b3b801c1fd9e21ec52b4
parent4041a5e6a55792abde761bea219b7df1899ac02f (diff)
downloademacs-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.texi30
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,
11and also customization groups for classifying them. We use the term 12and 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
27for faces) accept keyword arguments for specifying various information. 29for faces) accept keyword arguments for specifying various information.
28This section describes some keywords that apply to all kinds. 30This 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}
37Use @var{label}, a string, instead of the item's name, to label the 40Use @var{label}, a string, instead of the item's name, to label the
38item in customization menus and buffers. @strong{Don't use a tag 41item in customization menus and buffers. @strong{Don't use a tag
39which is substantially different from the item's real name; that would 42which 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}
49Put this customization item in group @var{group}. When you use 53Put 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
55item. Please don't overdo this, since the result would be annoying. 59item. 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}
58Include an external link after the documentation string for this item. 63Include an external link after the documentation string for this item.
59This is a sentence containing an active field which references some 64This is a sentence containing an active field which references some
60other documentation. 65other documentation.
@@ -114,11 +119,13 @@ An item can have more than one external link; however, most items have
114none at all. 119none at all.
115 120
116@item :load @var{file} 121@item :load @var{file}
122@kindex load@r{, customization keyword}
117Load file @var{file} (a string) before displaying this customization 123Load file @var{file} (a string) before displaying this customization
118item. Loading is done with @code{load-library}, and only if the file is 124item. Loading is done with @code{load-library}, and only if the file is
119not already loaded. 125not already loaded.
120 126
121@item :require @var{feature} 127@item :require @var{feature}
128@kindex require@r{, customization keyword}
122Execute @code{(require '@var{feature})} when your saved customizations 129Execute @code{(require '@var{feature})} when your saved customizations
123set the value of this item. @var{feature} should be a symbol. 130set 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
127any effect unless the code which implements the mode is loaded. 134any 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}
130This option specifies that the item was first introduced in Emacs 138This option specifies that the item was first introduced in Emacs
131version @var{version}, or that its default value was changed in that 139version @var{version}, or that its default value was changed in that
132version. The value @var{version} must be a string. 140version. 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}
135This option specifies that the item was first introduced in 144This 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
137value 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
@@ -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
183contains all the options, faces and other groups in the package. If the 193contains all the options, faces and other groups in the package. If the
184package has a small number of options and faces, use just one group and 194package 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}
224If the name of an item in the group starts with @var{prefix}, then the 235If the name of an item in the group starts with @var{prefix}, then the
225tag for that item is constructed (by default) by omitting @var{prefix}. 236tag 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}
300Specify @var{list} as the list of reasonable values for use in this 314Specify @var{list} as the list of reasonable values for use in this
301option. The user is not restricted to using only these values, but they 315option. The user is not restricted to using only these values, but they
302are offered as convenient alternatives. 316are offered as convenient alternatives.
@@ -306,6 +320,7 @@ This is meaningful only for certain types, currently including
306individual types for a description of how to use @code{:options}. 320individual 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}
309Specify @var{setfunction} as the way to change the value of this 324Specify @var{setfunction} as the way to change the value of this
310option. The function @var{setfunction} should take two arguments, a 325option. The function @var{setfunction} should take two arguments, a
311symbol (the option name) and the new value, and should do whatever is 326symbol (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}
317Specify @var{getfunction} as the way to extract the value of this 333Specify @var{getfunction} as the way to extract the value of this
318option. The function @var{getfunction} should take one argument, a 334option. The function @var{getfunction} should take one argument, a
319symbol, and should return whatever customize should use as the 335symbol, 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
327that really is stored in a Lisp variable. 343that 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
331when the @code{defcustom} is evaluated. It should take two arguments, 348when the @code{defcustom} is evaluated. It should take two arguments,
332the option name (a symbol) and the value. Here are some predefined 349the 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}
377When setting variables according to saved customizations, make sure to 395When setting variables according to saved customizations, make sure to
378set the variables @var{variables} before this one; in other words, delay 396set the variables @var{variables} before this one; in other words, delay
379setting this variable until after those others have been handled. Use 397setting 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
429its @dfn{customization type}. That is a Lisp object which describes (1) 448its @dfn{customization type}. That is a Lisp object which describes (1)
430which values are legitimate and (2) how to display the value in the 449which values are legitimate and (2) how to display the value in the
431customization buffer for editing. 450customization 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
435only once when the @code{defcustom} is executed, so it isn't useful 455only 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}
908Use @var{criteria} to match possible values. This is used only in 929Use @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}
912Use the elements of @var{argument-list} as the arguments of the type 934Use the elements of @var{argument-list} as the arguments of the type
913construct. For instance, @code{(const :args (foo))} is equivalent to 935construct. 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
986essential to specify a valid default with @code{:value}. 1008essential 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}
989This string will be inserted in the buffer to represent the value 1012This string will be inserted in the buffer to represent the value
990corresponding to the type. The following @samp{%} escapes are available 1013corresponding to the type. The following @samp{%} escapes are available
991for use in @var{format-string}: 1014for 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}
1027Perform @var{action} if the user clicks on a button. 1051Perform @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}
1030Use the face @var{face} (a face name or a list of face names) for button 1055Use the face @var{face} (a face name or a list of face names) for button
1031text displayed with @samp{%[@dots{}%]}. 1056text 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}
1035These specify the text to display before and after a button. 1062These specify the text to display before and after a button.
1036Each can be: 1063Each can be:
1037 1064
@@ -1051,6 +1078,7 @@ Use @var{tag} (a string) as the tag for the value (or part of the value)
1051that corresponds to this type. 1078that corresponds to this type.
1052 1079
1053@item :doc @var{doc} 1080@item :doc @var{doc}
1081@kindex doc@r{, customization keyword}
1054Use @var{doc} as the documentation string for this value (or part of the 1082Use @var{doc} as the documentation string for this value (or part of the
1055value) that corresponds to this type. In order for this to work, you 1083value) that corresponds to this type. In order for this to work, you
1056must specify a value for @code{:format}, and use @samp{%d} or @samp{%h} 1084must 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}
1064When you move to this item with @code{widget-forward} or 1093When 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
1066the echo area. In addition, @var{motion-doc} is used as the mouse 1095the 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
1069argument, the widget. 1098argument, the widget.
1070 1099
1071@item :match @var{function} 1100@item :match @var{function}
1101@kindex match@r{, customization keyword}
1072Specify how to decide whether a value matches the type. The 1102Specify how to decide whether a value matches the type. The
1073corresponding value, @var{function}, should be a function that accepts 1103corresponding value, @var{function}, should be a function that accepts
1074two arguments, a widget and a value; it should return non-@code{nil} if 1104two arguments, a widget and a value; it should return non-@code{nil} if