unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 44942@debbugs.gnu.org
Subject: bug#44942: 28.0.50; Emacs should print a backtrace on uncaught errors in batch mode
Date: Mon, 7 Dec 2020 11:29:16 +0100	[thread overview]
Message-ID: <CAArVCkR2P7kaQw=yF1NTwh4ZX3KErwuPC=8QgeYTn6J+AFN2PQ@mail.gmail.com> (raw)
In-Reply-To: <83lfeaan04.fsf@gnu.org>

Am So., 6. Dez. 2020 um 18:00 Uhr schrieb Eli Zaretskii <eliz@gnu.org>:
>
> > From: Philipp Stephani <p.stephani2@gmail.com>
> > Date: Sun, 6 Dec 2020 17:50:17 +0100
> >
> > Am So., 29. Nov. 2020 um 16:27 Uhr schrieb Philipp Stephani
> > <p.stephani2@gmail.com>:
> > >
> > > Am So., 29. Nov. 2020 um 11:48 Uhr schrieb Philipp Stephani
> > > <p.stephani2@gmail.com>:
> > > >
> > > >
> > > > $ emacs -Q -batch -eval '(progn (defun foo () (error "Boo")) (foo))'
> > > > Boo
> > > >
> > > > Emacs should print a backtrace here to make it possible to debug such
> > > > errors.  It's possible to force Emacs to print a backtrace by binding
> > > > `debug-on-error', however, that is incorrect because it changes the
> > > > meaning of `with-demoted-errors' and `condition-case-unless-debug',
> > > > causing code that would normally work to fail with an error.  Instead,
> > > > `signal' should print a backtrace if in batch mode and if it jumps to
> > > > the top-level error handler.  It looks like this logic could be
> > > > special-cased in signal_or_quit, similar to the debugger logic.
> > > >
> > >
> > > I've attached a patch.
> >
> > Pushed to master as commit 40e11743ca.
>
> This is an incompatible change.

Is it? In other words, do we guarantee that no stack trace is being
printed if debug-on-error is nil? I'd say that parsing error messages
is brittle anyway, and we're not obliged to provide stable output.

>  Is there a way to get back previous
> behavior?  If so, please mention that in NEWS; if not, let's please
> provide a way to get back the old behavior.

I'd be OK adding a variable for this, but on the other hand I'm not
really convinced that this is really a breaking change (see above).





  reply	other threads:[~2020-12-07 10:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29 10:47 bug#44942: 28.0.50; Emacs should print a backtrace on uncaught errors in batch mode Philipp Stephani
2020-11-29 15:27 ` Philipp Stephani
2020-12-06 16:50   ` Philipp Stephani
2020-12-06 16:59     ` Eli Zaretskii
2020-12-07 10:29       ` Philipp Stephani [this message]
2020-12-07 10:42         ` Eli Zaretskii
2020-12-07 11:07           ` Philipp Stephani
2020-12-07 15:45             ` Eli Zaretskii
2020-12-07 15:07 ` Mattias Engdegård
2020-12-07 15:29   ` Philipp Stephani

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='CAArVCkR2P7kaQw=yF1NTwh4ZX3KErwuPC=8QgeYTn6J+AFN2PQ@mail.gmail.com' \
    --to=p.stephani2@gmail.com \
    --cc=44942@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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).