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 21:13:58 +0000 Message-ID: <534c9018d2f901e88b93@heytings.org> References: <534c9018d2adffda3e53@heytings.org> <831qswu0p4.fsf@gnu.org> <534c9018d2f372cd7462@heytings.org> <83tu5ssi35.fsf@gnu.org> <534c9018d222586a161c@heytings.org> <83r10wsgu8.fsf@gnu.org> <534c9018d2952b7a6bd0@heytings.org> <83pmggs89x.fsf@gnu.org> <534c9018d2597d4fd752@heytings.org> <83fshcrzth.fsf@gnu.org> <534c9018d2c911550778@heytings.org> <83czcgry5f.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="27353"; 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 23:15:20 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 1oTV3P-0006uU-KJ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 23:15:19 +0200 Original-Received: from localhost ([::1]:41792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTV3O-0003H5-LE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 17:15:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTV39-0003Ea-M0 for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 17:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTV39-0004Jn-5Q for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 17:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTV39-0002Ws-1F for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2022 17:15:03 -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 21:15:03 +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.16619804439598 (code B ref 57499); Wed, 31 Aug 2022 21:15:03 +0000 Original-Received: (at 57499) by debbugs.gnu.org; 31 Aug 2022 21:14:03 +0000 Original-Received: from localhost ([127.0.0.1]:40640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTV2A-0002Uj-Ou for submit@debbugs.gnu.org; Wed, 31 Aug 2022 17:14:03 -0400 Original-Received: from heytings.org ([95.142.160.155]:49368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTV28-0002UC-2f for 57499@debbugs.gnu.org; Wed, 31 Aug 2022 17:14:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1661980438; bh=NiL6tki+jxG+ai7K67U2r4Qb9MpB+SPSeyU2DBE5tN0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=GVvRU2MZzFyu9V/t+shehDaSDj5etz/kKO1v+JDiX4ZpTQWULn6p4GJuv5odndOsB ImpDQiEvpuULVjMKcnLdWgT7AQigI7wDLqItf5JCZMK/wNXlRYqODCaOQ8Bk2aVH7Q lM9aCCo7B4+6DEw+Y59VgcsHf65Ib0bvlQ1hW2di3QEm0mjgBgvjGOp7CqeBxJXrXk dj5ChoVHfcigQADuoldU+/2j5gylpvpEJQaFmP4fiK16iD4EngAVLHcVLBfkGdssgx p1UWX3K6cRYRPF1bdCKPbopMhsbRcj1XSXVYTaDfLKVmk2cWc72Zrtr7Lbuktzjp8b KRv8WUBG7PG6A== In-Reply-To: <83czcgry5f.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:241225 Archived-At: > > I don't see the difference between my text and these two variants. Why > repeat that the value `unspecified' is a symbol `unspecified'? We never > say such tautological things in doc strings. > I just want to make it as clear as possible that to get that special value `unspecified' one should use the symbol 'unspecified. That might be unclear, because after using nil describe-face also displays `unspecified'. I bet that what happened with both Damien and Joost is that they wanted to unset the background/foreground color of a face, they tried to use nil (because that's the typical value one would use everywhere else in Elisp), and it seemed to work: describe-face said the attribute was "unspecified", and the visual effect was also that of an "unspecified" attribute. Later they discovered that for new frames it didn't work. > > Read the discussion in bug#54156 again! That's what it was about. > > Or read the code in xfaces which deals with value of unspecified when > FRAME = t -- it doesn't just store the symbol 'unspecified' in the > face's attribute, it does something more sneaky. And it interprets nil > as unspecified in some cases, but not in others. > > People stumble on these subtleties all the time, and the advice to use > an explicit separate call with FRAME = t in the current doc string was > intended to prevent that. And note that it did work in Joost's case: he > maybe didn't fully understand _why_ he needs to do it, but he did > understand _how_ to do what he wanted. Now we want to take that out, > because it hurts our excessive sense of rigor, and we will get the same > confusion back... > Hmmm... Joost's conclusion was that using frame = nil and 'unspecified solved his problem, and that he would do that. Just to be clear: I certainly do not want to take anything out. I simply do not understand (neither by testing nor by reading the code) what (set-face-attribute 'some-face t :some-attribute 'unspecified) does when (set-face-attribute 'some-face nil :some-attribute 'unspecified) has already been executed. And in fact that's how this bug report started: I asked whether anyone could come up with a scenario that would make the effect of that call with frame = t apparent. If there are cases where frame = t does something more, then clearly that information should stay in docstring. My reading of the code is that it doesn't do anything more, because calling set-face-attribute with nil implies that Finternal_set_lisp_face_attribute is called with frame = 0, which in turn implies that Finternal_set_lisp_face_attribute is (recursively) called with frame = t.