From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#57652: 29.0.50; Warning setting attribute of face =?UTF-8?Q?=E2=80=98term=E2=80=99?= Date: Thu, 08 Sep 2022 17:44:28 +0600 Message-ID: <87czc69jkz.fsf@disroot.org> References: <5f92d116-3cfd-e4b4-0caf-b2337fa1bd7f@orange.fr> <878rmua277.fsf@yahoo.com> <319e3926-7c22-cabd-43dd-a02f3a01c734@orange.fr> Reply-To: Akib Azmain Turja Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3058"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , 57652@debbugs.gnu.org, gregory@heytings.org To: David Ponce Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 08 14:13:30 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWGPR-0000ZY-Qo for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Sep 2022 14:13:30 +0200 Original-Received: from localhost ([::1]:58384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWGPQ-0007lA-R4 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Sep 2022 08:13:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWGO3-0006RH-8y for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 08:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWGO2-0004oa-Vj for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 08:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oWGO2-00064t-QW for bug-gnu-emacs@gnu.org; Thu, 08 Sep 2022 08:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Akib Azmain Turja Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Sep 2022 12:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57652 X-GNU-PR-Package: emacs Original-Received: via spool by 57652-submit@debbugs.gnu.org id=B57652.166263907023259 (code B ref 57652); Thu, 08 Sep 2022 12:12:02 +0000 Original-Received: (at 57652) by debbugs.gnu.org; 8 Sep 2022 12:11:10 +0000 Original-Received: from localhost ([127.0.0.1]:57433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWGNB-000634-Ra for submit@debbugs.gnu.org; Thu, 08 Sep 2022 08:11:10 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:42034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWGN6-00062t-Cg for 57652@debbugs.gnu.org; Thu, 08 Sep 2022 08:11:09 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id BBA4D49FEC; Thu, 8 Sep 2022 14:11:03 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id Bd0lIUxhz8iQ; Thu, 8 Sep 2022 14:11:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662638960; bh=FisYz0kzFFg55asvoUbvhKScAxT7hE4you1TaFbyFfs=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Y5mA2iwzvrn9yTwcB7iMIAx1rHPb0lAFnFWYY9Z8Icv3kYAkIXtnkh1Rc1GFjb4lV yYbMGbPc2e548gnpLCjdxEIhoAGkhFr8NJTLy1zXMRfuB2+bcK+y/ui74dhK8Jyl3u S+CI3wxAEfrqrUeBrUSS1YgOoffVKrgEaB7dWAvqN8k0R4mXb8VMxngFUZjtueiRhn 9zLITdwtlZf6+qhK9UTsEDq2h5Q0PLcG9siTE7SeJCa9jRAtpX5LHkTTf0QEcTDP1U 3BA6UBO4LtCti3Pkb8S/ol1hiNE5Lqe6ozoe+9sjmHTo6u+Jpm9Eme2fKsLYaR4KC4 5LfRuT7MwnXIg== In-Reply-To: <319e3926-7c22-cabd-43dd-a02f3a01c734@orange.fr> (David Ponce's message of "Thu, 8 Sep 2022 10:22:31 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:241860 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable David Ponce writes: > On 08/09/2022 07:02, Po Lu wrote: >> David Ponce writes: >>=20 >>> diff --git a/term.el b/term.el >>> index 797fb18074..c564a5429a 100644 >>> --- a/term.el >>> +++ b/term.el >>> @@ -755,17 +755,19 @@ ansi-term-color-vector >>> term-color-bright-cyan >>> term-color-bright-white]) >>> >>> -(defcustom term-default-fg-color nil >>> - "If non-nil, default color for foreground in Term mode." >>> +(defcustom term-default-fg-color 'unspecified >>> + "Default color for foreground in Term mode." >>> :group 'term >>> - :type '(choice (const nil) (string :tag "color"))) >>> + :type '(choice (const unspecified) >>> + (string :tag "color"))) >> Doesn't that change behavior? >> i.e. wouldn't it be better to test that term-default-fg-color is not >> nil >> wherever the face is actually made that color? > > To be honest I don't know. I reread the spec that says: > > "Apart from the values given below, each face attribute can have the > value =E2=80=98unspecified=E2=80=99. This special value means that the f= ace doesn=E2=80=99t > specify that attribute directly. An =E2=80=98unspecified=E2=80=99 attrib= ute tells Emacs > to refer instead to a parent face (see the description =E2=80=98:inherit= =E2=80=99 > attribute below); or, failing that, to an underlying face (*note > Displaying Faces::). (However, =E2=80=98unspecified=E2=80=99 is not a va= lid value in > =E2=80=98defface=E2=80=99.)" > > So it seems that unspecified is not allowed in defface. So, how to > specify a missing attribute excepted by using nil in the defface used > in term.el? > > (defface term > `((t > :foreground ,term-default-fg-color > :background ,term-default-bg-color > :inherit default)) > "Default face to use in Term mode." > :group 'term) > > Thanks! > > > > How about the following? =2D-8<---------------cut here---------------start------------->8--- (defface term `((t ,@(when term-default-fg-color '(:foreground ,term-default-fg-color)) ,@(when term-default-bg-color '(:background ,term-default-bg-color)) :inherit default)) "Default face to use in Term mode." :group 'term) =2D-8<---------------cut here---------------end--------------->8--- It would not mention the attributes if the colors are nil. =2D-=20 Akib Azmain Turja Find me on Mastodon at @akib@hostux.social. This message is signed by me with my GnuPG key. Its fingerprint is: 7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmMZ1ZwACgkQVTX89U2I YWt7ERAAmzEc1BrZxqZqFew0o1s8HIcfZJNRAwKuon60idqMcAtNJ8KkbCUynb30 TJU/2uH0nVe3qm5b6hpi6bgOsTiIzbOf7/abXB9DtlzTvv4jcvNymmv7DZiQdyXY hgBH4iXYxlL0taqSLD9pqk+7/qwDh5718SCMamj7XBzh7SaPr9BJy6yfPu3MKWd1 M4CX1gs4dpUEmBIx+tWnHwF8iwQlznw08+GURKoRMuEhd1pXurEJxEjCBa2rnFuW w8UbfziJdMigkCJW37ZN+LWkckmaHmdJGgv0TEVcGik+ncnvjIi46QILr8cc0Y6J s46moW72+1y/1RRPfDyr2Kv86wt0Ek+2Seei6W5d/8wEaU3M5jLqTthdLesmQGEi Vdz2GEfGnt15GK5YuXmiFxoAjsTlN5gYgalQL4CNJpSsUYq0lSgEMkJ0cqcX/+Dp a9y5zU6o4kRgTrijsimpizoSaGSCZuqeh9z9xNywJ2JtZH76CAOH/eCvVdBo9PrV 1yj8oqthfsY3gXrvFaf+TottB3EDLHZXWWP4nY5tFt0NkPsu0sbrCQzkRVm9NU45 2HwNEbdecJeWsBcRKf4lR4QzbkGu9JzpOsvy3xNY8dKZtB9VHwZRrXbF4XDMLr++ 0rdfg/5bpLJ16OvmF9F4ucsI9eixvGa/zjx0hj8PFcfV5TbtrjI= =nYTX -----END PGP SIGNATURE----- --=-=-=--