Function: customize-set-value

customize-set-value is an autoloaded, interactive and byte-compiled function defined in cus-edit.el.gz.

Signature

(customize-set-value VARIABLE VALUE &optional COMMENT)

Documentation

Set VARIABLE to VALUE, and return VALUE. VALUE is a Lisp object.

If VARIABLE has a variable-interactive property, that is used as if it were the arg to interactive (which see) to interactively read the value.

If VARIABLE has a custom-type property, it must be a widget and the
:prompt-value property of that widget will be used for reading the value.

If given a prefix (or a COMMENT argument), also prompt for a comment.

Probably introduced at or before Emacs version 21.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
;;;###autoload
(defun customize-set-value (variable value &optional comment)
  "Set VARIABLE to VALUE, and return VALUE.  VALUE is a Lisp object.

If VARIABLE has a `variable-interactive' property, that is used as if
it were the arg to `interactive' (which see) to interactively read the value.

If VARIABLE has a `custom-type' property, it must be a widget and the
`:prompt-value' property of that widget will be used for reading the value.

If given a prefix (or a COMMENT argument), also prompt for a comment."
  (interactive (custom-prompt-variable "Set variable: "
				       "Set %s to value: "
				       current-prefix-arg))

  (cond ((string= comment "")
         (put variable 'variable-comment nil))
        (comment
         (put variable 'variable-comment comment)))
  (set variable value))