unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: sbaugh@catern.com
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Spencer Baugh <sbaugh@janestreet.com>,
	Eli Zaretskii <eliz@gnu.org>,
	66326@debbugs.gnu.org
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)	[thread overview]
Message-ID: <875y30t7jr.fsf@catern.com> (raw)
In-Reply-To: <CADwFkmmOoFXK6_Tyww_z++hgeqM=MhHHYrFuA_N9eQtRqmqPhw@mail.gmail.com> (Stefan Kangas's message of "Sat, 21 Oct 2023 02:12:13 -0700")

Stefan Kangas <stefankangas@gmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> 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.





  reply	other threads:[~2023-10-21 13:43 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
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 [this message]
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=875y30t7jr.fsf@catern.com \
    --to=sbaugh@catern.com \
    --cc=66326@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=sbaugh@janestreet.com \
    --cc=stefankangas@gmail.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).