From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Maybe the debugger should not ignore read errors Date: Wed, 17 Jan 2024 21:31:56 +0200 Message-ID: <83edefbvtf.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5270"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 17 20:32:50 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rQBeb-00013y-QJ for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Jan 2024 20:32:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQBe0-0000uZ-VQ; Wed, 17 Jan 2024 14:32:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQBdt-0000rs-0W for emacs-devel@gnu.org; Wed, 17 Jan 2024 14:32:05 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQBds-0002rv-HY; Wed, 17 Jan 2024 14:32:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BSyXq+mBmmCEM8ZDkkxmTzdAZ2AZiq1nZ8WufczgaHk=; b=WPm3679xqBF+ mliRoLw8QLtWmtNjXDfJKyGzlkWwfhbafn/Ov+B0MjAWYPt57dPQiaGREY0THXpEam0CEnU5Cy+li zOCvriCmChNNMAa8dymAaVXGQZUBiMkgTvyccLN7hPv1bSH0yYuj0IeYwLxFJMkuTWlQlfyvQp7NX jedh9ljySc1JNeZEXAkLiXce9z5w+nemZw/YdVeKTvkKBdeYTgW2DTcv0cRjeuzTTsq6v4cs0qcQv YYEnHiYoOv/tVIClIsl46s3yaTiQ8HOAqR27/PeoVFJUpMDYdN/Hvy+Pa2ReUMZTXB13YHAjIWxqn 1s24+iOJQ0N705oKLzdFoA==; In-Reply-To: (message from Spencer Baugh on Wed, 17 Jan 2024 13:51:03 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:315046 Archived-At: > From: Spencer Baugh > 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.