bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66326: 29.1.50; There should be a way to promote warnings to errors


From: Spencer Baugh
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
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Spencer Baugh <sbaugh@janestreet.com>
>> 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")





reply via email to

[Prev in Thread] Current Thread [Next in Thread]