emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100457: faces.el fix for bug#7966


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100457: faces.el fix for bug#7966.
Date: Mon, 07 Feb 2011 20:10:15 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100457
committer: Glenn Morris <address@hidden>
branch nick: emacs-23
timestamp: Mon 2011-02-07 20:10:15 -0800
message:
  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.)
modified:
  lisp/ChangeLog
  lisp/faces.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-02-07 17:41:11 +0000
+++ b/lisp/ChangeLog    2011-02-08 04:10:15 +0000
@@ -1,3 +1,8 @@
+2011-02-08  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
 
        * simple.el (next-error): Doc fix.

=== modified file 'lisp/faces.el'
--- a/lisp/faces.el     2011-02-03 06:55:48 +0000
+++ b/lisp/faces.el     2011-02-08 04:10:15 +0000
@@ -1605,13 +1605,25 @@
 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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]