From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#66326: 29.1.50; There should be a way to promote warnings to errors Date: Thu, 19 Oct 2023 11:18:53 -0400 Message-ID: References: <83y1gj5ya9.fsf@gnu.org> <87wmw3zfd3.fsf@catern.com> <83wmw353ny.fsf@gnu.org> <83mswlslxu.fsf@gnu.org> <87o7h0yh7k.fsf@catern.com> <83a5skqvzz.fsf@gnu.org> <83r0lqu7wi.fsf@gnu.org> <83cyxatzva.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13988"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@catern.com, 66326@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 19 17:20:15 2023 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 1qtUom-0003Q3-0U for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Oct 2023 17:20:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtUoI-0007bJ-6q; Thu, 19 Oct 2023 11:19:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtUoF-0007b1-ET for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 11:19:41 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtUoB-0001BM-Kl for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 11:19:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtUob-00056C-SL for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 11:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Oct 2023 15:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66326 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66326-submit@debbugs.gnu.org id=B66326.169772876819552 (code B ref 66326); Thu, 19 Oct 2023 15:20:01 +0000 Original-Received: (at 66326) by debbugs.gnu.org; 19 Oct 2023 15:19:28 +0000 Original-Received: from localhost ([127.0.0.1]:37493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtUo3-00055I-S1 for submit@debbugs.gnu.org; Thu, 19 Oct 2023 11:19:28 -0400 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:40811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtUo1-000555-CV for 66326@debbugs.gnu.org; Thu, 19 Oct 2023 11:19:26 -0400 In-Reply-To: <83cyxatzva.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 19 Oct 2023 18:07:21 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272747 Archived-At: Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: sbaugh@catern.com, 66326@debbugs.gnu.org >> Date: Thu, 19 Oct 2023 10:50:59 -0400 >> >> >> What is the good reason that we delay warnings? >> > >> > Because Emacs is not yet able to display stuff reliably, for example. >> > Or the display environment was not yet set up completely. >> >> Right. But that is not a concern for errors. > > It is a concern for displaying anything and everything. Could you be more specific? Is there a way to signal an error during startup, which won't be displayed? >> So there's no need to do extra work to delay errors in warnings.el. > > Yes, there is. Can you please elaborate? What exactly will go wrong if we don't delay errors in warnings.el? >> >> But OK, attached is a new patch which adds an option to immediately >> >> raise the warnings converted into errors during startup, instead of >> >> delaying them. So the default is to delay the error until after >> >> startup. Does this work? >> > >> > Did you test that? If you did, what happens with delayed warnings >> > when the new option is nil? >> >> They continue to be delayed. If a warning is turned into an error, the >> error is signaled by delayed-warnings-hook, run by after-init-hook. > > Delayed and shown how? Can you show a screenshot or post the contents > of the buffer with the error message? With (setq warning-to-error-types t) ;;(setq warning-signal-errors-during-startup nil) ; default (warn "foo") The following appears in the echo area and in *Messages*: warning-to-error: Warning (emacs): foo Error in delayed-warnings-hook (display-delayed-warnings): (error "Warning (emacs): foo")