From 8a6f24e5f283563fc25a8bc088d314034699f286 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 7 Feb 2011 20:10:15 -0800 Subject: faces.el fix for bug#7966. * lisp/faces.el (face-attr-match-p): Handle the obsolete :bold and :italic props, so that frame-set-background-mode works. (Otherwise such faces were always thought to be locally modified.) --- lisp/faces.el | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'lisp/faces.el') diff --git a/lisp/faces.el b/lisp/faces.el index 4a4acefa04..cc1847a216 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1605,13 +1605,25 @@ 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)) + (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 (not (null list))) (let* ((attr (car (car list))) (specified-value - (if (plist-member attrs attr) - (plist-get attrs attr) + (if (plist-member plist attr) + (plist-get plist attr) 'unspecified)) (value-now (face-attribute face attr frame))) (setq match (equal specified-value value-now)) -- cgit v1.2.3