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: Tue, 27 Nov 2018 22:33:23 +0100 Message-ID: <87pnuqfboc.fsf@gmx.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1543354341 15195 195.159.176.226 (27 Nov 2018 21:32:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Nov 2018 21:32:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Boris Buliga Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 27 22:32:17 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 1gRkxt-0003r5-7X for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Nov 2018 22:32:17 +0100 Original-Received: from localhost ([::1]:44635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRkzz-0004PO-Pa for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Nov 2018 16:34:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRkz8-0004NB-VN for help-gnu-emacs@gnu.org; Tue, 27 Nov 2018 16:33:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRkz3-0001ub-Ii for help-gnu-emacs@gnu.org; Tue, 27 Nov 2018 16:33:34 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:46677) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRkz3-0001on-5u for help-gnu-emacs@gnu.org; Tue, 27 Nov 2018 16:33:29 -0500 Original-Received: from rosalinde ([178.6.221.215]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0ML6XF-1gRU053DBx-000IwV; Tue, 27 Nov 2018 22:33:24 +0100 In-Reply-To: (Boris Buliga's message of "Tue, 27 Nov 2018 22:18:45 +0200") X-Provags-ID: V03:K1:7hUjDYRZbDNWe54B0Lc2RwHqLESMQWMUlB5LzYcSLO6hWad5pEs bW8S/e/4+Jop4ygvaBw8K9N7mbvVT0pzNwE356GE8l2dMYN2n/Ezi2wMpp9GoTgO8bRxeIo P5ttgUzusGdYt6mUxfBGcjzrTtdcvlDoRi86Bv9ZpF/HLeAcyB2Uy3/W+Y33cnMLgPYqEnm Pe37QcJyeuHuuHCAg6R6w== X-UI-Out-Filterresults: notjunk:1;V03:K0:wPRQsMjXoiM=:T78KEh6kIz86Cc0MQPBkuS upgJnPPHfJjeBYNrGonLG06HgTIYGRsE94dTl7R2su39zRf6X+XLhHJ/SrMLEm+WU/ODBJKFI VM0g1bZdTIwl3zubzYpm0vaw7yICc1AsPaqedShpQXX/HOGvd8Sg/18XgAVQRk5azgKMFNdgY KH7o4W21/28Jc4YgwQo0zes4YFjjPrFFW9+CCg61T7uEPHaWsiPCyhz4DWsE17fyVHNqiv3G3 1B1vsb7cNKX/s2QulPlSbpFyKoCZ4ZCM0jbSJZ5UKaSPVhc06Fp4n8PbLdwP4DbxyWFoBHbyB CGcQv7xk0v8ZewvZn2f2tiy8TWbtFpNLzmQOSWuBb+BQdvXyrgJYiu5h4I1+kvKbNJFo6a0Z4 hCMwikwOz5PcjLxmAYbZu0/H6mBtXwDAHxKzR43RRWeJwxRsJ/y3EgNDhKt+8zQhJMAVDe3/Y cjoqLqJ2JImx65jHD1Kb1sZst72q1NInY3AelLc7Rddp6bv53HG/udREVRARpdkNC6hDxqqvV ISX8dP9SasfQAl3hiS3kjZzzBIi3DfWMEEUOMrZoIAOu6+esT/TLi6XSWwjrqkN0XVSrN/khm d9jGr8diwBAF1nqgNgAbyvboqUyQbWAkMgZ/+/hrgm0cWYnN/fphrvN0JBF9AiRsWFbp2RZ+c p5zQvIbTN+efvSAMtjrgRFdmFVrlMjzZaAT6sBWVhJm9+B0884mru4XdRZrXObUHMMApEVHKk PdFEG9ZajHhodWPb5EIyD6066xzVYGanKJYUd+PZ/gNsUm0ICEYmre05bABsF4ISQ422UZU2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 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:118776 Archived-At: On Tue, 27 Nov 2018 22:18:45 +0200 Boris Buliga wrote: > Hi everyone, > > Sorry if this question was answered somewhere before. I searched and didn't > find any working solution, so here I am. > > Problem. Override a face attribute that is defined in an inherited face. > > For example, open up a new buffer in the fundamental mode and evaulate the > following experssion: > > (insert (propertize "hello" 'face '(:foreground "red" :inherit (:foreground > "orange")))) > > I expect the word 'hello' to be red, but instead, it is orange. > > So two questions: > > 1. Am I right to expect the text to be red? > 2. How to achieve this? I don't know the answer to your first questions, but the answer to the second question appears to be: switch the order. At least, when I evaluate the following in fundamental mode, 'hello' is red: (insert (propertize "hello" 'face '(:inherit (:foreground "orange") :foreground "red"))) 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. Steve Berman