Function: custom-theme-write-faces

custom-theme-write-faces is a byte-compiled function defined in cus-theme.el.gz.

Signature

(custom-theme-write-faces THEME FACES)

Documentation

Write a custom-theme-set-faces command for THEME.

It includes all faces in list FACES.

Source Code

;; Defined in /usr/src/emacs/lisp/cus-theme.el.gz
(defun custom-theme-write-faces (theme faces)
  "Write a `custom-theme-set-faces' command for THEME.
It includes all faces in list FACES."
  (when faces
    (let ((standard-output (current-buffer)))
      (princ "\n(custom-theme-set-faces\n")
      (princ " '")
      (princ theme)
      (princ "\n")
      (dolist (spec faces)
	;; Insert the face iff the checkbox widget is checked.
	(when (widget-get (nth 1 spec) :value)
	  (let* ((symbol (nth 0 spec))
		 (widget (nth 2 spec))
		 (value
		  (cond
		   ((car-safe (widget-get widget :children))
		    (custom-face-widget-to-spec widget))
		   ;; Child is null if the widget is closed (hidden).
		   ((widget-get widget :shown-value))
		   (t (custom-face-get-current-spec symbol)))))
	    (when value
	      (princ (if (bolp) " '(" "\n '("))
	      (prin1 symbol)
	      (princ " ")
	      (prin1 value)
	      (princ ")")))))
      (if (bolp) (princ " "))
      (princ ")")
      (when (/= (following-char) ?\n)
	(princ "\n")))))