From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthias Dahl Newsgroups: gmane.emacs.bugs Subject: bug#16434: bug#16694: bugs #16694/#16378: Patches Date: Sun, 27 Apr 2014 10:22:27 +0200 Message-ID: <535CBE43.7000803@binary-island.eu> References: <52F601AE.5040309@binary-island.eu> <87k3bj40nu.fsf@cougar.home.aneadesign.com> <83wqfiz36v.fsf@gnu.org> <5331D45B.7090704@binary-island.eu> <5335920F.4030008@binary-island.eu> <533C26F3.4040600@binary-island.eu> <83lhvk8b6x.fsf@gnu.org> <83a9bz92h2.fsf@gnu.org> <534517A5.1070306@binary-island.eu> <53492567.4090303@binary-island.eu> <83zjjqsjn7.fsf@gnu.org> <5349546A.4040500@binary-island.eu> <83zjjc82nq.fsf@gnu.org> <53580259.7010508@binary-island.eu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040804060909020001030908" X-Trace: ger.gmane.org 1398587004 30500 80.91.229.3 (27 Apr 2014 08:23:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Apr 2014 08:23:24 +0000 (UTC) Cc: gundaetiapo@gmail.com, 16434@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 27 10:23:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WeKMn-000574-6k for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Apr 2014 10:23:17 +0200 Original-Received: from localhost ([::1]:38403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeKMm-0003LM-Nl for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Apr 2014 04:23:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeKMf-0003L7-46 for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2014 04:23:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WeKMY-0005uy-Ua for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2014 04:23:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeKMY-0005uu-Qp for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2014 04:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WeKMY-00060r-8R for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2014 04:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matthias Dahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Apr 2014 08:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16434 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16434-submit@debbugs.gnu.org id=B16434.139858695423065 (code B ref 16434); Sun, 27 Apr 2014 08:23:02 +0000 Original-Received: (at 16434) by debbugs.gnu.org; 27 Apr 2014 08:22:34 +0000 Original-Received: from localhost ([127.0.0.1]:59511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WeKM5-0005zw-GR for submit@debbugs.gnu.org; Sun, 27 Apr 2014 04:22:34 -0400 Original-Received: from hemera.binary-island.eu ([97.107.138.233]:38381) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WeKM2-0005zk-Rq for 16434@debbugs.gnu.org; Sun, 27 Apr 2014 04:22:32 -0400 Original-Received: from [10.0.0.20] (95-90-41-152-dynip.superkabel.de [95.90.41.152]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by hemera.binary-island.eu (Postfix) with ESMTPSA id CC58C3C12B; Sun, 27 Apr 2014 04:22:47 -0400 (EDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88322 Archived-At: This is a multi-part message in MIME format. --------------040804060909020001030908 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello @all... > Would it help to turn the X resource settings into a theme which can > then be maybe more easily stacked at the right place? Stefan, thanks for the idea. With the way things are currently wired, this would most certainly mess the logic up. :( Eli, could you please test the attached patches? Everything is rather self-explanatory and the fix as simplistic as possible. I tested it for all known possible regressions, but everything works just fine here. It looks like it is the right thing to do (tm). Unfortunately, I was not able to test it on win32 (yeah, I know, sorry) for obvious reasons :) but based on what you said, it should fix the toolbar coloring just fine. If there are no regressions reported from other parties and if it fixes the issues on win32, from my side just go ahead and apply it to master and emacs-24. Hoping very much for positive feedback. ;-) So long, Matthias -- Dipl.-Inf. (FH) Matthias Dahl | Software Engineer | binary-island.eu services: custom software [desktop, mobile, web], server administration --------------040804060909020001030908 Content-Type: text/x-patch; name="emacs24-0001-PATCH-lisp-faces.el-Apply-X-resources-after-defface-.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="emacs24-0001-PATCH-lisp-faces.el-Apply-X-resources-after-def"; filename*1="face-.patch" >From 829b21a2e9cbcdab8d59f9b7f3b87c112088e729 Mon Sep 17 00:00:00 2001 From: Matthias Dahl Date: Sun, 27 Apr 2014 10:03:40 +0200 Subject: [PATCH 4/4] [PATCH] lisp/faces.el: Apply X resources after defface spec Apply X resources only after the the defface spec has been applied. Thus, X resources are no longer overriden by the defface spec which also fixes issues on win32 where the toolbar coloring was wrong because it is set through X resources and was (wrongfully) overriden. --- lisp/ChangeLog | 8 ++++++++ lisp/faces.el | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bcb649f..cfe61ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2014-04-27 Matthias Dahl + + * faces.el (face-spec-recalc): Apply X resources only after the + the defface spec has been applied. Thus, X resources are no longer + overriden by the defface spec which also fixes issues on win32 where + the toolbar coloring was wrong because it is set through X resources + and was (wrongfully) overriden. + 2014-04-25 Nicolas Richard * battery.el (battery-update): Handle the case where battery diff --git a/lisp/faces.el b/lisp/faces.el index 88b8748..df31e0d 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1641,18 +1641,22 @@ function for its other effects." (defun face-spec-recalc (face frame) "Reset the face attributes of FACE on FRAME according to its specs. -After the reset, the specs are applied from the following sources in this order: - X resources (if applicable) +The following sources are applied in this order: + + face reset to default values if it's the default face, otherwise set + to unspecifed (through `face-spec-reset-face`) | (theme and user customization) - or, if nonexistent or does not match the current frame, + or: if none of the above exist, do not match the current frame or + did inherit from the defface spec instead of overwriting it + entirely, the following is applied instead: (defface default spec) + (X resources (if applicable)) | defface override spec" (while (get face 'face-alias) (setq face (get face 'face-alias))) (face-spec-reset-face face frame) - (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)) @@ -1666,10 +1670,12 @@ After the reset, the specs are applied from the following sources in this order: (setq theme-face-applied t)))) ;; If there was a spec applicable to FRAME, that overrides the ;; defface spec entirely (rather than inheriting from it). If - ;; there was no spec applicable to FRAME, apply the defface spec. + ;; there was no spec applicable to FRAME, apply the defface spec + ;; as well as any applicable X resources. (unless theme-face-applied (setq spec (face-spec-choose (face-default-spec face) frame)) - (face-spec-set-2 face frame spec)) + (face-spec-set-2 face frame spec) + (make-face-x-resource-internal face frame)) (setq spec (face-spec-choose (get face 'face-override-spec) frame)) (face-spec-set-2 face frame spec))) -- 1.9.2 --------------040804060909020001030908 Content-Type: text/x-patch; name="master-0001-lisp-faces.el-Apply-X-resources-after-defface-spec.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="master-0001-lisp-faces.el-Apply-X-resources-after-defface-sp"; filename*1="ec.patch" >From 093207c4c79012615377695eb8eba31283aded5d Mon Sep 17 00:00:00 2001 From: Matthias Dahl Date: Sun, 27 Apr 2014 09:55:51 +0200 Subject: [PATCH] lisp/faces.el: Apply X resources after defface spec Apply X resources only after the the defface spec has been applied. Thus, X resources are no longer overriden by the defface spec which also fixes issues on win32 where the toolbar coloring was wrong because it is set through X resources and was (wrongfully) overriden. --- lisp/ChangeLog | 8 ++++++++ lisp/faces.el | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c81f99e..c982540 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2014-04-27 Matthias Dahl + + * faces.el (face-spec-recalc): Apply X resources only after the + the defface spec has been applied. Thus, X resources are no longer + overriden by the defface spec which also fixes issues on win32 where + the toolbar coloring was wrong because it is set through X resources + and was (wrongfully) overriden. + 2014-04-25 Stefan Monnier * progmodes/perl-mode.el (perl--syntax-exp-intro-regexp): New var. diff --git a/lisp/faces.el b/lisp/faces.el index 9c11547..b58575d 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1652,18 +1652,22 @@ function for its other effects." (defun face-spec-recalc (face frame) "Reset the face attributes of FACE on FRAME according to its specs. -After the reset, the specs are applied from the following sources in this order: - X resources (if applicable) +The following sources are applied in this order: + + face reset to default values if it's the default face, otherwise set + to unspecifed (through `face-spec-reset-face`) | (theme and user customization) - or, if nonexistent or does not match the current frame, + or: if none of the above exist, do not match the current frame or + did inherit from the defface spec instead of overwriting it + entirely, the following is applied instead: (defface default spec) + (X resources (if applicable)) | defface override spec" (while (get face 'face-alias) (setq face (get face 'face-alias))) (face-spec-reset-face face frame) - (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)) @@ -1677,10 +1681,12 @@ After the reset, the specs are applied from the following sources in this order: (setq theme-face-applied t)))) ;; If there was a spec applicable to FRAME, that overrides the ;; defface spec entirely (rather than inheriting from it). If - ;; there was no spec applicable to FRAME, apply the defface spec. + ;; there was no spec applicable to FRAME, apply the defface spec + ;; as well as any applicable X resources. (unless theme-face-applied (setq spec (face-spec-choose (face-default-spec face) frame)) - (face-spec-set-2 face frame spec)) + (face-spec-set-2 face frame spec) + (make-face-x-resource-internal face frame)) (setq spec (face-spec-choose (get face 'face-override-spec) frame)) (face-spec-set-2 face frame spec))) -- 1.9.2 --------------040804060909020001030908--