all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: emacs-devel@gnu.org
Subject: Maybe the debugger should not ignore read errors
Date: Wed, 17 Jan 2024 13:51:03 -0500	[thread overview]
Message-ID: <ierttnb23qg.fsf@janestreet.com> (raw)


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.




             reply	other threads:[~2024-01-17 18:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 18:51 Spencer Baugh [this message]
2024-01-17 19:31 ` Maybe the debugger should not ignore read errors Eli Zaretskii
2024-01-17 20:04   ` Spencer Baugh

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ierttnb23qg.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=emacs-devel@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.