From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Boris Buliga Newsgroups: gmane.emacs.help Subject: Re: Overriding inherited face attributes Date: Wed, 28 Nov 2018 23:44:47 +0200 Message-ID: References: <87pnuqfboc.fsf@gmx.net> <83sgzlg1w7.fsf@gnu.org> <87in0h1jak.fsf@rub.de> <8336rlfj1y.fsf@gnu.org> <87efb51h18.fsf@rub.de> <831s75fa5q.fsf@gnu.org> <87a7lt0y5b.fsf@rub.de> <83in0hdjo4.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1543441408 13027 195.159.176.226 (28 Nov 2018 21:43:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Nov 2018 21:43:28 +0000 (UTC) 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 22:43:23 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 1gS7cA-0003En-GQ for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2018 22:43:22 +0100 Original-Received: from localhost ([::1]:50110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gS7eH-0006R7-0O for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Nov 2018 16:45:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gS7dm-0006Qd-VS for help-gnu-emacs@gnu.org; Wed, 28 Nov 2018 16:45:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gS7dl-00085O-J4 for help-gnu-emacs@gnu.org; Wed, 28 Nov 2018 16:45:02 -0500 Original-Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]:43558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gS7dl-00084g-89 for help-gnu-emacs@gnu.org; Wed, 28 Nov 2018 16:45:01 -0500 Original-Received: by mail-ot1-x32e.google.com with SMTP id a11so24989474otr.10 for ; Wed, 28 Nov 2018 13:45:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=d12frosted-io.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zwykvG84XJX6MbNeU/Oqj/l4KbQlIYDQXEpfawxWPJM=; b=vXL8F6bCb7YKDbKJvUf4pH3xgl2lCltbHNAOiqbpvghSqFLoyE/52PUM5bt8IV/y9k LmzRwt5jz7zpD2/PCVdsT3Dgd0pBeupBSeyQ0IfIYAqJ2BwvW38OwmkRKE6j/0NUD3gQ SfN4+JB3PvetyYnrp3W4tlFjRhHYTqY6gUZsPuURb8si7iPVUwWGxs8Bmuo+WsqkbkU7 RtKdOwm5Fg/BJMBtWVwH9ElM7jbsqsHZvqcRoEghhajCuXKbX/Vli8bxtCiqf/ra5Hst iR3wAR6GXF6I7KoQa4gJCyHYM1dVe0AO2cP8bd9gvoQueAEvod4zLRHGNIvDEyZh7+e0 2rIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zwykvG84XJX6MbNeU/Oqj/l4KbQlIYDQXEpfawxWPJM=; b=gD+/af9zl/mh3dNvqJj+G+muFPUAWtW+GRTeVFEh7kbEYd5eGMMUEN+bxXHfJEQtat BRQMo/mqxOe2r14txdkfZjonADSfI0etXahbcsz+FR6IVy/3ZlVgobcUDYm2IYLAVMK2 60DmQKhs1DaR54m8cAUgFJY9YdlhMX4YgaOWvFWcSw+qqTYmGfNOOKoEnoPitxpsyzbv BfGIe47PNMBBgx/JHf71a43cF5ameJ00TOSl0jj5WevrbU+0xGJBw06s4Tr7IJfTEhvH i+fvujKZRTA5wH2z2mRgRRgzWMfyGCgoP7cS+S7Ef7uVFuKNfhAMrpIK6+dCLXSgLC3G i54w== X-Gm-Message-State: AA+aEWb/hWghbNWt5Awf9k79zlxdZ4Al0QbJ+wIuJsWp+tnsgfdHWvTp 3oX8FTWSGUNGRGjg97cx6BIeedJr/I8yF/rJI4A2mQ== X-Google-Smtp-Source: AFSGD/VdCyVYyVIl1b+375lzX7RNRc+gErxjdwuOCOuDVuMRgM8utZWX9B5EJ8OEf1RIYKT7tipenT51Mdo2aGA8iCY= X-Received: by 2002:a9d:2603:: with SMTP id a3mr20461654otb.37.1543441499906; Wed, 28 Nov 2018 13:44:59 -0800 (PST) In-Reply-To: <83in0hdjo4.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32e X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:118801 Archived-At: Hi, I don't see how it's specific to propetize. I can attach face differently, for example, by using add-text-properties or add-face-text-property: > (setq my-test-string "hello") "hello" > (add-text-properties 0 5 '(face (:inherit (:foreground "orange"))) my-test-string) nil > my-test-string #("hello" 0 5 (face (:inherit (:foreground "orange")))) ;; insert it and you'll get orange text > (setq my-test-string "hello") "hello" > (add-text-properties 0 5 '(face (:foreground "red" :inherit (:foreground "orange"))) my-test-string) nil > my-test-string #("hello" 0 5 (face (:foreground "red" :inherit (:foreground "orange")))) ;; insert it and you'll get orange text > (setq my-test-string "hello") "hello" > (add-text-properties 0 5 '(face (:inherit (:foreground "orange") :foreground "red" )) my-test-string) nil > my-test-string #("hello" 0 5 (face (:inherit (:foreground "orange") :foreground "red"))) ;; insert it and you'll get red text > (setq my-test-string "hello") "hello" > (add-text-properties 0 5 '(face ((:foreground "red") (:inherit (:foreground "orange")))) my-test-string) nil > my-test-string #("hello" 0 5 (face ((:foreground "red") (:inherit ...)))) ;; insert it and you'll get red text > (setq my-test-string "hello") "hello" > (add-text-properties 0 5 '(face ((:inherit (:foreground "orange")) (:foreground "red"))) my-test-string) nil > my-test-string #("hello" 0 5 (face ((:inherit ...) (:foreground "red")))) ;; insert it and you'll get orange text > (setq my-test-string "hello") "hello" > (add-face-text-property 0 5 '( :foreground "red" :inherit (:foreground "orange")) nil my-test-string) nil > my-test-string #("hello" 0 5 (face (:foreground "red" :inherit (:foreground "orange")))) ;; insert it and you'll get orange text > (setq my-test-string "hello") "hello" > (add-face-text-property 0 5 '(:inherit (:foreground "orange") :foreground "red") nil my-test-string) nil > my-test-string #("hello" 0 5 (face (:inherit (:foreground "orange") :foreground "red"))) ;; insert it and you'll get red text As you can see, it's a matter of properties. No matter how you add them, using propertize, add-text-properties or add-face-text-property. On Wed, 28 Nov 2018 at 22:37, Eli Zaretskii wrote: > > From: Stephen Berman > > Cc: help-gnu-emacs@gnu.org > > Date: Wed, 28 Nov 2018 21:01:36 +0100 > > > > It would be helpful to know from precisely which part of the > > documentation it follows that evaluating this: > > > > (insert (propertize "hello" 'face '(:foreground "red" :inherit > > (:foreground "orange")))) > > > > displays "hello" in orange while evaluating this: > > > > (insert (propertize "hello" 'face '(:inherit (:foreground "orange") > > :foreground "red"))) > > > > displays "hello" in red. > > So this is only about what propertize does? And only when some of the > later properties override earlier ones? > > > I don't see how it follows from the passage in the Lisp manual I > > cited ("Faces occurring earlier in the list have higher priority") > > It doesn't, because what you cited is not related to propertize, it's > related to how we process faces that come from several different > sources that affect the same piece of text. > > -- Cheers, Boris