# HG changeset patch # User Richard M. Stallman # Date 1185903235 0 # Node ID 18f6eb588c672b7d687a7e71dc14deec2b5a1e8a # Parent 3386631a602c1812524bb3f4de58b5f92e9b551b (face-normalize-spec): New function. (frame-set-background-mode): Normalize face-spec before calling face-spec-match-p. diff -r 3386631a602c -r 18f6eb588c67 lisp/faces.el --- a/lisp/faces.el Tue Jul 31 15:28:16 2007 +0000 +++ b/lisp/faces.el Tue Jul 31 17:33:55 2007 +0000 @@ -1505,6 +1505,28 @@ (get face 'saved-face) (face-default-spec face))) +(defsubst face-normalize-spec (spec) + "Return a normalized face-spec of SPEC." + (let (normalized-spec) + (while spec + (let ((attribute (car spec)) + (value (car (cdr spec)))) + ;; Support some old-style attribute names and values. + (case attribute + (:bold (setq attribute :weight value (if value 'bold 'normal))) + (:italic (setq attribute :slant value (if value 'italic 'normal))) + ((:foreground :background) + ;; Compatibility with 20.x. Some bogus face specs seem to + ;; exist containing things like `:foreground nil'. + (if (null value) (setq value 'unspecified))) + (t (unless (assq attribute face-x-resources) + (setq attribute nil)))) + (when attribute + (push attribute normalized-spec) + (push value normalized-spec))) + (setq spec (cdr (cdr spec)))) + (nreverse normalized-spec))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Frame-type independent color support. @@ -1647,7 +1669,8 @@ ;; be unmodified, so we can avoid consing in the common case. (dolist (face (face-list)) (when (not (face-spec-match-p face - (face-user-default-spec face) + (face-normalize-spec + (face-user-default-spec face)) (selected-frame))) (push face locally-modified-faces))) ;; Now change to the new frame parameters