Standard Info workflow
Here's how to get the info that you need:
<f1> i
to start Info.
g (elisp) RET
to select the Elisp node.
i defcustom RET
to search the index for defcustom
.
Immediately you'll see:
‘:type TYPE’
Use TYPE as the data type for this option. It specifies which
values are legitimate, and how to display the value (*note
Customization Types::).
and:
‘:set SETFUNCTION’
Specify SETFUNCTION as the way to change the value of this option
when using the Customize interface. The function SETFUNCTION
should take two arguments, a symbol (the option name) and the new
value, and should do whatever is necessary to update the value
properly for this option (which may not mean simply setting the
option as a Lisp variable); preferably, though, it should not
modify its value argument destructively. The default for
SETFUNCTION is ‘set-default’.
If you specify this keyword, the variable’s documentation string
should describe how to do the same job in hand-written Lisp code.
My shortcut for the above.
M-x counsel-info-lookup-symbol
defcustom
RET
will bring you to the same info page.
Sample code for :type
(defcustom avy-keys-alist nil
"Alist of avy-jump commands to `avy-keys' overriding the default `avy-keys'."
:type '(alist
:key-type (choice :tag "Command"
(const avy-goto-char)
(const avy-goto-char-2)
(const avy-isearch)
(const avy-goto-line)
(const avy-goto-subword-0)
(const avy-goto-subword-1)
(const avy-goto-word-0)
(const avy-goto-word-1)
(const avy-copy-line)
(const avy-copy-region)
(const avy-move-line))
:value-type (repeat :tag "Keys" character)))
Sample code for :set
(defcustom ediff-diff-options
(if (memq system-type '(ms-dos windows-nt)) "--binary" "")
"Options to pass to `ediff-diff-program'.
If Unix diff is used as `ediff-diff-program',
then a useful option is `-w', to ignore space.
Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be
toggled interactively using \\[ediff-toggle-ignore-case].
Do not remove the default options. If you need to change this variable, add new
options after the default ones.
This variable is not for customizing the look of the differences produced by
the command \\[ediff-show-diff-output]. Use the variable
`ediff-custom-diff-options' for that."
:set 'ediff-set-diff-options
:type 'string
:group 'ediff-diff)