From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Overriding inherited face attributes Date: Wed, 28 Nov 2018 13:24:51 +0100 Message-ID: <87in0h1jak.fsf@rub.de> References: <87pnuqfboc.fsf@gmx.net> <83sgzlg1w7.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1543407800 10837 195.159.176.226 (28 Nov 2018 12:23:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Nov 2018 12:23:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 28 13:23:16 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 1gRys6-0002gT-OB for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2018 13:23:14 +0100 Original-Received: from localhost ([::1]:47381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRyuD-0002iY-8w for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2018 07:25:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRytn-0002iA-MT for help-gnu-emacs@gnu.org; Wed, 28 Nov 2018 07:25:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRytm-0007lE-RE for help-gnu-emacs@gnu.org; Wed, 28 Nov 2018 07:24:59 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:52657) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRyti-0007gK-Bq; Wed, 28 Nov 2018 07:24:54 -0500 Original-Received: from rosalinde ([188.109.205.78]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0ML72n-1gSFsb21Oz-000Hz2; Wed, 28 Nov 2018 13:24:52 +0100 In-Reply-To: <83sgzlg1w7.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 28 Nov 2018 08:19:20 +0200") X-Provags-ID: V03:K1:oj706VVn8LDXfSesv3shDq7wRaPYpDvgkNMiMapPk1RzgKMMflN KtxH2JxwkJQkQ5cnVGFTJ64bJMAsLKrZ9gIYSyKTRSk9jTy0+KblTzN6VXwe1p3/9BJbdvw khUUVATsAqesPDlQWatNhOSsh2Q1l1l1u+N40IpFvtEaeiTjhzZ+PzH7oPknqAZrxtfKJlR wg2vfpJEMvucdyQsqrFDQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:iR0Fnj+xx3I=:7EMGLwg/EnTwudi+GgS1PC h3Nlm6/tixXAjkb5LdEpbdwLq5FN8S/0Xl2u9uWSRmPM4B2Nr8QHlvB6dKi67djlDywuRAM9b Z8N8LkIWeb0Y05ac9M2c1CcnKaisO4Xy63fJABR4M2JdCoL+fb3nsFf9vzOom28RzGGa5Zu6+ EqNEkBM+T7M38hSJuoVcJnKaHY9gCzhGXKTkkeaZ/lCFE54o81aQ4myxHl0X/m1AbXEDsYB0j AmUaP6BVQyy2BF4TXtuVHIV6cbdg2L0TcKKmcn5v/xgVxFAtDFFflOdnBxTpH3NSu/gK6G2BB m9ZsWHHU8io6lN9hsvUSD6sMjCSEo41GgkneiFFSqh53NiYLOewliwS57iULb4tyLxy4PdQpJ O7G0V0V3WaIxrZBs8HDILrzyI89tecKa558Rx/4Q89KOoPpSvTvZKGByZ/aF8RUye/ukEFf7o jBP++ATSwH70VwITglubtNL2wElIbFy3StZ5f5DLB1GV1wE/QV5KQEBtZX2AP9QfxiGRDfJkf 6fl9YiAeECDMznpeLQKbn58AXvva7Kk1hbQdqOFM/xn6XPfUzaOlm4LFj/bI+m5p/MVwgidDs FkEXuhhp9C3tIByl1h6k50/3P4/1M0nyWH3CeumagbfYjzm+1MQcL9k+Zs45VHM2wBRad6KTO t2Emi9jbvoUgbA3fAbF234du7iDUPYNhpLjRiC45/cSNLlYMUbaioPt3FlNgraXVySi+zBOba yRr0GBby3UL7EHncoxAjYn+KQUVg4YDs7DM1FHqjpLXHUVXXuOuR/4qEUBm52hB8IrHyV+Ys X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.19 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:118787 Archived-At: On Wed, 28 Nov 2018 08:19:20 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Date: Tue, 27 Nov 2018 22:33:23 +0100 >> Cc: help-gnu-emacs@gnu.org >> >> In (info "(elisp) Special Properties") it says this: "The value of the >> [`face'] property can be... A list of faces... Faces occurring earlier >> in the list have higher priority." And in (info "(elisp) Face >> Attributes") it says: "Attributes from inherited faces are merged into >> the face like an underlying face would be, with higher priority than >> underlying faces." Whether this implies the above observed behavior is >> not clear to me. > > Is it really not clear? What part(s) make(s) the above text not > clear about the order in which the face attributes are applied? The text itself is clear in the abstract, and when I apply it to the example Boris gave, it seems to explain the observed result. That is, given this form: (insert (propertize "hello" 'face '(:foreground "red" :inherit (:foreground "orange")))) and given that "Faces occurring earlier in the list have higher priority", I would expect the displayed face to be red, as Boris did. But it's different with the `inherit' property: "Attributes from inherited faces are merged into the face like an underlying face would be, with higher priority than underlying faces". So that explains why the face is displayed as orange. But then I observed that merely switching the order: (insert (propertize "hello" 'face '(:inherit (:foreground "orange") :foreground "red"))) makes the face display as red, and this seems to conflict with the above documentation. Maybe I'm misunderstanding the doc, but in any case, because of the difference from switching the order of the properties, it's not clear to me. (The same seems to go for form Boris gave in his followup, which you suggested is syntactically incorrect, but does evaluate without error and displays a red face; as Boris noted, that syntax is the same as the result of applying add-face-text-property.) Steve Berman