Subject: bug#16694: Regression by commit 115663 (bzr): Theme face attributes no longer take precedence over X resources

From: Matthias Dahl <[email-masked]>
Date: Fri, 14 Feb 2014 20:17:42 +0100

On 12/02/14 23:21, Glenn Morris wrote:

> Then this is probably the same root issue as
> http://debbugs.gnu.org/16434 (and 16440, and 16443, and maybe 16378).

More than likely.

> There is clearly something going on there that needs to be investigated
> before 24.4.

The attached patch is what I am using locally and it fixes all problems
for me. I also tested bug #16434 and it works fine w/ the patch applied.
Basically it puts everything from X resources back to be applied first
and everything else on-top. Thus everything else is taking priority.

Consider the patch a raw version and a RFC-- missing proper changes to
the comments and I'd probably pull the conditional
(no-init-from-x-resources) up into make-face-x-resource-internal and
change the usage throughout the rest of the file.

But I'm not too well versed with Emacs' deep inner workings, and even
though it makes sense to me :), I might be completely off and just
fixing the symptoms. If so, I'd gladly help in finding the proper root
cause and learning a bit more in the process...

Hope that helps...
Matthias
--- a/lisp/faces.el	2014-02-11 15:36:01.122479000 +0100
+++ b/lisp/faces.el	2014-02-11 15:35:34.305796014 +0100
@@ -1624,6 +1624,8 @@
   (while (get face 'face-alias)
     (setq face (get face 'face-alias)))
   (face-spec-reset-face face frame)
+  (unless 'no-init-from-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 +1643,7 @@
       (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."