From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.devel Subject: Re: Maybe the debugger should not ignore read errors Date: Wed, 17 Jan 2024 15:04:38 -0500 Message-ID: References: <83edefbvtf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10209"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:cCH7Iw/Y6ObZKUDc+hWsZFhJ3JY= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 17 21:12:56 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 1rQCHQ-0002RG-K1 for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Jan 2024 21:12:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQCGo-0005RE-N9; Wed, 17 Jan 2024 15:12:18 -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 1rQC9a-000206-N3 for emacs-devel@gnu.org; Wed, 17 Jan 2024 15:04:50 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQC9Y-0008R3-Rn for emacs-devel@gnu.org; Wed, 17 Jan 2024 15:04:50 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rQC9W-0002Ez-TI for emacs-devel@gnu.org; Wed, 17 Jan 2024 21:04:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 17 Jan 2024 15:12:16 -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:315048 Archived-At: Eli Zaretskii writes: >> 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. Oh, that's great! I didn't test the --debug-init part with master, so I missed that this had changed. That mostly resolves my concern, then. >> 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. That's a good point, it would be annoying to drop to the debugger in that case. (So then I'll just fix the related bug#68546 to improve the error message, and I'll be happy)