aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-02-07 20:10:15 -0800
committerGlenn Morris2011-02-07 20:10:15 -0800
commit8a6f24e5f283563fc25a8bc088d314034699f286 (patch)
treebe2f810e214c35de4e80a5a9c466c264fd4f942c
parent3caced0bc3b0db2265e053812aba317673bd7c95 (diff)
downloademacs-8a6f24e5f283563fc25a8bc088d314034699f286.tar.gz
emacs-8a6f24e5f283563fc25a8bc088d314034699f286.zip
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.)
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/faces.el20
2 files changed, 21 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5d8de616108..8f6f2ee821b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-02-08 Glenn Morris <rgm@gnu.org>
2
3 * faces.el (face-attr-match-p): Handle the obsolete :bold and
4 :italic props, so that frame-set-background-mode works. (Bug#7966)
5
12011-02-07 Glenn Morris <rgm@gnu.org> 62011-02-07 Glenn Morris <rgm@gnu.org>
2 7
3 * simple.el (next-error): Doc fix. 8 * simple.el (next-error): Doc fix.
diff --git a/lisp/faces.el b/lisp/faces.el
index 4a4acefa04c..cc1847a2164 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1605,13 +1605,25 @@ Optional parameter FRAME is the frame whose definition of FACE
1605is used. If nil or omitted, use the selected frame." 1605is used. If nil or omitted, use the selected frame."
1606 (unless frame 1606 (unless frame
1607 (setq frame (selected-frame))) 1607 (setq frame (selected-frame)))
1608 (let ((list face-attribute-name-alist) 1608 (let* ((list face-attribute-name-alist)
1609 (match t)) 1609 (match t)
1610 (bold (and (plist-member attrs :bold)
1611 (not (plist-member attrs :weight))))
1612 (italic (and (plist-member attrs :italic)
1613 (not (plist-member attrs :slant))))
1614 (plist (if (or bold italic)
1615 (copy-sequence attrs)
1616 attrs)))
1617 ;; Handle the Emacs 20 :bold and :italic properties.
1618 (if bold
1619 (plist-put plist :weight (if bold 'bold 'normal)))
1620 (if italic
1621 (plist-put plist :slant (if italic 'italic 'normal)))
1610 (while (and match (not (null list))) 1622 (while (and match (not (null list)))
1611 (let* ((attr (car (car list))) 1623 (let* ((attr (car (car list)))
1612 (specified-value 1624 (specified-value
1613 (if (plist-member attrs attr) 1625 (if (plist-member plist attr)
1614 (plist-get attrs attr) 1626 (plist-get plist attr)
1615 'unspecified)) 1627 'unspecified))
1616 (value-now (face-attribute face attr frame))) 1628 (value-now (face-attribute face attr frame)))
1617 (setq match (equal specified-value value-now)) 1629 (setq match (equal specified-value value-now))