aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman2007-07-31 17:34:15 +0000
committerRichard M. Stallman2007-07-31 17:34:15 +0000
commit2d17b4d5dc5821d766bef1646461d31e6ab607e6 (patch)
tree233ffc0ca284375ee198b8d05fd9b949787795b4 /lisp
parent5b5485e6fdd091eb5fb99ab4e4fab430ae87f351 (diff)
downloademacs-2d17b4d5dc5821d766bef1646461d31e6ab607e6.tar.gz
emacs-2d17b4d5dc5821d766bef1646461d31e6ab607e6.zip
(face-normalize-spec): New function.
(frame-set-background-mode): Normalize face-spec before calling face-spec-match-p.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/faces.el25
2 files changed, 30 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dc0c05462c8..066ae1fef13 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12007-07-31 Daiki Ueno <ueno@unixuser.org>
2
3 * faces.el (face-normalize-spec): New function.
4 (frame-set-background-mode): Normalize face-spec before calling
5 face-spec-match-p.
6
12007-07-31 Stefan Monnier <monnier@iro.umontreal.ca> 72007-07-31 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * vc-bzr.el: New file (copied from the trunk). 9 * vc-bzr.el: New file (copied from the trunk).
diff --git a/lisp/faces.el b/lisp/faces.el
index 090fbdba035..daf5f39fbc1 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1505,6 +1505,28 @@ If there is neither a user setting nor a default for FACE, return nil."
1505 (get face 'saved-face) 1505 (get face 'saved-face)
1506 (face-default-spec face))) 1506 (face-default-spec face)))
1507 1507
1508(defsubst face-normalize-spec (spec)
1509 "Return a normalized face-spec of SPEC."
1510 (let (normalized-spec)
1511 (while spec
1512 (let ((attribute (car spec))
1513 (value (car (cdr spec))))
1514 ;; Support some old-style attribute names and values.
1515 (case attribute
1516 (:bold (setq attribute :weight value (if value 'bold 'normal)))
1517 (:italic (setq attribute :slant value (if value 'italic 'normal)))
1518 ((:foreground :background)
1519 ;; Compatibility with 20.x. Some bogus face specs seem to
1520 ;; exist containing things like `:foreground nil'.
1521 (if (null value) (setq value 'unspecified)))
1522 (t (unless (assq attribute face-x-resources)
1523 (setq attribute nil))))
1524 (when attribute
1525 (push attribute normalized-spec)
1526 (push value normalized-spec)))
1527 (setq spec (cdr (cdr spec))))
1528 (nreverse normalized-spec)))
1529
1508 1530
1509;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1531;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1510;;; Frame-type independent color support. 1532;;; Frame-type independent color support.
@@ -1647,7 +1669,8 @@ according to the `background-mode' and `display-type' frame parameters."
1647 ;; be unmodified, so we can avoid consing in the common case. 1669 ;; be unmodified, so we can avoid consing in the common case.
1648 (dolist (face (face-list)) 1670 (dolist (face (face-list))
1649 (when (not (face-spec-match-p face 1671 (when (not (face-spec-match-p face
1650 (face-user-default-spec face) 1672 (face-normalize-spec
1673 (face-user-default-spec face))
1651 (selected-frame))) 1674 (selected-frame)))
1652 (push face locally-modified-faces))) 1675 (push face locally-modified-faces)))
1653 ;; Now change to the new frame parameters 1676 ;; Now change to the new frame parameters