emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Maybe the debugger should not ignore read errors


From: Eli Zaretskii
Subject: Re: Maybe the debugger should not ignore read errors
Date: Wed, 17 Jan 2024 21:31:56 +0200

> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Wed, 17 Jan 2024 13:51:03 -0500
> 
> 
> If you read a file with a syntax error with debug-on-error=t, e.g.:
> 
> (let ((debug-on-error t)) (read ""))
> 
> Emacs will not drop to the debugger.  Instead, the error "End of file
> during parsing" will just be printed.  This is because
> debug-ignored-errors includes end-of-file, which is what read signals on
> error.
> 
> This in turn means that --debug-init will not cause Emacs to drop to the
> debugger if there's a read error in some file at load time, which can
> happen in many ways.  For example, some state file such as created by
> project.el or savehist.el might get corrupted one way or another.
> 
> This seems unnecessarily hostile to novice Emacs users who only know
> that --debug-init seems to do nothing when faced with this kind of
> error.  Certainly they have no idea that debug-ignored-errors even
> exists.

No, when Emacs is invoked with --debug-init, we reset
debug-ignored-errors to nil while the init file is loaded.  This was
done as part of fixing bug#64163, so if you see this now on master, it
is some kind of regression, perhaps due to recent changes related to
handler-bind.

> Should we remove end-of-file from debug-ignored-errors?

No, I don't think so.  The problem with debugging the init files is
supposed to be solved (if that broke, we need to fix it), and other
than that I don't see a reason to change this age-old behavior.
Please keep in mind that end-of-file frequently happens when users
type expressions at the M-: prompt and make syntax mistakes; we don't
want to pop up the debugger in that case (and other similar ones).

> end-of-file is not like the other errors in debug-ignored-errors,
> which are all user-errors.

Actually, end-of-file is frequently a cockpit error, see above.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]