Subject: Re: bug#44942: 28.0.50; Emacs should print a backtrace on uncaught errors in batch mode

From: Eli Zaretskii <[email-masked]>
Date: Sun, 06 Dec 2020 18:59:55 +0200

> From: Philipp Stephani <[email-masked]>
> Date: Sun, 6 Dec 2020 17:50:17 +0100
> 
> Am So., 29. Nov. 2020 um 16:27 Uhr schrieb Philipp Stephani
> <[email-masked]>:
> >
> > Am So., 29. Nov. 2020 um 11:48 Uhr schrieb Philipp Stephani
> > <[email-masked]>:
> > >
> > >
> > > $ 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 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.

Thanks.