unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: 66326@debbugs.gnu.org
Subject: bug#66326: 29.1.50; There should be a way to promote warnings to errors
Date: Tue, 03 Oct 2023 21:57:50 +0300	[thread overview]
Message-ID: <83y1gj5ya9.fsf@gnu.org> (raw)
In-Reply-To: <iero7hfv9dl.fsf@janestreet.com> (message from Spencer Baugh on Tue, 03 Oct 2023 14:39:02 -0400)

> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Tue, 03 Oct 2023 14:39:02 -0400
> 
> +(defcustom warning-to-error-types nil
> +  "List of warning types to signal as an error instead.
> +If any element of this list matches the TYPE argument to `display-warning',
> +an error is signaled instead of logging a warning.
   ^^^^^^^^^^^^^^^^^^^^
Passive voice alert!

>  (defun display-warning (type message &optional level buffer-name)
>    "Display a warning message, MESSAGE.
> @@ -263,105 +278,109 @@ display-warning
>  disable automatic display of the warning or disable the warning
>  entirely by setting `warning-suppress-types' or
>  `warning-suppress-log-types' on their behalf."
> -  (if (not (or after-init-time noninteractive (daemonp)))
> -      ;; Ensure warnings that happen early in the startup sequence
> -      ;; are visible when startup completes (bug#20792).
> -      (delay-warning type message level buffer-name)
> -    (unless level
> -      (setq level :warning))
> -    (unless buffer-name
> -      (setq buffer-name "*Warnings*"))
> +  (unless level
> +    (setq level :warning))
> +  (unless buffer-name
> +    (setq buffer-name "*Warnings*"))
> +  (cond
> +   ((< (warning-numeric-level level)
> +       (warning-numeric-level warning-minimum-log-level)))
> +   ((warning-suppress-p type warning-suppress-log-types))
> +   ((warning-suppress-p type warning-to-error-types)
> +    (warning-to-error type message level))
> +   ((not (or after-init-time noninteractive (daemonp)))
> +    ;; Ensure warnings that happen early in the startup sequence
> +    ;; are visible when startup completes (bug#20792).
> +    (delay-warning type message level buffer-name))
> +   (t

AFAICT, this reorders parts of the evaluation, and thus changes the
semantics/behavior.  Please try to keep the order of the evaluation
the same as it was, to avoid unintended consequences.  (It will also
make the patch review easier.)

Thanks.





  reply	other threads:[~2023-10-03 18:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03 16:38 bug#66326: 29.1.50; There should be a way to promote warnings to errors Spencer Baugh
2023-10-03 18:39 ` Spencer Baugh
2023-10-03 18:57   ` Eli Zaretskii [this message]
2023-10-03 19:16     ` sbaugh
2023-10-04  5:59       ` Eli Zaretskii
2023-10-04 12:20         ` Spencer Baugh
2023-10-14  7:27           ` Eli Zaretskii
2023-10-14 22:25             ` sbaugh
2023-10-15  5:45               ` Eli Zaretskii
2023-10-16 19:26                 ` Spencer Baugh
2023-10-19 12:13                   ` Eli Zaretskii
2023-10-19 14:50                     ` Spencer Baugh
2023-10-19 15:07                       ` Eli Zaretskii
2023-10-19 15:18                         ` Spencer Baugh
2023-10-19 15:42                           ` Eli Zaretskii
2023-10-19 16:15                             ` Spencer Baugh
2023-10-20  7:20                               ` Eli Zaretskii
2023-10-21  9:12                                 ` Stefan Kangas
2023-10-21 13:43                                   ` sbaugh
2023-11-10 21:40                                     ` Spencer Baugh
2023-11-11  7:02                                       ` Eli Zaretskii
2023-11-11 14:37                                         ` Spencer Baugh
2023-11-11 14:51                                           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y1gj5ya9.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=66326@debbugs.gnu.org \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).