From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dave Goel Newsgroups: gmane.emacs.devel Subject: Re: Faces: How to clear an attribute while continuing to inherit other attributes? Date: Thu, 10 Oct 2019 14:26:02 -0400 Message-ID: References: <83tv8hrpi6.fsf@gnu.org> <83tv8gqz6u.fsf@gnu.org> <83pnj4qxsd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000052ce440594928999" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="67339"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 10 20:27:04 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iId9U-000HO3-6Y for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2019 20:27:04 +0200 Original-Received: from localhost ([::1]:43052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iId9S-00079J-Ug for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2019 14:27:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56939) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iId8j-0006NL-9n for emacs-devel@gnu.org; Thu, 10 Oct 2019 14:26:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iId8i-0001GQ-74 for emacs-devel@gnu.org; Thu, 10 Oct 2019 14:26:17 -0400 Original-Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:36760) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iId8g-0001FP-JK; Thu, 10 Oct 2019 14:26:14 -0400 Original-Received: by mail-io1-xd36.google.com with SMTP id b136so15932137iof.3; Thu, 10 Oct 2019 11:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yr/1lRqr+7YclALN1HCCDJpfyt45ZDlUUZAQK2PStVE=; b=Lat9hllRc3QneufcOfyumPMPAHeScasybDJ7ClkVUlszrl/CzoRkycx+sou1SUojFC SUawS0uL6VYrXk5Pl8X5mYaxn7fYjx/hJOG4vVXj+djwO8gvsWql/BMzyNSKbxmeaqXq ds50LF4+0iZCVm8PzmiPOJnppqVtl73rqUUxiFId1vinvPuEQiz/qf0gdOcRAELpbR++ 4zRXEgQRAMY2eYmVbKE9sP3Xca9isaxnkRo7OKf7w0s+p1wmeAAEu1wFDSsM0696ZnhX FgQm1l/ULyo8e5HtfkMTQVY9jdNhjLrGwzmHvRZ96BBSkT0mJ1MQ/noaJIlRp87h0PGS dVVA== 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=Yr/1lRqr+7YclALN1HCCDJpfyt45ZDlUUZAQK2PStVE=; b=lQSDAwMEBiD6VB6ApxnXSNUcovi2NODWKrzI7ggY3a3k1/nZAJAfKhgolQvv6K+ypV 0mK1wCQNyQVzQmCgf7Jeo9qIPnkZhZUOhJwF1GpcRvIbXqIT2nlAuDhwKNqR6oJyMmsp +7Fz+Cfg6BZf0+3UlXARqugh+krbNYR5B70Mi3n+Cg4Ohv8pUNLcZhUGII10adD0b760 ig0QlAcJAqL/9X8/4FzGCUWTCnPLEu4dfQBgnA49NwohUGXg4+6zehCVgheVTgyWL7za CeWUTngg2MBf0A2cZ05xUB1RtJobyl8lIf7knUn33QW+WGi5vRalfa6U4hLvJY6i6yRV I2UQ== X-Gm-Message-State: APjAAAVpsfPoMR8+PHosnoV1XV39J0rI6Qt+8KjZ9STDBR0U95AstpXg OskRbuhfkh4JGqwmHFPw7Cl4Q0/NT/5Z8wxFpDmjaflJ X-Google-Smtp-Source: APXvYqzMlmYlYeUf9ooVSJuaOp577fJL/vNOj9QNaijkw9INr/IX1DbR31workVjAiqB9yjKXDxwVAM+fXPWQZhJnfY= X-Received: by 2002:a6b:16c4:: with SMTP id 187mr11583353iow.88.1570731973593; Thu, 10 Oct 2019 11:26:13 -0700 (PDT) In-Reply-To: <83pnj4qxsd.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d36 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240855 Archived-At: --00000000000052ce440594928999 Content-Type: text/plain; charset="UTF-8" > Not if your code does > (set-face-foreground FACE (face-foreground 'default)) > With this, if the default face changes the color, FACE will follow suit. I don't see that at all here in my emacs24: (progn (defface a nil "") (defface b nil "") (set-face-attribute 'b nil :foreground "yellow") (set-face-attribute 'a nil :inherit 'b) (set-face-foreground 'a (face-foreground 'default)) ;; let's chase how 'a would render: (let ((init (face-attribute 'a :foreground nil t)) final) (set-face-foreground 'default "pink") (setq final (face-attribute 'a :foreground nil t)) (message "%S %S" init final))) "\"white\" \"white\"" Per your assertion, the message should have been: white, pink. Also, your point seems to be: We shouldn't allow nil (to clear inheritances) for :fg and :bg (unlike for other faces) because: "*we only allow strings*". I don't get that logic. --00000000000052ce440594928999 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> Not if your code does
&g= t;=C2=A0 =C2=A0(set-face-foreground FACE (face-foreground 'default))> With this, if the default face changes the color, FACE will followsuit.


I don't see that at all her= e in my emacs24:

=C2=A0(progn
=C2=A0 =C2=A0(defface a nil "&= quot;)
=C2=A0 =C2=A0(defface b nil "")
=C2=A0 =C2=A0(set-fa= ce-attribute =C2=A0'b nil :foreground "yellow")
=C2=A0 =C2= =A0(set-face-attribute 'a nil :inherit 'b)
=C2=A0 =C2=A0(set-fac= e-foreground 'a (face-foreground 'default))
=C2=A0 =C2=A0;; let&= #39;s chase how 'a would render:
=C2=A0 =C2=A0(let
=C2=A0 =C2=A0= =C2=A0 =C2=A0((init (face-attribute 'a :foreground nil t))
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 final)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (set-face-foregr= ound 'default "pink")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq fi= nal (face-attribute 'a :foreground nil t))
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 (message "%S %S" init final)))

"\"white\&quo= t; \"white\""
Per your assertion, the message should have= been: white, pink.

Also, your point seems to be: We shouldn't a= llow nil (to clear inheritances) for :fg and :bg (unlike for other faces) b= ecause: "we only allow strings". I don't get that logi= c.=C2=A0



=

--00000000000052ce440594928999--