Function: custom-variable-type
custom-variable-type is a byte-compiled function defined in
cus-edit.el.gz.
Signature
(custom-variable-type SYMBOL)
Documentation
Return a widget suitable for editing the value of SYMBOL.
If SYMBOL has a custom-type property, use that.
Otherwise, try matching SYMBOL against custom-guess-name-alist and
try matching its doc string against custom-guess-doc-alist.
Source Code
;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun custom-variable-type (symbol)
"Return a widget suitable for editing the value of SYMBOL.
If SYMBOL has a `custom-type' property, use that.
Otherwise, try matching SYMBOL against `custom-guess-name-alist' and
try matching its doc string against `custom-guess-doc-alist'."
(let* ((type (or (get symbol 'custom-type)
(and (not (get symbol 'standard-value))
(custom-guess-type symbol))
'sexp))
(options (get symbol 'custom-options))
(tmp (if (listp type)
(copy-sequence type)
(list type))))
(when options
;; This used to use widget-put, but with strict plists that
;; fails when type is an even-length list, eg (repeat character).
;; Passing our result through widget-convert makes it a valid widget.
(setcdr tmp (append (list :options options) (cdr tmp))))
tmp))