From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#40336: default face spec doesn't get overriden Date: Thu, 02 Apr 2020 22:36:08 +0300 Message-ID: <838sjdy91z.fsf@gnu.org> References: <6905531585606838@vla1-a4c6eab2e6c6.qloud-c.yandex.net> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="31012"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40336@debbugs.gnu.org To: Bad Blue Bull Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 02 21:37:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jK5eI-0007xG-TP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Apr 2020 21:37:10 +0200 Original-Received: from localhost ([::1]:46626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK5eH-0003uK-G5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Apr 2020 15:37:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37570) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK5eB-0003ty-89 for bug-gnu-emacs@gnu.org; Thu, 02 Apr 2020 15:37:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jK5eA-0006s0-B0 for bug-gnu-emacs@gnu.org; Thu, 02 Apr 2020 15:37:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57499) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jK5eA-0006rw-87 for bug-gnu-emacs@gnu.org; Thu, 02 Apr 2020 15:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jK5eA-0000nN-3c for bug-gnu-emacs@gnu.org; Thu, 02 Apr 2020 15:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Apr 2020 19:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40336 X-GNU-PR-Package: emacs Original-Received: via spool by 40336-submit@debbugs.gnu.org id=B40336.15858561932966 (code B ref 40336); Thu, 02 Apr 2020 19:37:02 +0000 Original-Received: (at 40336) by debbugs.gnu.org; 2 Apr 2020 19:36:33 +0000 Original-Received: from localhost ([127.0.0.1]:40812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jK5dh-0000ll-Bx for submit@debbugs.gnu.org; Thu, 02 Apr 2020 15:36:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jK5df-0000lQ-Lc for 40336@debbugs.gnu.org; Thu, 02 Apr 2020 15:36:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jK5da-0006d0-4o; Thu, 02 Apr 2020 15:36:26 -0400 Original-Received: from [176.228.60.248] (port=1410 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jK5dZ-0002L2-9S; Thu, 02 Apr 2020 15:36:25 -0400 In-Reply-To: <6905531585606838@vla1-a4c6eab2e6c6.qloud-c.yandex.net> (message from Bad Blue Bull on Tue, 31 Mar 2020 01:38:40 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177961 Archived-At: > From: Bad Blue Bull > Date: Tue, 31 Mar 2020 01:38:40 +0300 > > (progn > (face-spec-set 'zzz > '((default :background "red") > (((background dark)) :weight bold :background "black" :foreground "White" ) > (((background light)) :weight bold :background "yellow" :foreground "Black" ) > )) > > (insert (propertize "XXX" 'face 'zzz))) > > > Eval it and see default background gets applied despite it should be overriden by a spec line that matches terminal's background. Thanks. Does the patch below fix that? diff --git a/lisp/faces.el b/lisp/faces.el index 9a49ea8..e707f6f 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1560,7 +1560,7 @@ face-spec-choose ;; return it to the caller. Since there will most definitely be something to ;; return in this case, there's no need to know/check if a match was found. (if defaults - (append result defaults) + (append defaults result) (if match-found result no-match-retval))))