From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Date: Fri, 24 Nov 2023 17:10:47 +0000 Message-ID: References: <83a5rfq6i2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32891"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67196@debbugs.gnu.org, Eli Zaretskii To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 24 18:12:34 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1r6ZjE-0008Lc-BD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Nov 2023 18:12:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6Zih-0003rC-0E; Fri, 24 Nov 2023 12:11:59 -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 1r6Zif-0003qr-Po for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 12:11:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6Zif-0006n3-HN for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 12:11:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6Zik-0004nt-2Q for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 12:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Nov 2023 17:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67196 X-GNU-PR-Package: emacs Original-Received: via spool by 67196-submit@debbugs.gnu.org id=B67196.170084586318397 (code B ref 67196); Fri, 24 Nov 2023 17:12:02 +0000 Original-Received: (at 67196) by debbugs.gnu.org; 24 Nov 2023 17:11:03 +0000 Original-Received: from localhost ([127.0.0.1]:37150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6Zhn-0004mf-Gv for submit@debbugs.gnu.org; Fri, 24 Nov 2023 12:11:03 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:41682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6Zhi-0004m5-I8 for 67196@debbugs.gnu.org; Fri, 24 Nov 2023 12:11:01 -0500 Original-Received: (qmail 10819 invoked by uid 3782); 24 Nov 2023 18:10:48 +0100 Original-Received: from acm.muc.de (pd953a757.dip0.t-ipconnect.de [217.83.167.87]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 24 Nov 2023 18:10:47 +0100 Original-Received: (qmail 24659 invoked by uid 1000); 24 Nov 2023 17:10:47 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274872 Archived-At: Hello, Stefan. On Sun, Nov 19, 2023 at 12:19:49 -0500, Stefan Monnier wrote: > > Thinking about it more clearly, we're using one variable, debug-on-error, > > for two conflicting purposes: > > (i) The calling mechanism of execute-extended-command, including the > > invocation of the debugger, should an error be signalled. > > (ii) Use in the form to be evaluated, where the variable's value outside > > of execute-extended-command should endure. > Yes, there's a conflicting need here: we want to control the way `eval` > works "from the outside", i.e. we want the `debug-on-error` to apply to > the evaluator but not to the code being evaluated. > But `eval` doesn't distinguish between the context of the evaluator and > the context of the code being evaluated because all ELisp code uses the > same evaluator. I can't think of any way to split the variable into two > to solve the problem. Instead it gives me the impression we're trying > some impossible feat like watching oneself sleep. I can think of a way to do this (indeed, I've got a trial implementation here which works). Firstly, though, there is a bug in the doc string of eval-expression-debug-on-error: rather than stating what the meaning of the variable is, what it's for, it states the low level details of how it achieves the desired effect. This is needlessly restrictive. I propose changing that doc string from: If non-nil set `debug-on-error' to t in `eval-expression'. If nil, don't change the value of `debug-on-error'. to something like: Non-nil means enter debugger on an error in a call from `eval-expression'. Does not apply to errors handled by `condition-case' or those matched by `debug-ignored-errors'. A nil value for this variable will not prevent an entry to the debugger caused by other variables such as `debug-on-error'. Like `debug-on-error', this variable's value can also be a list, with the same meaning as for `debug-on-error'. .. With this change, the mechanism for eval-expression-debug-on-error can be changed such that it doesn't become confused with debug-on-error. > Stefan -- Alan Mackenzie (Nuremberg, Germany).