unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: 67196@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#67196: M-: uses a wrong value of debug-on-error when it is nil.
Date: Sat, 25 Nov 2023 09:23:42 -0500	[thread overview]
Message-ID: <jwv34wu2ag2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <ZWHNN3LTX-QNDd51@ACM> (Alan Mackenzie's message of "Sat, 25 Nov 2023 10:32:23 +0000")

> That's a very good idea.  It would need little more than a new C function
> which would bind that variable then call eval.  Maybe move
> eval-expression-debug-on-error into eval.c, too.

Side note: there's recently been several things pointing to the need to
add something like Common Lisp's `handler-bind`.

`handler-bind` would provide a superset of the features that your
new C function would provide.  E.g. we could do something like:

    (defmacro with-debug-on-error (&rest body)
      `(handler-bind ((error #'debugger))
         ,@body))

which would mean that any error signal not caught within BODY itself
would call the debugger (and contrary to `condition-case`, that call is
performed before unwinding the stack, so we'd get the behavior we
expect from the debugger).

> Sorry, I wasn't clear enough.  During those 10 hours, I was under the
> impression that debug-on-error was t, because M-: debug-on-error said so.
> It actually was nil.  That's why I submitted this bug report.

I feel for you.  Personally I had a similar experience at some point but
instead of looking at the value of the var, I actually signaled
an error.

Seeing how I was getting into the debugger, I assumed that
`debug-on-error` was properly set (I had set it manually, so I (thought
I) knew that it was set, which is why I didn't even look at the var, but
apparently that was within a recursive edit that had it let-bound or
something, which is why it was actually unset).

The change you propose wouldn't have helped me directly in that case,
tho I think it probably would have circumvented the problem because the
var presumably wouldn't have been let-bound in the first place :-)

It took me less than 10 hours to figure out one of my many unjustified
assumptions, luckily.


        Stefan






  parent reply	other threads:[~2023-11-25 14:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 13:48 bug#67196: M-: uses a wrong value of debug-on-error when it is nil Alan Mackenzie
2023-11-15 17:19 ` Eli Zaretskii
2023-11-15 17:55   ` Alan Mackenzie
2023-11-19 17:19     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-19 17:33       ` Eli Zaretskii
     [not found]         ` <87a5r9efj0.fsf@dick>
2023-11-19 19:30           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-24 17:10       ` Alan Mackenzie
2023-11-24 18:48         ` Eli Zaretskii
2023-11-24 20:54           ` Alan Mackenzie
2023-11-24 21:25             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-24 22:21               ` Alan Mackenzie
2023-11-25  7:59                 ` Eli Zaretskii
2023-11-25 10:32                   ` Alan Mackenzie
2023-11-25 11:15                     ` Eli Zaretskii
2023-11-25 12:40                       ` Alan Mackenzie
2023-11-25 13:04                         ` Eli Zaretskii
2023-11-25 14:14                           ` Alan Mackenzie
2023-11-25 15:50                             ` Eli Zaretskii
2023-11-25 16:40                               ` Alan Mackenzie
2023-11-25 16:46                                 ` Eli Zaretskii
2023-11-25 16:57                                   ` Alan Mackenzie
2023-11-25 17:36                                     ` Alan Mackenzie
2023-11-25 18:12                                     ` Andreas Schwab
2023-11-25 14:23                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-12-17  4:23                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-19  3:54                         ` Richard Stallman
2023-12-19  5:05                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-25  3:41                             ` Richard Stallman
2023-12-26  2:39                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-27  4:54                                 ` Richard Stallman
2023-11-25  7:30             ` Eli Zaretskii
2023-11-24 20:22         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=jwv34wu2ag2.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67196@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).