[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Maybe the debugger should not ignore read errors
From: |
Spencer Baugh |
Subject: |
Maybe the debugger should not ignore read errors |
Date: |
Wed, 17 Jan 2024 13:51:03 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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.
Should we remove end-of-file from debug-ignored-errors? end-of-file is
not like the other errors in debug-ignored-errors, which are all
user-errors.
That would make --debug-init and M-x toggle-debug-on-error drop to the
debugger when a read error is encountered, which seems like an
improvement.
- Maybe the debugger should not ignore read errors,
Spencer Baugh <=