Function: face-differs-from-default-p
face-differs-from-default-p is a byte-compiled function defined in
faces.el.gz.
Signature
(face-differs-from-default-p FACE &optional FRAME)
Documentation
Return non-nil if FACE displays differently from the default face.
If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). If FRAME is omitted or nil, use the selected frame.
Probably introduced at or before Emacs version 22.1.
Source Code
;; Defined in /usr/src/emacs/lisp/faces.el.gz
(defun face-differs-from-default-p (face &optional frame)
"Return non-nil if FACE displays differently from the default face.
If the optional argument FRAME is given, report on face FACE in that frame.
If FRAME is t, report on the defaults for face FACE (for new frames).
If FRAME is omitted or nil, use the selected frame."
(let ((attrs
;; The _value_ of :inherit teaches us nothing about how FACE
;; looks compared to the default face. Instead, we will ask
;; `face-attribute' to take inheritance into account when
;; examining other attributes.
(delq :inherit
;; A difference in extension past EOL only matters when
;; relevant attributes (such as :background) also
;; differ from the default; otherwise this difference
;; is a false positive.
(delq :extend (mapcar 'car face-attribute-name-alist))))
(differs nil))
(while (and attrs (not differs))
(let* ((attr (pop attrs))
(attr-val (face-attribute face attr frame t)))
(when (and
(not (eq attr-val 'unspecified))
(display-supports-face-attributes-p (list attr attr-val)
frame))
(setq differs attr))))
differs))