diff options
author | Miles Bader <miles@gnu.org> | 2007-08-03 05:58:06 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-08-03 05:58:06 +0000 |
commit | 2ca773ca40d2c1896757e6382aefff6d9de1c5cc (patch) | |
tree | 846419ece5e5d8bc8f11e9786598678af9c78f00 /lisp/faces.el | |
parent | 49b23c2a404cf31fb1aeecc7932a7304aaf16a67 (diff) | |
parent | 0896d93184a719bc994a3e699de27190aac0acb1 (diff) | |
download | emacs-2ca773ca40d2c1896757e6382aefff6d9de1c5cc.tar.gz emacs-2ca773ca40d2c1896757e6382aefff6d9de1c5cc.tar.bz2 emacs-2ca773ca40d2c1896757e6382aefff6d9de1c5cc.zip |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 843-845)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 84-87)
- Update from CVS
- Change capitalization of VC backend names for new backends
Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-30
Diffstat (limited to 'lisp/faces.el')
-rw-r--r-- | lisp/faces.el | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 43d95672446..55a7f3846a9 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1506,6 +1506,28 @@ If there is neither a user setting nor a default for FACE, return nil." (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. @@ -1653,7 +1675,8 @@ according to the `background-mode' and `display-type' frame parameters." ;; 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 |