GNU bug report logs - #9329
24.0.50; `condition-case' with (debug...) is broken

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Fri, 19 Aug 2011 03:51:02 UTC

Severity: normal

Found in version 24.0.50

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9329 in the body.
You can then email your comments to 9329 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9329; Package emacs. (Fri, 19 Aug 2011 03:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 19 Aug 2011 03:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.50; `condition-case' with (debug...) is broken
Date: Thu, 18 Aug 2011 20:47:57 -0700
(let ((debug-on-error  t)
      (eval-expression-debug-on-error  t))
  (condition-case nil (/ 1 0)
    ((debug error) "Test")))
 
The debugger is not opened.  In Emacs 23.3 it is opened (as the doc says
it should be).
 

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-08-15 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt'
 





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9329; Package emacs. (Fri, 19 Aug 2011 12:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 9329 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 9329 <at> debbugs.gnu.org
Subject: Re: bug#9329: 24.0.50; `condition-case' with (debug...) is broken
Date: Fri, 19 Aug 2011 14:32:47 +0200
"Drew Adams" <drew.adams <at> oracle.com> writes:

> (let ((debug-on-error  t)
>       (eval-expression-debug-on-error  t))
>   (condition-case nil (/ 1 0)
>     ((debug error) "Test")))
>
> The debugger is not opened.  In Emacs 23.3 it is opened (as the doc says
> it should be).

---
The car of a handler may be a list of condition names
instead of a single condition name.  Then it handles all of them.
---

So it seems to be doing what it's supposed to be doing.

Is this what you wanted to say instead?

(condition-case error
    (/ 1 0)
  (error
   (debug error)
   "Test"))

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9329; Package emacs. (Fri, 19 Aug 2011 13:21:02 GMT) Full text and rfc822 format available.

Message #11 received at 9329 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Lars Magne Ingebrigtsen'" <larsi <at> gnus.org>
Cc: 9329 <at> debbugs.gnu.org
Subject: RE: bug#9329: 24.0.50; `condition-case' with (debug...) is broken
Date: Fri, 19 Aug 2011 06:18:16 -0700
> > (let ((debug-on-error  t)
> >       (eval-expression-debug-on-error  t))
> >   (condition-case nil (/ 1 0)
> >     ((debug error) "Test")))
> >
> > The debugger is not opened.  In Emacs 23.3 it is opened (as 
> > the doc says it should be).
> 
> The car of a handler may be a list of condition names
> instead of a single condition name.  Then it handles all of them.

Yes. So? (debug error) is a list of condition names.  It is the car of a handler
(the only handler).

> So it seems to be doing what it's supposed to be doing.

No.  Check the doc.  Check Emacs 23 - e.g., 23.3.1.

> Is this what you wanted to say instead?
> (condition-case error
>     (/ 1 0)
>   (error (debug error) "Test"))

No.

C-h i, Elisp, g handling errors

"If an error is handled by some `condition-case' form, this
ordinarily prevents the debugger from being run, even if
`debug-on-error' says this error should invoke the debugger.

If you want to be able to debug errors that are caught by a
`condition-case', set the variable `debug-on-signal' to a non-`nil'
value.  You can also specify that a particular handler should let the
debugger run first, by writing `debug' among the conditions, like this:

     (condition-case nil
         (delete-file filename)
       ((debug error) nil))
"

Put the cursor after that sexp.  `C-x C-e'.  Do the same thing in Emacs 23.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9329; Package emacs. (Sat, 20 Aug 2011 21:20:02 GMT) Full text and rfc822 format available.

Message #14 received at 9329 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 9329 <at> debbugs.gnu.org
Subject: Re: bug#9329: 24.0.50; `condition-case' with (debug...) is broken
Date: Sat, 20 Aug 2011 17:17:11 -0400
"Drew Adams" <drew.adams <at> oracle.com> writes:

> (let ((debug-on-error  t)
>       (eval-expression-debug-on-error  t))
>   (condition-case nil (/ 1 0)
>     ((debug error) "Test")))
>
> The debugger is not opened.  In Emacs 23.3 it is opened (as the doc says
> it should be).

Thanks.  This regression was due to the 2011-01-26 change to eval.c on
the trunk (r102982).  I've committed a fix.




bug closed, send any further explanations to 9329 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sat, 20 Aug 2011 21:20:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9329; Package emacs. (Sun, 21 Aug 2011 03:53:02 GMT) Full text and rfc822 format available.

Message #19 received at 9329 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 9329 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#9329: 24.0.50; `condition-case' with (debug...) is broken
Date: Sat, 20 Aug 2011 23:50:40 -0400
>> (let ((debug-on-error  t)
>> (eval-expression-debug-on-error  t))
>> (condition-case nil (/ 1 0)
>> ((debug error) "Test")))
>> The debugger is not opened.  In Emacs 23.3 it is opened (as the doc says
>> it should be).
> Thanks.  This regression was due to the 2011-01-26 change to eval.c on
> the trunk (r102982).

Indeed I hate this "feature" and didn't bother to reimplement it.

> I've committed a fix.

Oh well,


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Sep 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.