From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: sbaugh@catern.com Newsgroups: gmane.emacs.bugs Subject: bug#66326: 29.1.50; There should be a way to promote warnings to errors Date: Sat, 21 Oct 2023 13:43:37 +0000 (UTC) Message-ID: <875y30t7jr.fsf@catern.com> 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> <83bkcuty8v.fsf@gnu.org> <83v8b1sqtw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7954"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Spencer Baugh , Eli Zaretskii , 66326@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 21 15:44:51 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 1quCHa-0001mi-UZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Oct 2023 15:44:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quCHN-0002FM-6r; Sat, 21 Oct 2023 09:44:37 -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 1quCHL-00029o-Lw for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 09:44:35 -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 1quCHK-0007SM-NN for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 09:44:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quCHm-0000mc-C5 for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 09:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Oct 2023 13:45:02 +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.16978958532916 (code B ref 66326); Sat, 21 Oct 2023 13:45:02 +0000 Original-Received: (at 66326) by debbugs.gnu.org; 21 Oct 2023 13:44:13 +0000 Original-Received: from localhost ([127.0.0.1]:42588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quCGz-0000kx-Bc for submit@debbugs.gnu.org; Sat, 21 Oct 2023 09:44:13 -0400 Original-Received: from s.wrqvwxzv.outbound-mail.sendgrid.net ([149.72.154.232]:9004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quCGw-0000ke-SR for 66326@debbugs.gnu.org; Sat, 21 Oct 2023 09:44:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=SehU/G3UFBFDZBvls2swEhXSEw3hbo3KM7dpylY4iaQ=; b=W48MFN+HkocEf4zuVRPDkynNOU6G87pAo7bYsT0ACYiYjIoF8lIt/HayBIZCg36lU+7b K3zDyZ1qo/W6iyuDk8AU1OXh+Nc+eddRuKbxlX/Cb4uwgekkJNb3T015kRwFEJm9N4kWp9 S4UNaxCjCNYPicjsXDUv8AT9tUHFZyO/SGSvInPJNVlXZKvudB9i/2B0hirv2kmE/29xNZ PTRPf27EkQbjdWXAV7dk8XVAxwUVqoiM/OEBRXhPzFcdEQ7lQOPkvu78OP/TteirxbDSEN qIBS+oobWNHAIjC/8FJj+0VkWasgk50vsE7wGoL2AsNBlq8IrrDTKOiUerTk54Fw== Original-Received: by filterdrecv-6b68c9f446-6b4qx with SMTP id filterdrecv-6b68c9f446-6b4qx-1-6533D589-4 2023-10-21 13:43:37.209210931 +0000 UTC m=+327766.147304608 Original-Received: from earth.catern.com (unknown) by geopod-ismtpd-23 (SG) with ESMTP id CBTKiHlaR2uHmV0d8b8GsQ Sat, 21 Oct 2023 13:43:37.117 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gmail.com Original-Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id B48006360E; Sat, 21 Oct 2023 09:43:36 -0400 (EDT) In-Reply-To: (Stefan Kangas's message of "Sat, 21 Oct 2023 02:12:13 -0700") X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbJkNGrFwuzOjR9KQDML0/bQw5kuZqByWzpyC8fDEcAGt0BqIUApx4xgaj51jnfkscPVT6apQPolDUjM94qpW8c88sBrrjF7pORJA3u5s+RTErJjwTlHRmRmEC5ysVRN3YA8Gp875KJMbgi8XEgMQKAcPE4fLW+eB3XZqRsc0oNacA== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== 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:272901 Archived-At: Stefan Kangas writes: > Eli Zaretskii writes: > >> More generally, I'm worried by the tendency of people to submit >> patches for Emacs as soon as they find something they think is missing >> in Emacs that they need for some one-time job. Emacs is not supposed >> to be a huge heap of random features that someone at some time found >> useful for some random job. Emacs is Free Software: you can easily >> implement this stuff in your local copy and use it as much as you >> want; no need to add that to the Emacs core, unless there's a real >> need for it expressed by enough people, and no better solutions in >> hand. I do this for my local jobs all the time. > > FWIW, I'm generally always in favor of features that make the Emacs Lisp > developers' lives easier, and as much as I appreciate that some users > might want to debug warnings, I don't think I understand the use case(s). I see, let me try to explain further. (BTW, before submitting I discussed the idea of this patch on #emacs on Libera IRC and people seemed interested and approving, which is why I assumed this would be uncontroversial. If I had realized I would have sent it to emacs-devel.) I had some warnings and I went to debug them, and I assumed there would be some kind of debug-on-warning like how there is debug-on-error and debug-on-message and debug-on-quit. But there is not. So I figured it would be uncontroversial to add something which enables a debug-on-warning, since right now it is difficult to find out what code triggered some warning. The alternative which I've been using is (debug-on-entry 'display-warning) but this: 1. always debugs regardless of what kind of warning 2. isn't helpful for the "automated tests where warnings should fail the test" use case > These questions come to mind: > > - Are there many warnings during startup? No. But also it's not just startup. > - Why are they a problem (can't they just be ignored)? Well, sure, but they pop up a *Warnings* buffer which is annoying to users, so it would be better to get rid of them. > - If some code warns, presumably it's a real issue and should be fixed > by the user, not in the code. Otherwise it should be an error. No? Yes, but sometimes either: - a warning happens because of bugs in other code, so the proper way to fix the warning is to fix those other bugs - More relevantly, sometimes it's hard to find out what is causing the warning. > - Why can't users add an advice to `display-warning' that simply calls > `error' or somesuch? Or even just redefine it? That would work. But it's harder to tell a user to do that than (setq debug-on-warning t) or some equivalent. > Perhaps this feature would be better as a GNU ELPA package > `debug-warnings' or something like that, so that the community could get > more experience with it. If it catches on, perhaps we could consider > adding it to core. Would that way of working make sense? Telling one of my users to install some other package to debug an issue is a bit much. I would probably just guide them through using debug-on-entry instead.