Fix bug #16694 with theme face precedence.
authorMatthias Dahl <ml_emacs-lists@binary-island.eu>
Sat, 5 Apr 2014 07:15:11 +0000 (10:15 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 5 Apr 2014 07:15:11 +0000 (10:15 +0300)
 lisp/faces.el (face-spec-recalc): Call make-face-x-resource-internal
 only when inhibit-x-resources is nil, and do that earlier in the
 function.  Doc fix.

lisp/ChangeLog
lisp/faces.el

index 7ab9209..a74e121 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-05  Matthias Dahl  <ml_emacs-lists@binary-island.eu>
+
+       * faces.el (face-spec-recalc): Call make-face-x-resource-internal
+       only when inhibit-x-resources is nil, and do that earlier in the
+       function.  Doc fix.  (Bug#16694)
+
 2014-04-04  Tassilo Horn  <tsdh@gnu.org>
 
        * doc-view.el (doc-view-bookmark-jump): Use
index e008993..c6dd8d7 100644 (file)
@@ -1619,11 +1619,19 @@ function for its other effects."
 
 (defun face-spec-recalc (face frame)
   "Reset the face attributes of FACE on FRAME according to its specs.
-This applies the defface/custom spec first, then the custom theme specs,
-then the override spec."
+After the reset, the specs are applied from the following sources in this order:
+  X resources (if applicable)
+   |
+  (theme and user customization)
+    or, if nonexistent or does not match the current frame,
+  (defface default spec)
+   |
+  defface override spec"
   (while (get face 'face-alias)
     (setq face (get face 'face-alias)))
   (face-spec-reset-face face frame)
+  (unless inhibit-x-resources
+    (make-face-x-resource-internal face frame))
   ;; If FACE is customized or themed, set the custom spec from
   ;; `theme-face' records.
   (let ((theme-faces (get face 'theme-face))
@@ -1641,8 +1649,7 @@ then the override spec."
       (setq spec (face-spec-choose (face-default-spec face) frame))
       (face-spec-set-2 face frame spec))
     (setq spec (face-spec-choose (get face 'face-override-spec) frame))
-    (face-spec-set-2 face frame spec))
-  (make-face-x-resource-internal face frame))
+    (face-spec-set-2 face frame spec)))
 
 (defun face-spec-set-2 (face frame spec)
   "Set the face attributes of FACE on FRAME according to SPEC."