unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Error does not throw to debugger in 'when' block
Date: Thu, 12 Jan 2023 20:18:22 +0100	[thread overview]
Message-ID: <AM9PR09MB49774CC124233F3F9C11BA6896FD9@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <87mt6oyows.fsf@web.de> (Michael Heerdegen's message of "Thu, 12 Jan 2023 12:26:27 +0100")

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	other threads:[~2023-01-12 19:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12  6:51 Error does not throw to debugger in 'when' block Arthur Miller
2023-01-12  8:28 ` Eli Zaretskii
2023-01-12  9:08   ` Arthur Miller
2023-01-12 11:26     ` Michael Heerdegen
2023-01-12 19:18       ` Arthur Miller [this message]
2023-01-12 21:15         ` Michael Heerdegen
2023-01-12 22:49           ` Arthur Miller

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=AM9PR09MB49774CC124233F3F9C11BA6896FD9@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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.
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).