Function: custom-face-state

custom-face-state is a byte-compiled function defined in cus-edit.el.gz.

Signature

(custom-face-state FACE)

Documentation

Return the current state of the face FACE.

This is one of set, saved, changed, themed, or rogue.

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun custom-face-state (face)
  "Return the current state of the face FACE.
This is one of `set', `saved', `changed', `themed', or `rogue'."
  (let* ((comment (get face 'face-comment))
	 (state
	  (cond
	   ((or (get face 'customized-face)
		(get face 'customized-face-comment))
	    (if (equal (get face 'customized-face-comment) comment)
		'set
	      'changed))
	   ((or (get face 'saved-face)
		(get face 'saved-face-comment))
	    (cond ((not (equal (get face 'saved-face-comment) comment))
		   'changed)
		  ((eq 'user (caar (get face 'theme-face)))
		   'saved)
		  ((eq 'changed (caar (get face 'theme-face)))
		   'changed)
		  (t 'themed)))
	   ((get face 'face-defface-spec)
	    (cond (comment 'changed)
		  ((get face 'theme-face) 'themed)
		  (t 'standard)))
	   (t 'rogue))))
    ;; If the user called set-face-attribute to change the default for
    ;; new frames, this face is "set outside of Customize".
    (if (and (not (eq state 'rogue))
	     (get face 'face-modified))
	'changed
      state)))