From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#57499: Documentation bug in the docstring of set-face-attribute? Date: Wed, 31 Aug 2022 12:04:03 +0000 Message-ID: <534c9018d2f372cd7462@heytings.org> References: <534c9018d2adffda3e53@heytings.org> <831qswu0p4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15684"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57499@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 31 14:05:41 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 1oTMTU-0003tB-S1 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 14:05:40 +0200 Original-Received: from localhost ([::1]:59390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTMTT-0002Js-QC for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 08:05:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56736) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTMSt-0001b9-1L for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 08:05:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTMSs-0000Fz-OT for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 08:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTMSs-0000VP-Ju for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 08:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Aug 2022 12:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57499 X-GNU-PR-Package: emacs Original-Received: via spool by 57499-submit@debbugs.gnu.org id=B57499.16619474501862 (code B ref 57499); Wed, 31 Aug 2022 12:05:02 +0000 Original-Received: (at 57499) by debbugs.gnu.org; 31 Aug 2022 12:04:10 +0000 Original-Received: from localhost ([127.0.0.1]:38449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTMS2-0000Ty-55 for submit@debbugs.gnu.org; Wed, 31 Aug 2022 08:04:10 -0400 Original-Received: from heytings.org ([95.142.160.155]:48714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTMRx-0000Tl-Mp for 57499@debbugs.gnu.org; Wed, 31 Aug 2022 08:04:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1661947444; bh=3CHFspDp6mCUBLl+vYmpY5luJ67XqHk2dcBMyQzf6Pg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=ldXSJkgMRdDHHy1BoJnUIcgERSxq05iFDOl5379rajfAhAKYtaED32bv0MOETKncE L/14s0YAdJP9kT5xPdgaR6tl6YpDKAEEyLFLYxNfcQI2K+6mL3x8qCnSg6C8ygxUqh aG+kkjtsWiHLLfcp7wotWx64NuVZ7+yXoThKF+nKvQ2pd7cPe/MN1+Nle+Ru0fN1YP uUzg/WT7PBjH1jrlY2w3cnM8Qpha0W54ctR+u8ft2048ChUuuAtGVXVxNAdr50Nn3u gPOMCAfUuGoc44b1DbBhqltyJ4wCAxpv9EoSlFVe8GDbHUjogCwqH22kqEvPuL5o+N TxOG44h2nGhbA== In-Reply-To: <831qswu0p4.fsf@gnu.org> 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:241189 Archived-At: >> The docstring of set-face-attribute says: >> >> "As an exception, to reset the value of some attribute to `unspecified' >> in a way that overrides the non-`unspecified' value defined by the >> face's spec in `defface', for new frames, you must explicitly call this >> function with FRAME set to t and the attribute's value set to >> `unspecified'; just using FRAME of nil will not affect new frames in >> this case." >> >> Not only is that sentence hard to parse, it also seems wrong. >> >> Can someone come up with a scenario in which a call >> >> (set-face-attribute 'some-face nil :some-attribute 'unspecified) >> >> only affects existing frames? In my testing it affects all frames >> (existing and future ones), and that's also what the code seems to do: >> set-face-attribute sets where to 0 when frame is nil, and calls >> internal-set-lisp-face-attribute with frame = 0, which according to the >> docstring of internal-set-lisp-face-attribute "means change the face on >> all frames, and change the default for new frames". > > This was discussed in bug#54156. Are there any new findings or > considerations that would require to reopen that discussion? > As far as I can tell, there are, but if you disagree, feel free to close the bug. Bug#54156 starts with someone telling that (set-face-attribute 'some-face nil :background nil) did not have an effect in new frames. To which you replied: > > The correct way to do [that] is this: > > (set-face-attribute 'some-face nil :background 'unspecified) > (set-face-attribute 'some-face 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. > and you later added that the call with frame = t is "a special trick to override defface with 'unspecified'". It seems however that the call with frame = t is unnecessary, or at least, I could not come up with a scenario in which the first call does not also affect new frames.