Function: custom-theme-add-variable

custom-theme-add-variable is an interactive and byte-compiled function defined in cus-theme.el.gz.

Signature

(custom-theme-add-variable VAR VALUE)

Documentation

Add a widget for VAR (a symbol) to the *New Custom Theme* buffer.

VALUE should be a value to which to set the widget; when called interactively, this defaults to the current value of VAR.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/cus-theme.el.gz
;;; Theme variables

(defun custom-theme-add-variable (var value)
  "Add a widget for VAR (a symbol) to the *New Custom Theme* buffer.
VALUE should be a value to which to set the widget; when called
interactively, this defaults to the current value of VAR."
  (interactive
   (let ((v (read-variable "Variable name: ")))
     (list v (symbol-value v))))
  (let ((entry (assq var custom-theme-variables)))
    (cond ((null entry)
	   ;; If VAR is not yet in the buffer, add it.
	   (save-excursion
	     (goto-char custom-theme-insert-variable-marker)
	     (custom-theme-add-var-1 var value)
	     (move-marker custom-theme-insert-variable-marker (point))
	     (widget-setup)))
	  ;; Otherwise, alter that var widget.
	  (t
	   (widget-value-set (nth 1 entry) t)
	   (let ((widget (nth 2 entry)))
	     (widget-put widget :shown-value (list value))
	     (custom-redraw widget))))))