Function: face-attr-match-p
face-attr-match-p is a byte-compiled function defined in faces.el.gz.
Signature
(face-attr-match-p FACE ATTRS &optional FRAME)
Documentation
Return t if attributes of FACE match values in plist ATTRS.
Optional parameter FRAME is the frame whose definition of FACE is used. If nil or omitted, use the selected frame.
Source Code
;; Defined in /usr/src/emacs/lisp/faces.el.gz
(defun face-attr-match-p (face attrs &optional frame)
"Return t if attributes of FACE match values in plist ATTRS.
Optional parameter FRAME is the frame whose definition of FACE
is used. If nil or omitted, use the selected frame."
(unless frame
(setq frame (selected-frame)))
(let* ((list face-attribute-name-alist)
(match t)
(bold (and (plist-member attrs :bold)
(not (plist-member attrs :weight))))
(italic (and (plist-member attrs :italic)
(not (plist-member attrs :slant))))
(plist (if (or bold italic)
(copy-sequence attrs)
attrs)))
;; Handle the Emacs 20 :bold and :italic properties.
(if bold
(plist-put plist :weight (if bold 'bold 'normal)))
(if italic
(plist-put plist :slant (if italic 'italic 'normal)))
(while (and match list)
(let* ((attr (caar list))
(specified-value
(if (plist-member plist attr)
(plist-get plist attr)
'unspecified))
(value-now (face-attribute face attr frame)))
(setq match (equal specified-value value-now))
(setq list (cdr list))))
match))