From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Overriding inherited face attributes Date: Wed, 28 Nov 2018 09:51:06 +0200 Message-ID: <83d0qpfxn9.fsf@gnu.org> References: <87pnuqfboc.fsf@gmx.net> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1543391365 25493 195.159.176.226 (28 Nov 2018 07:49:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Nov 2018 07:49:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 28 08:49:21 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRub2-0006Vu-4h for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2018 08:49:20 +0100 Original-Received: from localhost ([::1]:46422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRud8-0003cb-Mx for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2018 02:51:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRucd-0003cL-Ub for help-gnu-emacs@gnu.org; Wed, 28 Nov 2018 02:51:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRuca-0001KL-OV for help-gnu-emacs@gnu.org; Wed, 28 Nov 2018 02:50:59 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRuca-0001JT-L7 for help-gnu-emacs@gnu.org; Wed, 28 Nov 2018 02:50:56 -0500 Original-Received: from [176.228.60.248] (port=2041 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gRuca-0004k7-8i for help-gnu-emacs@gnu.org; Wed, 28 Nov 2018 02:50:56 -0500 In-reply-to: (message from Boris Buliga on Wed, 28 Nov 2018 09:39:29 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118785 Archived-At: > From: Boris Buliga > Date: Wed, 28 Nov 2018 09:39:29 +0200 > Cc: help-gnu-emacs@gnu.org > > > (propertize "hello" 'face '(:foreground "red" :inherit (:foreground > "orange"))) > #("hello" 0 5 (face (:foreground "red" :inherit (:foreground "orange")))) > ;; results in an orange text > > > (propertize "hello" 'face '((:foreground "red") (:inherit (:foreground > "orange")))) > #("hello" 0 5 (face ((:foreground "red") (:inherit ...)))) > ;; results in a red text > > To me, it's still confusing. Why in the first example I have an orange text > and > in the second one - red? Isn't the second example simply wrong syntax-wise? Why did you use an extra level of parentheses? > 2. And there is a part saying something I don't quite understand about > inheritance. > > > Attributes from inherited faces are merged into the face like an > underlying > > face would be, with higher priority than underlying faces. > > This one looks good to me. If I understand this correctly - inherited face > attributes behave as usual face attributes. They behave the same as attributes of the underlying face, but they override the underlying face where both specify the same attributes.