From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#54156: 28.0.91; set-face-attribute with a nil FRAME doesn't change the default Date: Fri, 25 Feb 2022 15:03:02 +0200 Message-ID: <83bkyvqet5.fsf@gnu.org> References: <87ilt3456u.fsf@cassou.me> <87ee3rxhuj.fsf@gnus.org> <83ee3rqgia.fsf@gnu.org> <87y21zw2ll.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14961"; mail-complaints-to="usenet@ciao.gmane.io" Cc: damien@cassou.me, 54156@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 25 14:37:23 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 1nNamh-0003iq-2Q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Feb 2022 14:37:23 +0100 Original-Received: from localhost ([::1]:35108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNamf-0003wY-Dl for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Feb 2022 08:37:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNaFS-0001Zt-TE for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2022 08:03:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57624) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNaFS-0001tJ-KM for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2022 08:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNaFR-0005le-M7 for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2022 08:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Feb 2022 13:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54156 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 54156-submit@debbugs.gnu.org id=B54156.164579417622156 (code B ref 54156); Fri, 25 Feb 2022 13:03:01 +0000 Original-Received: (at 54156) by debbugs.gnu.org; 25 Feb 2022 13:02:56 +0000 Original-Received: from localhost ([127.0.0.1]:51521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNaFL-0005lI-Oz for submit@debbugs.gnu.org; Fri, 25 Feb 2022 08:02:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNaFK-0005l3-3N for 54156@debbugs.gnu.org; Fri, 25 Feb 2022 08:02:54 -0500 Original-Received: from [2001:470:142:3::e] (port=56888 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNaFE-0001sL-0M; Fri, 25 Feb 2022 08:02:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=XJTGay5NpLUeothyzDp2QWcxnQyLrOm4K9MuEJ3GdNc=; b=eV2+r2EkB5oJ 9eVuvPLroDLA1+E5uUsF3B/twsS1stcUjnOnlKlLTINdhHSZEzdOhZoFnXdk/u/9NYoBRR9qZ19Mt 6itLmpP4H61Xy2bvaVtg0WebL8NtGHh4T7INYsJ58vAx87edAaFxZFSXEt7uMLEZma4hfBJrlMX14 10FOV6KmwEGlQBWIK8EMxmG7qUxPNSjvYJlI1+x3bBwf95DdEOG+R+vY4n8xWnRoQuZegPvpS+mQQ /t20rFI2oN6G8MS4hwJ1snoc2repsJTxpTyDvNRczvo110fQkv4WecRrMP6K8Th/XfVRuchV2l+N3 MRHRocr7Mfzm4KX0tQXIrA==; Original-Received: from [87.69.77.57] (port=3241 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNaFD-0004M8-Eq; Fri, 25 Feb 2022 08:02:47 -0500 In-Reply-To: <87y21zw2ll.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 25 Feb 2022 13:30:14 +0100) 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:227630 Archived-At: > From: Lars Ingebrigtsen > Cc: damien@cassou.me, 54156@debbugs.gnu.org > Date: Fri, 25 Feb 2022 13:30:14 +0100 > > Eli Zaretskii writes: > > > Does this issue happen only with the nil values of :background? If > > so, may I ask what do you and Damien think should be the effect of > > setting the background color of a face to nil? > > That there is no background colour on the face -- that's the effect of > doing that (but only on existing frames). But that's not what nil does in this case. It means the same as 'unspecified': that you have nothing to say about that particular attribute. So Emacs does nothing. Think about it: any face attribute not explicitly mentioned in a defface is set to 'unspecified' by the low-level code. This is basic in how faces are handled in Emacs; we cannot easily change that without breaking gobs of code. Moreover, attributes of the faces for future frames, the ones you get by calling face-attribute with FRAME = t, are documented to be 'unspecified' by default. The correct way to do what Damien wants (AFAIU) is this: (set-face-attribute 'region nil :background 'unspecified) (set-face-attribute 'region t :background 'unspecified) That is, one must explicitly call set-face-attribute with FRAME = t (as well as nil), and pass 'unspecified' (NOT nil!) as the value. Maybe we should document that, although it is a obscure and unusual thing to do.