help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error does not throw to debugger in 'when' block


From: Arthur Miller
Subject: Re: Error does not throw to debugger in 'when' block
Date: Thu, 12 Jan 2023 20:18:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Michael Heerdegen <michael_heerdegen@web.de> writes:

Let's just do the part that matters:

> For C-x C-e you need to eval a form that raises an error.  Also that
> works as expected: evaluating the defun doesn't raise an error as
> expected.

Yes of course. As Eli said details matters.

I have now looked more into it, tested another example, and I do understand now
what happeneds; I just didn't know it worked that way:

When called interactively with M-x, (as the command) the evaluation of the
function exits on error, the error message is emittied, but the evaluation is
not trapped in the debugger. When called from lisp, for example via: M-: it
ends up in the debugger. I was calling it interactively, and didn't realize
realized it worked this way. I wasn't aware that "commands" does not trap in the
debugger on errors. Maybe I need to set some other of debug-on-* flags?
Actually, I am happy as it is, I was just curious about what happened since I
expected something else.

It was my bad to run it as a command, but I didn't know it worked that way.
I took a look into manual, parts about about Debugging, command loop,
interactive call and defining commands, using interactve, as well as in  help
for error, and I don't see it mentioned anywhere.

Anyway, thanks; I have learned that one now :).
/arthur



reply via email to

[Prev in Thread] Current Thread [Next in Thread]