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:
:type- value should be a widget type.
:options- value should be a list of possible members of the specified type. For hooks, this is a list of function names.
:initialize- value should be a function used to initialize the variable. It takes two arguments, the symbol and value given in the
defcustomcall. Some predefined functions are:
custom-initialize-set- Use the
:setmethod to initialize the variable. Do not initialize it if already bound. This is the default:initializemethod.custom-initialize-default- Always use
set-defaultto initialize the variable, even if a:setmethod has been specified.custom-initialize-reset- If the variable is already bound, reset it by calling the
:setmethod with the value returned by the:getmethod.custom-initialize-changed- Like
custom-initialize-reset, but useset-defaultto initialize the variable if it is not bound and has not been set already.:set- value 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.:get- value 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.:require- value 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, for information about widgets to use together with the
:typekeyword.
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.