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.

Full log


View this message in rfc822 format

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Lars Magne Ingebrigtsen'" <larsi <at> gnus.org>
Cc: 9329 <at> debbugs.gnu.org
Subject: 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.





This bug report was last modified 13 years and 339 days ago.

Previous Next


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