summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-02-07 20:10:15 -0800
committerGlenn Morris <rgm@gnu.org>2011-02-07 20:10:15 -0800
commit55444d3764f842a68b3614277da511873f2ff38e (patch)
tree9fc788976b68779896b1d89da79e7c40e69eb911
parentb12d3be855b1d3db2cb5726f5c8919534cc9d4e9 (diff)
downloademacs-55444d3764f842a68b3614277da511873f2ff38e.tar.gz
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 fa77a0dec4b..5e34fa06cea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-08 Glenn Morris <rgm@gnu.org>
+
+ * faces.el (face-attr-match-p): Handle the obsolete :bold and
+ :italic props, so that frame-set-background-mode works. (Bug#7966)
+
2011-02-07 Glenn Morris <rgm@gnu.org>
* 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
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))