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#66326: 29.1.50; There should be a way to promote warnings to errors Date: Tue, 03 Oct 2023 21:57:50 +0300 Message-ID: <83y1gj5ya9.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12872"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66326@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 03 21:00:03 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 1qnkcc-0002io-2R for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Oct 2023 20:59:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnkbj-0000ZH-CC; Tue, 03 Oct 2023 14:59:00 -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 1qnkbX-0000ND-3g for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2023 14:58:47 -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 1qnkbV-0007xU-2R for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2023 14:58:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qnkbl-0002dr-Vy for bug-gnu-emacs@gnu.org; Tue, 03 Oct 2023 14:59: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: Tue, 03 Oct 2023 18:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66326 X-GNU-PR-Package: emacs Original-Received: via spool by 66326-submit@debbugs.gnu.org id=B66326.169635951910112 (code B ref 66326); Tue, 03 Oct 2023 18:59:01 +0000 Original-Received: (at 66326) by debbugs.gnu.org; 3 Oct 2023 18:58:39 +0000 Original-Received: from localhost ([127.0.0.1]:40710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnkbO-0002d2-Br for submit@debbugs.gnu.org; Tue, 03 Oct 2023 14:58:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qnkb9-0002cR-QA for 66326@debbugs.gnu.org; Tue, 03 Oct 2023 14:58:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnkaa-0007Ug-M4; Tue, 03 Oct 2023 14:57:57 -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=vxXO+ldZR3/f1UmoL+T/whH0XDZJgoRIJxZiP3DNlIs=; b=rBIXQ+Q6t+UJ W86fHdpTZpx2iAeK7E5PMOHOBj+310VlFwEkVJ3sLf/I5SdNM+/CN40vAYZpej4bGYZ4T2qcsd7rI CED9EwxX9Bfm5Unp0BPDPqYX3ijAfUS+JTIL5y3khRrHjyyDhMpNi2Azpm2GbF7KUAByRfW1yWv2A p0xm5VgjQEkuyl3VssXbsFE5Vslsg6rs9SnPx/SjdXoDbh//uPDqJMLP6UGtQ4tkzYPhPD6macpCq aq3k4MBoSRJLjzCdc7eeIHIapsTWsdazc6eqQjUpYck7QlSEfgH3ga45WJZ6/HKUgILi3hJgZ2suQ ysZzqX8V6Qn4gIZeko2QdA==; In-Reply-To: (message from Spencer Baugh on Tue, 03 Oct 2023 14:39:02 -0400) 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:271729 Archived-At: > From: Spencer Baugh > 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.