GNU bug report logs - #76949
30.1; --debug-init and condition-case-unless-debug

Previous Next

Package: emacs;

Reported by: "Nussbaum Ferdinand" <ferdinand.nussbaum <at> inf.ethz.ch>

Date: Tue, 11 Mar 2025 17:20:03 UTC

Severity: normal

Found in version 30.1

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Nussbaum  Ferdinand" <ferdinand.nussbaum <at> inf.ethz.ch>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Cc: "me <at> bcc32.com" <me <at> bcc32.com>,
 "monnier <at> iro.umontreal.ca" <monnier <at> iro.umontreal.ca>
Subject: 30.1; --debug-init and condition-case-unless-debug
Date: Tue, 11 Mar 2025 17:13:56 +0000
[Message part 1 (text/plain, inline)]
Errors inside condition-case-unless-debug do not trigger the debugger when the
--debug-init startup option is set (and debug-on-error is not additionally and
explicitly set to a non-nil value).

This can be reproduced, for example, by adding the following to init.el:

(condition-case-unless-debug nil
    (error "error")
  (error
   (message "error caught")))

and restarting Emacs with --debug-init. In Emacs 29 this enters the debugger
(as expected), while in Emacs 30 the message "error caught" is displayed.

On a related note, the Emacs Lisp reference manual still says the following: "[...]
use the option ‘--debug-init’. This binds debug-on-error to t while loading the
init file, [...]".
(https://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.html#Error-Debugging)
AFAICT this is no longer correct since the implementation uses handler-bind instead.

(Originally reported in https://github.com/syl20bnr/spacemacs/issues/16871
and https://github.com/syl20bnr/spacemacs/issues/16619#issuecomment-2708510954.)

Best,
Ferdinand
[Message part 2 (text/html, inline)]

This bug report was last modified 176 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.