aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/faces.el26
2 files changed, 23 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 51bfe7c1fbf..8034a748099 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12013-12-22 Chong Yidong <cyd@gnu.org>
2
3 * faces.el (face-spec-recalc): If the theme specs are not
4 applicable to a frame, fall back on the defface spec. This
5 prevents themes from obliterating faces on low-color terminals.
6
12013-12-22 Dmitry Gutov <dgutov@yandex.ru> 72013-12-22 Dmitry Gutov <dgutov@yandex.ru>
2 8
3 * progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t 9 * progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Return t
diff --git a/lisp/faces.el b/lisp/faces.el
index 13283665781..d60d1d287e0 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1625,20 +1625,28 @@ then the override spec."
1625 (setq face (get face 'face-alias))) 1625 (setq face (get face 'face-alias)))
1626 (face-spec-reset-face face frame) 1626 (face-spec-reset-face face frame)
1627 ;; If FACE is customized or themed, set the custom spec from 1627 ;; If FACE is customized or themed, set the custom spec from
1628 ;; `theme-face' records, which completely replace the defface spec 1628 ;; `theme-face' records.
1629 ;; rather than inheriting from it. 1629 (let ((theme-faces (get face 'theme-face))
1630 (let ((theme-faces (get face 'theme-face))) 1630 spec theme-face-applied)
1631 (if theme-faces 1631 (if theme-faces
1632 (dolist (spec (reverse theme-faces)) 1632 (dolist (elt (reverse theme-faces))
1633 (face-spec-set-2 face frame (cadr spec))) 1633 (setq spec (face-spec-choose (cadr elt) frame))
1634 (face-spec-set-2 face frame (face-default-spec face)))) 1634 (when spec
1635 (face-spec-set-2 face frame (get face 'face-override-spec)) 1635 (face-spec-set-2 face frame spec)
1636 (setq theme-face-applied t))))
1637 ;; If there was a spec applicable to FRAME, that overrides the
1638 ;; defface spec entirely (rather than inheriting from it). If
1639 ;; there was no spec applicable to FRAME, apply the defface spec.
1640 (unless theme-face-applied
1641 (setq spec (face-spec-choose (face-default-spec face) frame))
1642 (face-spec-set-2 face frame spec))
1643 (setq spec (face-spec-choose (get face 'face-override-spec) frame))
1644 (face-spec-set-2 face frame spec))
1636 (make-face-x-resource-internal face frame)) 1645 (make-face-x-resource-internal face frame))
1637 1646
1638(defun face-spec-set-2 (face frame spec) 1647(defun face-spec-set-2 (face frame spec)
1639 "Set the face attributes of FACE on FRAME according to SPEC." 1648 "Set the face attributes of FACE on FRAME according to SPEC."
1640 (let* ((spec (face-spec-choose spec frame)) 1649 (let (attrs)
1641 attrs)
1642 (while spec 1650 (while spec
1643 (when (assq (car spec) face-x-resources) 1651 (when (assq (car spec) face-x-resources)
1644 (push (car spec) attrs) 1652 (push (car spec) attrs)