From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christian Ohler Newsgroups: gmane.emacs.bugs Subject: bug#11218: with-demoted-errors use of condition-case-unless-debug; ert Date: Sun, 06 May 2012 11:45:07 -0700 Message-ID: <4FA6C6B3.7010403@gnu.org> References: <4F8DE112.5010106@gnu.org> <4F90D369.7070005@gnu.org> <4F91CEEF.20305@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1336329974 23837 80.91.229.3 (6 May 2012 18:46:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 May 2012 18:46:14 +0000 (UTC) Cc: 11218@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 06 20:46:13 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SR6TE-00027h-Ex for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 May 2012 20:46:12 +0200 Original-Received: from localhost ([::1]:43457 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SR6TD-00017t-Qw for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 May 2012 14:46:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SR6TA-00016F-2r for bug-gnu-emacs@gnu.org; Sun, 06 May 2012 14:46:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SR6T8-0002Va-9D for bug-gnu-emacs@gnu.org; Sun, 06 May 2012 14:46:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SR6T8-0002VW-5b for bug-gnu-emacs@gnu.org; Sun, 06 May 2012 14:46:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SR6V0-0007Fc-4U for bug-gnu-emacs@gnu.org; Sun, 06 May 2012 14:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christian Ohler Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 May 2012 18:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11218 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11218-submit@debbugs.gnu.org id=B11218.133633003627815 (code B ref 11218); Sun, 06 May 2012 18:48:02 +0000 Original-Received: (at 11218) by debbugs.gnu.org; 6 May 2012 18:47:16 +0000 Original-Received: from localhost ([127.0.0.1]:38810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SR6UG-0007Ea-9t for submit@debbugs.gnu.org; Sun, 06 May 2012 14:47:16 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:35822 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SR6UB-0007EP-CH for 11218@debbugs.gnu.org; Sun, 06 May 2012 14:47:12 -0400 Original-Received: from [72.14.225.65] (port=10675 helo=dhcp-172-16-8-100.lon.corp.google.com) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1SR6SG-0004ZY-EQ; Sun, 06 May 2012 14:45:12 -0400 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59823 Archived-At: 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.