>From a209fe3499b5c25b409539deb6b395de098411c1 Mon Sep 17 00:00:00 2001 From: Matthias Dahl Date: Wed, 2 Apr 2014 15:26:43 +0200 Subject: [PATCH 1/4] lisp/faces.el: Fix application of X resource attributes Attributes from X resources have to applied first after the face spec has been reset, to give Emacs' own face spec theming, customization and defface defaults a higher priority over it. Otherwise those will be overriden and the user sees a broken (= as in unintended and mixed up) user interface. Commit 15e14b165dcbc6566a0459b0d5e66f89080f569e inadvertently changed that priority. This fixes bug #16694. --- lisp/faces.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lisp/faces.el b/lisp/faces.el index 49b5928..7d04938 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1639,11 +1639,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)) @@ -1661,8 +1669,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." -- 1.9.1