Next: Declaring Faces, Previous: Declaring Groups, Up: Top [Contents]
Use defcustom to declare user editable variables.
Declare symbol as a customizable variable that defaults to value. Neither symbol nor value needs to be quoted. If symbol is not already bound, initialize it to value.
doc is the variable documentation.
The following additional keyword’s are defined:
:typevalue should be a widget type.
:optionsvalue should be a list of possible members of the specified type. For hooks, this is a list of function names.
:initializevalue should be a function used to initialize the variable.  It
takes two arguments, the symbol and value given in the defcustom call.
Some predefined functions are:
custom-initialize-setUse the :set method to initialize the variable.  Do not
initialize it if already bound.  This is the default :initialize
method.
custom-initialize-defaultAlways use set-default to initialize the variable, even if a
:set method has been specified.
custom-initialize-resetIf the variable is already bound, reset it by calling the :set
method with the value returned by the :get method.
custom-initialize-changedLike custom-initialize-reset, but use set-default to
initialize the variable if it is not bound and has not been set
already.
:setvalue should be a function to set the value of the symbol.  It
takes two arguments, the symbol to set and the value to give it.  The
default is set-default.
:getvalue should be a function to extract the value of symbol.  The
function takes one argument, a symbol, and should return the current
value for that symbol.  The default is default-value.
:requirevalue should be a feature symbol. Each feature will be required when the ‘defcustom’ is evaluated, or when Emacs is started if the user has saved this option.
See Sexp Types in The Widget Library, for information about
widgets to use together with the :type keyword.
Internally, custom uses the symbol property custom-type to keep
track of the variables type, standard-value for the program
specified default value, saved-value for a value saved by the
user, and variable-documentation for the documentation string.
Use custom-add-option to specify that a specific function is
useful as an member of a hook.
To the variable symbol add option.
If symbol is a hook variable, option should be a hook member. For other types variables, the effect is undefined."
Next: Declaring Faces, Previous: Declaring Groups, Up: Top [Contents]