unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Christian Ohler <ohler@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 11218@debbugs.gnu.org
Subject: bug#11218: with-demoted-errors use of condition-case-unless-debug; ert
Date: Sun, 06 May 2012 11:45:07 -0700	[thread overview]
Message-ID: <4FA6C6B3.7010403@gnu.org> (raw)
In-Reply-To: <jwvsjfxstne.fsf-monnier+emacs@gnu.org>

Stefan Monnier, 2012-04-20:

>>> I don't see the point of showing that info when running the tests.
>>> If the user wants that info, he should be able to easily say "run this
>>> test with debug-on-error" so he doesn't only get a backtrace but also
>>> gets put in the debugger where he can inspect the state.
>
>> ERT's keyboard shortcut for that is "d".  But it's not a good solution if:
>
>> * the test is nondeterministic (maybe due to subprocess interaction),
>> * the test takes a long time to run,
>> * you have multiple failing tests and want to quickly compare if they are
>> crashing in the same place,
>> * ERT is running in batch mode (e.g. make check).
>
>> It's better to collect as much data as reasonably possible when the error
>> first occurs.
>
> None of these arguments are really specific to ERT.  It just seems like
> you like to run with debug-on-error, which is fine (I do too).

ERT's default behavior is very different from using Emacs with 
debug-on-error enabled, so in terms of what the user sees, I don't think 
this analogy works very well.


> But don't impose it on all ERT users.

This is not a matter of user preference.  Collecting additional 
information about why the test failed is useful to virtually everyone 
who bothers running the test; there should be no reason not to.  (Even 
if the user doesn't care about the details, it will at least allow them 
to file a better bug report.)  The problem is that the implementation 
doesn't interact well with `with-demoted-errors'.  But that problem is 
not user- or situation-dependent, so it shouldn't be a setting.


>>> No: you'll be put in the debugger for the error "a" but if you hit `c'
>>> it will continue and re-enter the debugger for error "b".
>> My Emacs is a few months old, but that doesn't work for me.  Has it
>> changed recently?
> [...]
>> If `debug-on-error' is t, `with-demoted-errors' becomes essentially
>> equivalent to `progn', and (error "b") can ever be reached in
>
> You're right, sorry: brain malfunction.
> But that just means you first have to fix the bug that signals "a" before
> getting to the bug that signals "b".

If it were that simple, this would be the solution to the OP's problem 
as well: Just fix the errors that are being demoted.

It's a bad solution, though; the user shouldn't have to do this. 
Enabling the debugger should not change the behavior of the code being 
debugged.  It's a design flaw in `with-demoted-errors' that its behavior 
depends on the same variable that controls the debugger.  The proper 
solution is to decouple the behaviors, perhaps by splitting the 
variable, perhaps by some other means.

Christian.






  parent reply	other threads:[~2012-05-06 18:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11  3:37 bug#11218: with-demoted-errors use of condition-case-unless-debug; ert Glenn Morris
2012-04-11 12:03 ` Lars Magne Ingebrigtsen
2012-04-11 16:16   ` Glenn Morris
2012-04-11 16:28     ` Glenn Morris
2012-04-11 17:57       ` Stefan Monnier
2012-04-11 13:02 ` Stefan Monnier
2012-04-13  0:15   ` Glenn Morris
2012-04-13 13:44     ` Stefan Monnier
2012-04-17 21:30       ` Christian Ohler
2012-04-19  7:46         ` Stefan Monnier
2012-04-20  3:09           ` Christian Ohler
2012-04-20 12:13             ` Stefan Monnier
2012-04-20 21:02               ` Christian Ohler
2012-04-21  2:34                 ` Stefan Monnier
2012-04-23 13:26                   ` Lennart Borgman
2012-04-24  2:04                     ` Stefan Monnier
2012-05-06 18:45                   ` Christian Ohler [this message]
2012-05-07  1:12                     ` Stefan Monnier
2012-05-21  3:03                       ` Christian Ohler
2018-08-15  1:10         ` Noam Postavsky
2020-11-24 17:34           ` Philipp Stephani

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=4FA6C6B3.7010403@gnu.org \
    --to=ohler@gnu.org \
    --cc=11218@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).