1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-25 10:47:00 +00:00

(face-spec-set-2): Don't pass invalid attributes to set-face-attribute.

This commit is contained in:
Chong Yidong 2008-10-17 17:14:31 +00:00
parent 74a3abf3c1
commit 4f77c25dfe

View File

@ -1556,7 +1556,14 @@ then the override spec."
(defun face-spec-set-2 (face frame spec)
"Set the face attributes of FACE on FRAME according to SPEC."
(apply 'set-face-attribute face frame (face-spec-choose spec frame)))
(let* ((spec (face-spec-choose spec frame))
attrs)
(while spec
(when (assq (car spec) face-x-resources)
(push (car spec) attrs)
(push (cadr spec) attrs))
(setq spec (cddr spec)))
(apply 'set-face-attribute face frame (nreverse attrs))))
(defun face-attr-match-p (face attrs &optional frame)
"Return t if attributes of FACE match values in plist ATTRS.