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#57499: Documentation bug in the docstring of set-face-attribute? Date: Thu, 01 Sep 2022 17:56:30 +0300 Message-ID: <83r10vqh29.fsf@gnu.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> <534c9018d2f901e88b93@heytings.org> <837d2nshh7.fsf@gnu.org> <834jxrscu7.fsf@gnu.org> <831qsvs51j.fsf@gnu.org> <83sflbqotm.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6060"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57499-done@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 01 16:58:50 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 1oTlec-0001TF-32 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Sep 2022 16:58:50 +0200 Original-Received: from localhost ([::1]:39296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTleb-0001bk-4v for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Sep 2022 10:58:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTlcs-0007Sx-TR for bug-gnu-emacs@gnu.org; Thu, 01 Sep 2022 10:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTlcs-0002lj-IR for bug-gnu-emacs@gnu.org; Thu, 01 Sep 2022 10:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTlcs-0003xA-D2 for bug-gnu-emacs@gnu.org; Thu, 01 Sep 2022 10:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Sep 2022 14:57: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-done@debbugs.gnu.org id=D57499.166204417115130 (code D ref 57499); Thu, 01 Sep 2022 14:57:02 +0000 Original-Received: (at 57499-done) by debbugs.gnu.org; 1 Sep 2022 14:56:11 +0000 Original-Received: from localhost ([127.0.0.1]:43857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTlc2-0003vy-Ut for submit@debbugs.gnu.org; Thu, 01 Sep 2022 10:56:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTlc1-0003vk-Cu for 57499-done@debbugs.gnu.org; Thu, 01 Sep 2022 10:56:09 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTlbw-0002gj-5Y; Thu, 01 Sep 2022 10:56:04 -0400 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=feQ84WgD+ktIMD1nX485+AZKpkrBCC+lXtTu0sotu+c=; b=XaYfJxvD8dio yNk7gVmLh2Opx8lteMev4U0Kq2T22eYd8/iDNtEGYNlUlDhrhdlwGA8N+PTQjXdjIjIMPdkM2KhuQ RvArPdwbk57Ec8XGiDJDfJ7DOzDxdrAR166dwuPfln4jI5YNGIRpNkwvY9YzCyDlTKBWnxab72pq7 BL4FtionBUqRzm6oukkfCxBfXyFhO49mdMaryTC0zDBVpiW/+wkE9h9M87KAmAK/kUF4+goYQaTzi 7o6BUz/624dm9ynYQ9GeOJp+kzfJn54ZfZyK7pg8FXgYLRwArO8oWiD5ysb3vptlWffWDaNscKFnV mpAR8YqNZYxQ86exPTthiw==; Original-Received: from [87.69.77.57] (port=4962 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 1oTlbu-0002s0-QO; Thu, 01 Sep 2022 10:56:03 -0400 In-Reply-To: (message from Gregory Heytings on Thu, 01 Sep 2022 13:15:42 +0000) 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:241266 Archived-At: > Date: Thu, 01 Sep 2022 13:15:42 +0000 > From: Gregory Heytings > cc: 57499-done@debbugs.gnu.org > > >> Would a warning in *Messages* be okay then? > > > > We could try that, yes. But it has to be only in *Messages*, not an > > actual warning, since faces get merged and realized as part of > > redisplay, when signaling an error is a bad idea. > > > > Like this? I just checked, it passes make bootstrap and make check. Not exactly what I had in mind. > +char warning_attribute_nil[] = > + "Warning: using :%s nil with frame t has no effect."; I thought you wanted to warn about using nil where nil is not a valid value. The calls to the macro are all in the case where the actual problem is that nil is not a valid value, so the warning text is not what we want to convey (or so I thought). > + if (redisplaying_p) \ > + CALLN (Fmessage, \ > + build_string (warning_attribute_nil), \ > + build_string (S)); \ There's no need to use Fmessage, just add_to_log should be enough. > + else \ > + Fsignal (Quser_error, \ > + list1 (CALLN (Fformat, \ > + build_string (warning_attribute_nil), \ > + build_string (S)))); \ And I don't agree with signaling a user-error for these cases, when they are outside redisplay. For starters, the face code could be called during C-n or C-v or some other command that uses the display code internally. Signaling an error is only TRT if we stop supporting this back-compatibility shim.