Improve documentation of 'defcustom's :set keyword
* lisp/custom.el (defcustom): * doc/lispref/customize.texi (Variable Definitions): Improve the documentation of the :set keyword in 'defcustom'.
This commit is contained in:
parent
ab4273056e
commit
9b32bc134c
2 changed files with 11 additions and 2 deletions
|
@ -378,8 +378,15 @@ the option as a Lisp variable); preferably, though, it should not
|
||||||
modify its value argument destructively. The default for
|
modify its value argument destructively. The default for
|
||||||
@var{setfunction} is @code{set-default-toplevel-value}.
|
@var{setfunction} is @code{set-default-toplevel-value}.
|
||||||
|
|
||||||
|
If defined, @var{setfunction} will also be called when evaluating a
|
||||||
|
@code{defcustom} form with @kbd{C-M-x} in Emacs Lisp mode and when the
|
||||||
|
@var{option}'s value is changed via the @code{setopt} macro
|
||||||
|
(@pxref{Setting Variables, setopt}).
|
||||||
|
|
||||||
If you specify this keyword, the variable's documentation string
|
If you specify this keyword, the variable's documentation string
|
||||||
should describe how to do the same job in hand-written Lisp code.
|
should describe how to do the same job in hand-written Lisp code,
|
||||||
|
either by invoking @var{setfunction} directly or by using
|
||||||
|
@code{setopt}.
|
||||||
|
|
||||||
@item :get @var{getfunction}
|
@item :get @var{getfunction}
|
||||||
@kindex get@r{, @code{defcustom} keyword}
|
@kindex get@r{, @code{defcustom} keyword}
|
||||||
|
|
|
@ -280,7 +280,9 @@ The following keywords are meaningful:
|
||||||
when using the Customize user interface. It takes two arguments,
|
when using the Customize user interface. It takes two arguments,
|
||||||
the symbol to set and the value to give it. The function should
|
the symbol to set and the value to give it. The function should
|
||||||
not modify its value argument destructively. The default choice
|
not modify its value argument destructively. The default choice
|
||||||
of function is `set-default-toplevel-value'.
|
of function is `set-default-toplevel-value'. If this keyword is
|
||||||
|
defined, modifying the value of SYMBOL via `setopt' will call the
|
||||||
|
function specified by VALUE to install the new value.
|
||||||
:get VALUE should be a function to extract the value of symbol.
|
:get VALUE should be a function to extract the value of symbol.
|
||||||
The function takes one argument, a symbol, and should return
|
The function takes one argument, a symbol, and should return
|
||||||
the current value for that symbol. The default choice of function
|
the current value for that symbol. The default choice of function
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue