Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 16:40:54 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 11:40:54 2023 Received: from localhost ([127.0.0.1]:40102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6viA-0005Kh-1o for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 11:40:54 -0500 Received: from mail.muc.de ([193.149.48.3]:56148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acm@HIDDEN>) id 1r6vi8-0005KP-5L for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 11:40:53 -0500 Received: (qmail 41293 invoked by uid 3782); 25 Nov 2023 17:40:40 +0100 Received: from acm.muc.de (pd953a2e3.dip0.t-ipconnect.de [217.83.162.227]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 25 Nov 2023 17:40:40 +0100 Received: (qmail 19548 invoked by uid 1000); 25 Nov 2023 16:40:40 -0000 Date: Sat, 25 Nov 2023 16:40:40 +0000 To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Message-ID: <ZWIjiObn_fBCzpwO@ACM> References: <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> <ZWEh52qxu8CfNKlC@ACM> <83il5qe00e.fsf@HIDDEN> <ZWHNN3LTX-QNDd51@ACM> <83edgecce4.fsf@HIDDEN> <ZWHrIwPr5aW0IXvr@ACM> <8334wuc7cn.fsf@HIDDEN> <ZWIBY6B_7s8qbZzD@ACM> <83y1elbzny.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83y1elbzny.fsf@HIDDEN> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie <acm@HIDDEN> X-Primary-Address: acm@HIDDEN X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, acm@HIDDEN, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Eli. On Sat, Nov 25, 2023 at 17:50:09 +0200, Eli Zaretskii wrote: > > Date: Sat, 25 Nov 2023 14:14:59 +0000 > > Cc: monnier@HIDDEN, 67196 <at> debbugs.gnu.org, acm@HIDDEN > > From: Alan Mackenzie <acm@HIDDEN> > > > No, I meant with the current code debug-on-error is set to t whenever > > > eval-expression-debug-on-error is non-nil, .... > > Yes. > > > .... and your change sets it to the same value as > > > eval-expression-debug-on-error instead. > > That is not what is meant to happen. > We are miscommunicating. > > Instead, the new internal variable > > debug-from--eval-expression gets set to e-e-debug-on-error. > Exactly. And that value can be non-nil, but also not t. That is the > change I see, and your doc string suggests that it is intentional. > Thus, we have a behavior change wrt to the value that the body of > eval-expression will see. And non-nil, non-t values have special > meaning there. OK, I'm with you, now. The non-nil, non-t value in the internal variable debug-from--e-e won't be seen by any Lisp code. It can be seen by Lisp code in eval-expression-debug-on-error. This is an extension of e-e-debug-on-error to match what debug-on-error does. I wouldn't think that d-o-e gets set to a list of conditions very often, but when it does, it's likely very useful. It seemed logical to extend the same facility to e-e-debug-on-error. Do you think this is a bad idea? [Clearly, some entries in NEWS will be needed, as well as amendments to the Elisp manual.] -- Alan Mackenzie (Nuremberg, Germany).
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 15:50:53 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 10:50:53 2023 Received: from localhost ([127.0.0.1]:40052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6uvl-0003tD-6w for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 10:50:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1r6uvh-0003sv-GT for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 10:50:52 -0500 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 <eliz@HIDDEN>) id 1r6uvT-0004Wc-Tm; Sat, 25 Nov 2023 10:50:37 -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=f5aWEIsZ1S63+Mw8H2Eh5k6tSt2iUHarr2Ev48uzCL8=; b=CkYZc/ljyeqm 2D61aWSrF591X+ozKtHGr1U8HQkNqXbvn2vUkhPm9NyyETe/eNRYBmymSQMBAs2WERvF7fJ5ryHPK CH4lDaSKVne75TJ1ikegPPTSNcNzgnN6Ww4rejo/yp6+B+4OIQ7XGQhClh/U2eG/ILrvr+adO66/E J9otD3r36SVjU44TzfwyYxt5ySiXl2D1f6I31a1sYuu5C1oCMwvWrXg0T7FniKnPwlgvBvftIJq/m doVK2MVa44NOHrfKWi9s1CqVQ1TROPCaw4uc2VRe18TbPING8lwwtDsIukBhdeV29mFd/hm3cip+v v4syTm8ghFzQ46Zk1Qpf3A==; Date: Sat, 25 Nov 2023 17:50:09 +0200 Message-Id: <83y1elbzny.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> In-Reply-To: <ZWIBY6B_7s8qbZzD@ACM> (message from Alan Mackenzie on Sat, 25 Nov 2023 14:14:59 +0000) Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. References: <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> <ZWEh52qxu8CfNKlC@ACM> <83il5qe00e.fsf@HIDDEN> <ZWHNN3LTX-QNDd51@ACM> <83edgecce4.fsf@HIDDEN> <ZWHrIwPr5aW0IXvr@ACM> <8334wuc7cn.fsf@HIDDEN> <ZWIBY6B_7s8qbZzD@ACM> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Sat, 25 Nov 2023 14:14:59 +0000 > Cc: monnier@HIDDEN, 67196 <at> debbugs.gnu.org, acm@HIDDEN > From: Alan Mackenzie <acm@HIDDEN> > > > No, I meant with the current code debug-on-error is set to t whenever > > eval-expression-debug-on-error is non-nil, .... > > Yes. > > > .... and your change sets it to the same value as > > eval-expression-debug-on-error instead. > > That is not what is meant to happen. We are miscommunicating. > Instead, the new internal variable > debug-from--eval-expression gets set to e-e-debug-on-error. Exactly. And that value can be non-nil, but also not t. That is the change I see, and your doc string suggests that it is intentional. Thus, we have a behavior change wrt to the value that the body of eval-expression will see. And non-nil, non-t values have special meaning there.
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 14:23:57 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 09:23:57 2023 Received: from localhost ([127.0.0.1]:38228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6tZc-0000z1-Tk for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 09:23:57 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1r6tZa-0000yo-N4 for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 09:23:55 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3407F1000AD; Sat, 25 Nov 2023 09:23:44 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700922223; bh=OymoA2LiHiwmnHH/WWbvDJXCKKqXWHeEMs6EPCCbdA8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=phpsUCRROmvjjX7HaQF1HDMxqw3j10x0/DOVvgBBb0OvUzbLNGY4+3ea19rqwXb7D wVIhK8Eub4px1mCSKNGdh8ibGhtXXbK7TxgreYdRnqJD4wpGxFS6Z+df4wfnCTpZ4E wgG6ox1egCLwQdCunN/AgedREWiUMhBXI/VNM5CWy0CH+LBChEuT03lVEoQiESZJur GjWccUwK/8Z2otOrNK+2QEkdpDZ0uYb4TKVr1yO76GXAcCfuHB6V4l0L8SlT1aURN6 nO3BSkrZVBMbHWL2XZfP+SIkMSKKAhAmP8K7Oj9aUHsPZsV+cWahYRjQxOEZYNZKQN nvv0tWrvQ712Q== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 80F41100043; Sat, 25 Nov 2023 09:23:43 -0500 (EST) Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 574841202E5; Sat, 25 Nov 2023 09:23:43 -0500 (EST) From: Stefan Monnier <monnier@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. In-Reply-To: <ZWHNN3LTX-QNDd51@ACM> (Alan Mackenzie's message of "Sat, 25 Nov 2023 10:32:23 +0000") Message-ID: <jwv34wu2ag2.fsf-monnier+emacs@HIDDEN> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> <ZWEh52qxu8CfNKlC@ACM> <83il5qe00e.fsf@HIDDEN> <ZWHNN3LTX-QNDd51@ACM> Date: Sat, 25 Nov 2023 09:23:42 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.122 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > That's a very good idea. It would need little more than a new C function > which would bind that variable then call eval. Maybe move > eval-expression-debug-on-error into eval.c, too. Side note: there's recently been several things pointing to the need to add something like Common Lisp's `handler-bind`. `handler-bind` would provide a superset of the features that your new C function would provide. E.g. we could do something like: (defmacro with-debug-on-error (&rest body) `(handler-bind ((error #'debugger)) ,@body)) which would mean that any error signal not caught within BODY itself would call the debugger (and contrary to `condition-case`, that call is performed before unwinding the stack, so we'd get the behavior we expect from the debugger). > Sorry, I wasn't clear enough. During those 10 hours, I was under the > impression that debug-on-error was t, because M-: debug-on-error said so. > It actually was nil. That's why I submitted this bug report. I feel for you. Personally I had a similar experience at some point but instead of looking at the value of the var, I actually signaled an error. Seeing how I was getting into the debugger, I assumed that `debug-on-error` was properly set (I had set it manually, so I (thought I) knew that it was set, which is why I didn't even look at the var, but apparently that was within a recursive edit that had it let-bound or something, which is why it was actually unset). The change you propose wouldn't have helped me directly in that case, tho I think it probably would have circumvented the problem because the var presumably wouldn't have been let-bound in the first place :-) It took me less than 10 hours to figure out one of my many unjustified assumptions, luckily. Stefan
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 14:15:13 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 09:15:13 2023 Received: from localhost ([127.0.0.1]:38218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6tRB-0000lK-A8 for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 09:15:13 -0500 Received: from mail.muc.de ([193.149.48.3]:16899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acm@HIDDEN>) id 1r6tR9-0000l8-21 for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 09:15:11 -0500 Received: (qmail 74162 invoked by uid 3782); 25 Nov 2023 15:14:59 +0100 Received: from acm.muc.de (pd953a2e3.dip0.t-ipconnect.de [217.83.162.227]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 25 Nov 2023 15:14:59 +0100 Received: (qmail 18445 invoked by uid 1000); 25 Nov 2023 14:14:59 -0000 Date: Sat, 25 Nov 2023 14:14:59 +0000 To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Message-ID: <ZWIBY6B_7s8qbZzD@ACM> References: <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> <ZWEh52qxu8CfNKlC@ACM> <83il5qe00e.fsf@HIDDEN> <ZWHNN3LTX-QNDd51@ACM> <83edgecce4.fsf@HIDDEN> <ZWHrIwPr5aW0IXvr@ACM> <8334wuc7cn.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8334wuc7cn.fsf@HIDDEN> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie <acm@HIDDEN> X-Primary-Address: acm@HIDDEN X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, acm@HIDDEN, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Eli. On Sat, Nov 25, 2023 at 15:04:08 +0200, Eli Zaretskii wrote: > > Date: Sat, 25 Nov 2023 12:40:03 +0000 > > Cc: monnier@HIDDEN, 67196 <at> debbugs.gnu.org, acm@HIDDEN > > From: Alan Mackenzie <acm@HIDDEN> [ .... ] > > > Note that (AFAIU) your change doesn't just solve the problem you > > > bumped into, it also changes the value of debug-on-error inside > > > eval-expression etc., when eval-expression-debug-on-error's value is > > > non-nil, but not t. I wonder what is the reason for that? > > I don't see that in my current version of the patch (below). To test > > this, I used the following: > > (defun foo () > > (interactive) > > (message "debug-on-error is %s" debug-on-error) > > (message "eval-expression-debug-on-error is %s" eval-expression-debug-on-error) > > (car 'foo)) > > , and called it with various settings of debug-on-error and > > eval-expression-debug-on-error. In particular, with > > (setq eval-expression-debug-on-error '(wrong-type-argument)) > > , I still see debug-on-error reported as nil. > No, I meant with the current code debug-on-error is set to t whenever > eval-expression-debug-on-error is non-nil, .... Yes. > .... and your change sets it to the same value as > eval-expression-debug-on-error instead. That is not what is meant to happen. Instead, the new internal variable debug-from--eval-expression gets set to e-e-debug-on-error. debug-on-error should remain unchanged throughout a M-: call, leaving it free for use by user code. The subroutines of signal_or_quit test debug-from--eval-expression in addition to testing debug-on-error. Are you sure that isn't what you're seeing? -- Alan Mackenzie (Nuremberg, Germany).
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 13:04:26 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 08:04:26 2023 Received: from localhost ([127.0.0.1]:38113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6sKg-0007AO-0k for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 08:04:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1r6sKe-0007A8-Lx for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 08:04:25 -0500 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 <eliz@HIDDEN>) id 1r6sKU-0004sS-5w; Sat, 25 Nov 2023 08:04:14 -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=FwpYI+3KMWdz0YgLn1M/SHToQAuts/gI19BsBtBOluM=; b=FUuzU/wl6QpA v6pBaoZ9A0ehQoSdlSqcQF62cPoale0I3wn7y5jdAuRwvQTjI89EbdhEcUSDMh8Mgh6r3qjNQlhsM K4YX+iYdGilpFA47QhGR6iJM+jCC2/3KnujmSQnuzZHXmbrsDqM7yAgkRoFmAiUpDjLVZJGzCOFsq EOQ4YLcIbxvqKqiJA1x8LN4EUJCWMZIn28obOqG3LHmxY35ldZqeJ6Hn1zupovNLrfYJZky99E52U chgrO72+yzP9cedZF8Ot0bOXuwSNL1WR6r1ki/FmHIy3jG7KMo8F7Lw2XwClphz8Tiq+Zyt4jWTzb ptxs8DY+E09XNt85miWv1w==; Date: Sat, 25 Nov 2023 15:04:08 +0200 Message-Id: <8334wuc7cn.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> In-Reply-To: <ZWHrIwPr5aW0IXvr@ACM> (message from Alan Mackenzie on Sat, 25 Nov 2023 12:40:03 +0000) Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. References: <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> <ZWEh52qxu8CfNKlC@ACM> <83il5qe00e.fsf@HIDDEN> <ZWHNN3LTX-QNDd51@ACM> <83edgecce4.fsf@HIDDEN> <ZWHrIwPr5aW0IXvr@ACM> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Sat, 25 Nov 2023 12:40:03 +0000 > Cc: monnier@HIDDEN, 67196 <at> debbugs.gnu.org, acm@HIDDEN > From: Alan Mackenzie <acm@HIDDEN> > > > What I had in mind was a function exposed to Lisp that would set an > > internal variable not exposed to Lisp. > > The would still require an unwind-protect somewhere. We can unwind-protect in C as well. > > > Sorry, I wasn't clear enough. During those 10 hours, I was under the > > > impression that debug-on-error was t, because M-: debug-on-error said so. > > > It actually was nil. That's why I submitted this bug report. > > > So maybe instead of changing how this stuff works we should improve > > how debug-on-error's value is reported by M-: and other eval commands? > > Yes, but that might be complicated, and won't help the user trying to > debug something which depends on debug-on-error, who is using M-: to try > to test it. I don't see how that could happen. > > Note that (AFAIU) your change doesn't just solve the problem you > > bumped into, it also changes the value of debug-on-error inside > > eval-expression etc., when eval-expression-debug-on-error's value is > > non-nil, but not t. I wonder what is the reason for that? > > I don't see that in my current version of the patch (below). To test > this, I used the following: > > (defun foo () > (interactive) > (message "debug-on-error is %s" debug-on-error) > (message "eval-expression-debug-on-error is %s" eval-expression-debug-on-error) > (car 'foo)) > > , and called it with various settings of debug-on-error and > eval-expression-debug-on-error. In particular, with > > (setq eval-expression-debug-on-error '(wrong-type-argument)) > > , I still see debug-on-error reported as nil. No, I meant with the current code debug-on-error is set to t whenever eval-expression-debug-on-error is non-nil, and your change sets it to the same value as eval-expression-debug-on-error instead.
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 12:40:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 07:40:22 2023 Received: from localhost ([127.0.0.1]:38090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6rxN-0006OB-Gn for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 07:40:22 -0500 Received: from mail.muc.de ([193.149.48.3]:22151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acm@HIDDEN>) id 1r6rxH-0006Ns-Qj for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 07:40:20 -0500 Received: (qmail 63277 invoked by uid 3782); 25 Nov 2023 13:40:04 +0100 Received: from acm.muc.de (pd953a2e3.dip0.t-ipconnect.de [217.83.162.227]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 25 Nov 2023 13:40:04 +0100 Received: (qmail 16230 invoked by uid 1000); 25 Nov 2023 12:40:03 -0000 Date: Sat, 25 Nov 2023 12:40:03 +0000 To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Message-ID: <ZWHrIwPr5aW0IXvr@ACM> References: <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> <ZWEh52qxu8CfNKlC@ACM> <83il5qe00e.fsf@HIDDEN> <ZWHNN3LTX-QNDd51@ACM> <83edgecce4.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83edgecce4.fsf@HIDDEN> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie <acm@HIDDEN> X-Primary-Address: acm@HIDDEN X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, acm@HIDDEN, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Eli. On Sat, Nov 25, 2023 at 13:15:15 +0200, Eli Zaretskii wrote: > > Date: Sat, 25 Nov 2023 10:32:23 +0000 > > Cc: monnier@HIDDEN, 67196 <at> debbugs.gnu.org > > From: Alan Mackenzie <acm@HIDDEN> > > > How about not exposing the internal variable to Lisp at all? > > That's a very good idea. It would need little more than a new C function > > which would bind that variable then call eval. Maybe move > > eval-expression-debug-on-error into eval.c, too. > What I had in mind was a function exposed to Lisp that would set an > internal variable not exposed to Lisp. The would still require an unwind-protect somewhere. I've implemented sub-eval-expression in eval.c. debug-from--eval-expression is no longer visible from Lisp. Perhaps this is good enough. > > > > For what it's worth, I lost about 10 hours of time trying to debug > > > > a situation where I wasn't getting a backtrace, despite debug-on-error > > > > being t. The problem was that d-o-e wasn't t at all, it was nil. M-: > > > > had been lying. > > > You never described that situation, AFAICT. I think you should, so > > > that we could assess how grave the problem is, which is an important > > > part of deciding whether the solution you propose is useful. I don't > > > understand how could you NOT get a backtrace when debug-on-error is > > > non-nil. > > Sorry, I wasn't clear enough. During those 10 hours, I was under the > > impression that debug-on-error was t, because M-: debug-on-error said so. > > It actually was nil. That's why I submitted this bug report. > So maybe instead of changing how this stuff works we should improve > how debug-on-error's value is reported by M-: and other eval commands? Yes, but that might be complicated, and won't help the user trying to debug something which depends on debug-on-error, who is using M-: to try to test it. I still say the bug is trying to make debug-on-error do too much, more than it's capable of. > Note that (AFAIU) your change doesn't just solve the problem you > bumped into, it also changes the value of debug-on-error inside > eval-expression etc., when eval-expression-debug-on-error's value is > non-nil, but not t. I wonder what is the reason for that? I don't see that in my current version of the patch (below). To test this, I used the following: (defun foo () (interactive) (message "debug-on-error is %s" debug-on-error) (message "eval-expression-debug-on-error is %s" eval-expression-debug-on-error) (car 'foo)) , and called it with various settings of debug-on-error and eval-expression-debug-on-error. In particular, with (setq eval-expression-debug-on-error '(wrong-type-argument)) , I still see debug-on-error reported as nil. diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 6d83aaf4d14..9d176c6c599 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -262,6 +262,13 @@ minibuffer-prompt-properties--setter :value (nil) (symbol :format "%v")) (const :tag "always" t))) + (eval-expression-debug-on-error debug + (choice (const :tag "off") + (repeat :menu-tag "When" + :value (nil) + (symbol :format "%v")) + (const :tag "always" t)) + "30.1") (debug-ignored-errors debug (repeat (choice symbol regexp))) (debug-on-quit debug boolean) (debug-on-signal debug boolean) diff --git a/lisp/simple.el b/lisp/simple.el index 02c68912dba..f4c9873ceed 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1980,13 +1980,6 @@ eval-expression-print-length :type '(choice (const :tag "No Limit" nil) integer) :version "21.1") -(defcustom eval-expression-debug-on-error t - "If non-nil set `debug-on-error' to t in `eval-expression'. -If nil, don't change the value of `debug-on-error'." - :group 'lisp - :type 'boolean - :version "21.1") - (defcustom eval-expression-print-maximum-character 127 "The largest integer that will be displayed as a character. This affects printing by `eval-expression' (via @@ -2120,34 +2113,18 @@ eval-expression (cons (read--expression "Eval: ") (eval-expression-get-print-arguments current-prefix-arg))) - (let (result) - (if (null eval-expression-debug-on-error) - (setq result - (values--store-value - (eval (let ((lexical-binding t)) (macroexpand-all exp)) t))) - (let ((old-value (make-symbol "t")) new-value) - ;; Bind debug-on-error to something unique so that we can - ;; detect when evalled code changes it. - (let ((debug-on-error old-value)) - (setq result - (values--store-value - (eval (let ((lexical-binding t)) (macroexpand-all exp)) t))) - (setq new-value debug-on-error)) - ;; If evalled code has changed the value of debug-on-error, - ;; propagate that change to the global binding. - (unless (eq old-value new-value) - (setq debug-on-error new-value)))) - - (let ((print-length (unless no-truncate eval-expression-print-length)) - (print-level (unless no-truncate eval-expression-print-level)) - (eval-expression-print-maximum-character char-print-limit) - (deactivate-mark)) - (let ((out (if insert-value (current-buffer) t))) - (prog1 - (prin1 result out) - (let ((str (and char-print-limit - (eval-expression-print-format result)))) - (when str (princ str out)))))))) + (let* ((result (values--store-value + (sub-eval-expression (macroexpand-all exp)))) + (print-length (unless no-truncate eval-expression-print-length)) + (print-level (unless no-truncate eval-expression-print-level)) + (eval-expression-print-maximum-character char-print-limit) + (deactivate-mark) + (out (if insert-value (current-buffer) t))) + (prog1 + (prin1 result out) + (let ((str (and char-print-limit + (eval-expression-print-format result)))) + (when str (princ str out)))))) (defun edit-and-eval-command (prompt command) "Prompting with PROMPT, let user edit COMMAND and eval result. diff --git a/src/eval.c b/src/eval.c index 12e811ce264..eccabf3a091 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2033,7 +2033,8 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) /* Does user want to enter debugger for this kind of error? */ && (signal_quit_p (sig) ? debug_on_quit - : wants_debugger (Vdebug_on_error, conditions)) + : (wants_debugger (Vdebug_from__eval_expression, conditions) + || wants_debugger (Vdebug_on_error, conditions))) && ! skip_debugger (conditions, combined_data) /* See commentary on definition of `internal-when-entered-debugger'. */ @@ -2383,6 +2384,19 @@ DEFUN ("eval", Feval, Seval, 1, 2, 0, return unbind_to (count, eval_sub (form)); } +DEFUN ("sub-eval-expression", Fsub_eval_expression, Ssub_eval_expression, + 1, 1, 0, + doc: /* Evaluate FORM and return its value. +This function should be called only from `eval-expression'. +It evaluates with `lexical-binding' non-nil, and handles +`eval-expression-debug-on-error'. */) + (Lisp_Object form) +{ + specpdl_ref count = SPECPDL_INDEX (); + specbind (Qdebug_from__eval_expression, Veval_expression_debug_on_error); + return unbind_to (count, Feval (form, Qt)); +} + void grow_specpdl_allocation (void) { @@ -4299,6 +4313,29 @@ syms_of_eval (void) See also the variable `debug-on-quit' and `inhibit-debugger'. */); Vdebug_on_error = Qnil; + DEFSYM (Qeval_expression_debug_on_error, "eval-expression-debug-on-error"); + DEFVAR_LISP ("eval-expression-debug-on-error", + Veval_expression_debug_on_error, + doc: /* Non-nil means enter debugger on error on a call from `eval-expression'. +Does not apply to errors handled by `condition-case' or those +matched by `debug-ignored-errors'. +Like `debug-on-error', this variable's value can also be a list, +with the same meaning as for `debug-on-error'. + +A nil value for this variable will not prevent an entry to +the debugger caused by other variables such as `debug-on-error'. */); + Veval_expression_debug_on_error = Qt; + + DEFSYM (Qdebug_from__eval_expression, "debug-from--eval-expression"); + DEFVAR_LISP ("debug-from--eval-expression", Vdebug_from__eval_expression, + doc: /* Non-nil means enter debugger if an error is signaled. +This only applies in forms called by `eval-expression'. This variable +has the same semantics as `debug-on-error'. It is an internal variable +only. */); + Vdebug_from__eval_expression = Qnil; + /* debug-from--eval-expression should not be visible from Lisp. */ + Funintern (Qdebug_from__eval_expression, Qnil); + DEFVAR_LISP ("debug-ignored-errors", Vdebug_ignored_errors, doc: /* List of errors for which the debugger should not be called. Each element may be a condition-name or a regexp that matches error messages. @@ -4455,6 +4492,7 @@ syms_of_eval (void) defsubr (&Sautoload); defsubr (&Sautoload_do_load); defsubr (&Seval); + defsubr (&Ssub_eval_expression); defsubr (&Sapply); defsubr (&Sfuncall); defsubr (&Sfunc_arity); -- Alan Mackenzie (Nuremberg, Germany).
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 11:15:50 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 06:15:50 2023 Received: from localhost ([127.0.0.1]:37999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6qda-0000ho-0y for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 06:15:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1r6qdY-0000TH-FS for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 06:15:49 -0500 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 <eliz@HIDDEN>) id 1r6qdM-0000nE-92; Sat, 25 Nov 2023 06:15:36 -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=zWdbb7DqkhuITMfSG2iKNh0jCcoaACOakEecJUOvoK0=; b=f52wZ2AIm87p ywSEkAWJvquqPIthbpDE7khsFDcMm6oocfMNfFPSw/hDX9BU5XlYyqQRDWKVJ+zf7dTNMCm6P1cSG EaJbRVMNuoOn0sJkucNNaPT3QRJ9jImgPYdX3nWb7IxaR09Nv7tvK1BVSKbuTeICPpNDNeYmAc/V3 hPbPHDdt2end4mHXdf9YDRgWAmrnHIblE6O6u78W7O5o14SAb/B2S64GyyqosZFE9Ny3v43+2X/wm vsiOMIuHHyErV0LOh45HElKNlHYdFc8BzQO1ZSJoT9MRaKUoCeKP4JYZcvy13hnV9yHDetDmsUfpM HcJpPpaVGsduHj4EZShP7w==; Date: Sat, 25 Nov 2023 13:15:15 +0200 Message-Id: <83edgecce4.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> In-Reply-To: <ZWHNN3LTX-QNDd51@ACM> (message from Alan Mackenzie on Sat, 25 Nov 2023 10:32:23 +0000) Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> <ZWEh52qxu8CfNKlC@ACM> <83il5qe00e.fsf@HIDDEN> <ZWHNN3LTX-QNDd51@ACM> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Sat, 25 Nov 2023 10:32:23 +0000 > Cc: monnier@HIDDEN, 67196 <at> debbugs.gnu.org > From: Alan Mackenzie <acm@HIDDEN> > > > How about not exposing the internal variable to Lisp at all? > > That's a very good idea. It would need little more than a new C function > which would bind that variable then call eval. Maybe move > eval-expression-debug-on-error into eval.c, too. What I had in mind was a function exposed to Lisp that would set an internal variable not exposed to Lisp. > > > For what it's worth, I lost about 10 hours of time trying to debug > > > a situation where I wasn't getting a backtrace, despite debug-on-error > > > being t. The problem was that d-o-e wasn't t at all, it was nil. M-: > > > had been lying. > > > You never described that situation, AFAICT. I think you should, so > > that we could assess how grave the problem is, which is an important > > part of deciding whether the solution you propose is useful. I don't > > understand how could you NOT get a backtrace when debug-on-error is > > non-nil. > > Sorry, I wasn't clear enough. During those 10 hours, I was under the > impression that debug-on-error was t, because M-: debug-on-error said so. > It actually was nil. That's why I submitted this bug report. So maybe instead of changing how this stuff works we should improve how debug-on-error's value is reported by M-: and other eval commands? Note that (AFAIU) your change doesn't just solve the problem you bumped into, it also changes the value of debug-on-error inside eval-expression etc., when eval-expression-debug-on-error's value is non-nil, but not t. I wonder what is the reason for that?
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 10:32:39 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 05:32:39 2023 Received: from localhost ([127.0.0.1]:37929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6pxm-0005eU-Iz for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 05:32:39 -0500 Received: from mail.muc.de ([193.149.48.3]:27068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acm@HIDDEN>) id 1r6pxj-0005eD-5w for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 05:32:38 -0500 Received: (qmail 10756 invoked by uid 3782); 25 Nov 2023 11:32:24 +0100 Received: from acm.muc.de (pd953a2e3.dip0.t-ipconnect.de [217.83.162.227]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 25 Nov 2023 11:32:24 +0100 Received: (qmail 13401 invoked by uid 1000); 25 Nov 2023 10:32:23 -0000 Date: Sat, 25 Nov 2023 10:32:23 +0000 To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Message-ID: <ZWHNN3LTX-QNDd51@ACM> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> <ZWEh52qxu8CfNKlC@ACM> <83il5qe00e.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83il5qe00e.fsf@HIDDEN> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie <acm@HIDDEN> X-Primary-Address: acm@HIDDEN X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Eli. On Sat, Nov 25, 2023 at 09:59:45 +0200, Eli Zaretskii wrote: > > Date: Fri, 24 Nov 2023 22:21:27 +0000 > > Cc: Eli Zaretskii <eliz@HIDDEN>, 67196 <at> debbugs.gnu.org, acm@HIDDEN > > From: Alan Mackenzie <acm@HIDDEN> > > > So you kicked the can a bit further down the road. > > > The next bug report will be that `M-: debug-from--eval-expression` does > > > not return the expected value. > > Not at all. debug-from--eval-expression is a purely internal variable, > > unlike debug-on-error which is intended for user use. It is bound in > > exactly one place, and tested in exactly one place. > > Anybody reporting such a "bug" would legitimately get the reply "not a > > bug". > How about not exposing the internal variable to Lisp at all? That's a very good idea. It would need little more than a new C function which would bind that variable then call eval. Maybe move eval-expression-debug-on-error into eval.c, too. > > For what it's worth, I lost about 10 hours of time trying to debug > > a situation where I wasn't getting a backtrace, despite debug-on-error > > being t. The problem was that d-o-e wasn't t at all, it was nil. M-: > > had been lying. > You never described that situation, AFAICT. I think you should, so > that we could assess how grave the problem is, which is an important > part of deciding whether the solution you propose is useful. I don't > understand how could you NOT get a backtrace when debug-on-error is > non-nil. Sorry, I wasn't clear enough. During those 10 hours, I was under the impression that debug-on-error was t, because M-: debug-on-error said so. It actually was nil. That's why I submitted this bug report. -- Alan Mackenzie (Nuremberg, Germany).
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 08:00:04 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 03:00:04 2023 Received: from localhost ([127.0.0.1]:37699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6na7-00077m-Jz for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 03:00:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1r6na3-00076k-Gf for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 03:00:02 -0500 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 <eliz@HIDDEN>) id 1r6nZs-0007KK-BB; Sat, 25 Nov 2023 02:59:48 -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=dw94QZ2FWezg7UyhbgJ1UjBJwsdMcyTR2jDEuYn/vwg=; b=FAlIFF94VID6 01odFY5eTSJcn4gBWo6sAFNe9So5CJUNtWRp45IfTIQrPCv5u7XyAmjJXVRIN5a7fybazzeg6sA9v DzZByJvUPLGqKOUs9/kuVQfMQUNEMII7vmV2pQJfXz0sRmL1R75Zdr/WWeRp1np7PrElLMnMxpmVz oV2DvStxgQSYsEepwjWeaVenRNTQLhYnUvioCyPiEK3dC6vEU2cWzFgnRs9VjfSi1qauI23O+cMe1 NNM52hgvJzAvV6gNesk4nT5ALo6aBiNKKhdvKi0XpeHQqhWk8o7TSehmvNcGSUF6bza0baQLFJCPY GU/vszHKe7G2y2Bl/7/ktw==; Date: Sat, 25 Nov 2023 09:59:45 +0200 Message-Id: <83il5qe00e.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> In-Reply-To: <ZWEh52qxu8CfNKlC@ACM> (message from Alan Mackenzie on Fri, 24 Nov 2023 22:21:27 +0000) Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> <ZWEh52qxu8CfNKlC@ACM> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Fri, 24 Nov 2023 22:21:27 +0000 > Cc: Eli Zaretskii <eliz@HIDDEN>, 67196 <at> debbugs.gnu.org, acm@HIDDEN > From: Alan Mackenzie <acm@HIDDEN> > > > So you kicked the can a bit further down the road. > > The next bug report will be that `M-: debug-from--eval-expression` does > > not return the expected value. > > Not at all. debug-from--eval-expression is a purely internal variable, > unlike debug-on-error which is intended for user use. It is bound in > exactly one place, and tested in exactly one place. > > Anybody reporting such a "bug" would legitimately get the reply "not a > bug". How about not exposing the internal variable to Lisp at all? > For what it's worth, I lost about 10 hours of time trying to debug > a situation where I wasn't getting a backtrace, despite debug-on-error > being t. The problem was that d-o-e wasn't t at all, it was nil. M-: > had been lying. You never described that situation, AFAICT. I think you should, so that we could assess how grave the problem is, which is an important part of deciding whether the solution you propose is useful. I don't understand how could you NOT get a backtrace when debug-on-error is non-nil.
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 07:30:55 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 25 02:30:55 2023 Received: from localhost ([127.0.0.1]:37688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6n7v-0006I4-A3 for submit <at> debbugs.gnu.org; Sat, 25 Nov 2023 02:30:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1r6n7q-0006Ho-AT for 67196 <at> debbugs.gnu.org; Sat, 25 Nov 2023 02:30:53 -0500 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 <eliz@HIDDEN>) id 1r6n7e-0002Pw-Jo; Sat, 25 Nov 2023 02:30:38 -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=ZqzHeFmx5ZxeBptui4mUbbAqG+yEc8iTuNFt3I8RLYA=; b=isabgfExPoo0 eI6T2oZBFAY1xnPNWc+HrZrL32Uwm1doaZJN2XX/It/4xQ9vlcwVUGzRfhwI2yWcia3mM1/U47kJ8 QTwen7F2vi6/oPjxiLxjCr32M3YKT7v+k7OggyCgBj6KZ1L97Ta6nDMNfOC0nx20OKzy6MSWHFtXR juEI/SL+b2xLurIjfzO6cXANAnIFl3w0ZF4L51cy2FKBM2LzjeLpVd4ASz14KVNisQ5sseHVjsAP6 6TNdnK2P/Z2jUv4ZdpdH+E9NXzwKb0Lt6mhM5v6UgrgMgk7aWdBQqm0Oy+OnQWbyxF/d3bscRAekR VQf7fZwRd7B0rBm+cJ2zAg==; Date: Sat, 25 Nov 2023 09:30:29 +0200 Message-Id: <83leame1d6.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> In-Reply-To: <ZWENlc6fj9odIdt6@ACM> (message from Alan Mackenzie on Fri, 24 Nov 2023 20:54:45 +0000) Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, acm@HIDDEN, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Fri, 24 Nov 2023 20:54:45 +0000 > Cc: 67196 <at> debbugs.gnu.org, acm@HIDDEN > From: Alan Mackenzie <acm@HIDDEN> > > > > 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'. > > > First, the last two sentences above should be transposed, as the > > second one is not related to the 1st one, but the 3rd one is. > > Done. > > > And second, please try to reword so that the text is less complicated > > and easier to understand. > > I'm perhaps a bit too close to it. Apart from the first line (for which > too much information needs squashing in), I can't really see much scope > for improvement. Here: (defcustom eval-expression-debug-on-error t "If non-nil, enter debugger if `eval-expression' signals an error. A non-nil value means set `debug-on-error' to that value when calling `eval-expression'; this will enter a debugger if `eval-expression' signals an error. A nil value means don't change the value of `debug-on-error' when calling `eval-expression'. The value can also be a list, with the same meaning as for `debug-on-error'. Like `debug-on-error', this variable does not apply to errors handled by `condition-case' or those matched by `debug-ignored-errors'." > + DEFVAR_LISP ("debug-from--eval-expression", Vdebug_from__eval_expression, > + doc: /* Non-nil means enter debugger if an error is signaled. > +This only applies in forms called by `eval-expression'. This variable > +has the same semantics as `debug-on-error'. It is an internal variable > +only. */); The doc string should be just /* Internal use only, used by `eval-expression'. */
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 24 Nov 2023 22:21:42 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 24 17:21:42 2023 Received: from localhost ([127.0.0.1]:37416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6eYQ-00083e-Dx for submit <at> debbugs.gnu.org; Fri, 24 Nov 2023 17:21:42 -0500 Received: from mail.muc.de ([193.149.48.3]:25348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acm@HIDDEN>) id 1r6eYM-00083H-D5 for 67196 <at> debbugs.gnu.org; Fri, 24 Nov 2023 17:21:40 -0500 Received: (qmail 66504 invoked by uid 3782); 24 Nov 2023 23:21:27 +0100 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 23:21:26 +0100 Received: (qmail 1894 invoked by uid 1000); 24 Nov 2023 22:21:27 -0000 Date: Fri, 24 Nov 2023 22:21:27 +0000 To: Stefan Monnier <monnier@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Message-ID: <ZWEh52qxu8CfNKlC@ACM> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie <acm@HIDDEN> X-Primary-Address: acm@HIDDEN X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, acm@HIDDEN, Eli Zaretskii <eliz@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Stefan. On Fri, Nov 24, 2023 at 16:25:11 -0500, Stefan Monnier wrote: > > + (let* ((debug-from--eval-expression eval-expression-debug-on-error) > > + (result (values--store-value > > + (eval (let ((lexical-binding t)) (macroexpand-all exp)) t))) > > + (print-length (unless no-truncate eval-expression-print-length)) > > + (print-level (unless no-truncate eval-expression-print-level)) > > + (eval-expression-print-maximum-character char-print-limit) > > + (deactivate-mark) > > + (out (if insert-value (current-buffer) t))) > > + (prog1 > > + (prin1 result out) > > + (let ((str (and char-print-limit > > + (eval-expression-print-format result)))) > > + (when str (princ str out)))))) > So you kicked the can a bit further down the road. > The next bug report will be that `M-: debug-from--eval-expression` does > not return the expected value. Not at all. debug-from--eval-expression is a purely internal variable, unlike debug-on-error which is intended for user use. It is bound in exactly one place, and tested in exactly one place. Anybody reporting such a "bug" would legitimately get the reply "not a bug". > FWIW, the other way I came up to circumvent the problem is to test the > shape of the expression to evaluate and only use > `eval-expression-debug-on-error` when the expression is not a mere > symbol (for which the backtrace would presumably not be interesting anyway). > But then we get the weird situation where `M-x debug-on-error` can > return nil but `M-x (list debug-on-error ...)` returns a list that > starts with t. [ By M-x, I assume you're meaning M-:.] Yes. Such a patch wouldn't fix the bug. The root of the bug is trying to make debug-on-error do two different contradictory jobs, as we've already discussed. To fix this, you've either got to decide not to do one of these jobs at all, or introduce a new variable. My patch does the second of these. > I think I'd rather keep the current code, whose semantics is > actually simpler. No. My patch fixes the bug, by introducing a separate variable to do one of the two jobs that debug-on-error is currently trying to do. This is a simplification. As a side effect, eval-expression has been reduced from 59 to 44 lines; not counting the doc string this is a reduction of around 50%. For what it's worth, I lost about 10 hours of time trying to debug a situation where I wasn't getting a backtrace, despite debug-on-error being t. The problem was that d-o-e wasn't t at all, it was nil. M-: had been lying. > Stefan -- Alan Mackenzie (Nuremberg, Germany).
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 24 Nov 2023 21:25:25 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 24 16:25:25 2023 Received: from localhost ([127.0.0.1]:37353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6dfw-00060D-W3 for submit <at> debbugs.gnu.org; Fri, 24 Nov 2023 16:25:25 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:18708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1r6dfu-0005zx-LA for 67196 <at> debbugs.gnu.org; Fri, 24 Nov 2023 16:25:23 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8AD0A100068; Fri, 24 Nov 2023 16:25:12 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700861111; bh=lz6waaW0AxTcFQrhUcv3yiCJ/KM31WPPIYUnXgl85aE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=e9YqgxgHOrETSpSsyM70pCsEI5TDlbut2Eg3oZEbobfDCxpIRbArIhE0x+j4I/3OM mckpU3jvuHwkbAd1rntBYSnM8rybMo1evN1iRIaUhyb+mw0UU3LGOEtEj5F7j2+t6Q L0qv+e/TWinit4xTRu2TFFJkYOhLQwKXceU0/uHsyHPuvE0cshDfbhw6V9rpA7q+Ga MUjPnCgN3N+xhV64kIkSkc4EdeAtwzTfl8iNdQ5miLn6Xv4aujEEABY9y+5tRD0maF GsG/McgPxi72jj2oTq/YwudLP6g4nbNte1rK7I3tyLOkDlzg01Uoh29wp7iiu+oB2h AUDS8ZPZlN4+Q== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D9CB1100033; Fri, 24 Nov 2023 16:25:11 -0500 (EST) Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B67BA120191; Fri, 24 Nov 2023 16:25:11 -0500 (EST) From: Stefan Monnier <monnier@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. In-Reply-To: <ZWENlc6fj9odIdt6@ACM> (Alan Mackenzie's message of "Fri, 24 Nov 2023 20:54:45 +0000") Message-ID: <jwvleam6e7v.fsf-monnier+emacs@HIDDEN> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> <ZWENlc6fj9odIdt6@ACM> Date: Fri, 24 Nov 2023 16:25:11 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.126 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > + (let* ((debug-from--eval-expression eval-expression-debug-on-error) > + (result (values--store-value > + (eval (let ((lexical-binding t)) (macroexpand-all exp)) t))) > + (print-length (unless no-truncate eval-expression-print-length)) > + (print-level (unless no-truncate eval-expression-print-level)) > + (eval-expression-print-maximum-character char-print-limit) > + (deactivate-mark) > + (out (if insert-value (current-buffer) t))) > + (prog1 > + (prin1 result out) > + (let ((str (and char-print-limit > + (eval-expression-print-format result)))) > + (when str (princ str out)))))) So you kicked the can a bit further down the road. The next bug report will be that `M-: debug-from--eval-expression` does not return the expected value. FWIW, the other way I came up to circumvent the problem is to test the shape of the expression to evaluate and only use `eval-expression-debug-on-error` when the expression is not a mere symbol (for which the backtrace would presumably not be interesting anyway). But then we get the weird situation where `M-x debug-on-error` can return nil but `M-x (list debug-on-error ...)` returns a list that starts with t. I think I'd rather keep the current code, whose semantics is actually simpler. Stefan
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 24 Nov 2023 20:55:03 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 24 15:55:03 2023 Received: from localhost ([127.0.0.1]:37330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6dCY-00056x-H3 for submit <at> debbugs.gnu.org; Fri, 24 Nov 2023 15:55:03 -0500 Received: from mail.muc.de ([193.149.48.3]:52278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acm@HIDDEN>) id 1r6dCT-00056K-7Y for 67196 <at> debbugs.gnu.org; Fri, 24 Nov 2023 15:55:01 -0500 Received: (qmail 67704 invoked by uid 3782); 24 Nov 2023 21:54:45 +0100 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 21:54:45 +0100 Received: (qmail 1405 invoked by uid 1000); 24 Nov 2023 20:54:45 -0000 Date: Fri, 24 Nov 2023 20:54:45 +0000 To: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Message-ID: <ZWENlc6fj9odIdt6@ACM> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> <83ttpbdm2f.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83ttpbdm2f.fsf@HIDDEN> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie <acm@HIDDEN> X-Primary-Address: acm@HIDDEN X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, acm@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Eli and Stefan. On Fri, Nov 24, 2023 at 20:48:40 +0200, Eli Zaretskii wrote: > > Date: Fri, 24 Nov 2023 17:10:47 +0000 > > Cc: Eli Zaretskii <eliz@HIDDEN>, 67196 <at> debbugs.gnu.org > > From: Alan Mackenzie <acm@HIDDEN> > > 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'. > First, the last two sentences above should be transposed, as the > second one is not related to the 1st one, but the 3rd one is. Done. > And second, please try to reword so that the text is less complicated > and easier to understand. I'm perhaps a bit too close to it. Apart from the first line (for which too much information needs squashing in), I can't really see much scope for improvement. > Thanks. Anyway, here's the patch of the current state. With it, M-: debug-on-error RET shows nil, when that is the case. M-: (foo) enters the debugger when an error gets signalled, assuming eval-expression-debug-on-error is t (or a suitable list), but doesn't enter the debugger when e-e-d-o-error is nil. There's a slight disadvantage to the approach, namely the introduction of a new internal variable debug-from--eval-expression which is tested from signal_or_quit. On the other hand, eval-expression itself has been noticeably simplified. diff --git a/lisp/simple.el b/lisp/simple.el index 02c68912dba..e8a9a795c0b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1981,11 +1981,17 @@ eval-expression-print-length :version "21.1") (defcustom eval-expression-debug-on-error t - "If non-nil set `debug-on-error' to t in `eval-expression'. -If nil, don't change the value of `debug-on-error'." + "Non-nil means enter debugger on error on a call from `eval-expression'. +Does not apply to errors handled by `condition-case' or those +matched by `debug-ignored-errors'. +Like `debug-on-error', this variable's value can also be a list, +with the same meaning as for `debug-on-error'. + +A nil value for this variable will not prevent an entry to +the debugger caused by other variables such as `debug-on-error'." :group 'lisp :type 'boolean - :version "21.1") + :version "30.1") (defcustom eval-expression-print-maximum-character 127 "The largest integer that will be displayed as a character. @@ -2120,34 +2126,19 @@ eval-expression (cons (read--expression "Eval: ") (eval-expression-get-print-arguments current-prefix-arg))) - (let (result) - (if (null eval-expression-debug-on-error) - (setq result - (values--store-value - (eval (let ((lexical-binding t)) (macroexpand-all exp)) t))) - (let ((old-value (make-symbol "t")) new-value) - ;; Bind debug-on-error to something unique so that we can - ;; detect when evalled code changes it. - (let ((debug-on-error old-value)) - (setq result - (values--store-value - (eval (let ((lexical-binding t)) (macroexpand-all exp)) t))) - (setq new-value debug-on-error)) - ;; If evalled code has changed the value of debug-on-error, - ;; propagate that change to the global binding. - (unless (eq old-value new-value) - (setq debug-on-error new-value)))) - - (let ((print-length (unless no-truncate eval-expression-print-length)) - (print-level (unless no-truncate eval-expression-print-level)) - (eval-expression-print-maximum-character char-print-limit) - (deactivate-mark)) - (let ((out (if insert-value (current-buffer) t))) - (prog1 - (prin1 result out) - (let ((str (and char-print-limit - (eval-expression-print-format result)))) - (when str (princ str out)))))))) + (let* ((debug-from--eval-expression eval-expression-debug-on-error) + (result (values--store-value + (eval (let ((lexical-binding t)) (macroexpand-all exp)) t))) + (print-length (unless no-truncate eval-expression-print-length)) + (print-level (unless no-truncate eval-expression-print-level)) + (eval-expression-print-maximum-character char-print-limit) + (deactivate-mark) + (out (if insert-value (current-buffer) t))) + (prog1 + (prin1 result out) + (let ((str (and char-print-limit + (eval-expression-print-format result)))) + (when str (princ str out)))))) (defun edit-and-eval-command (prompt command) "Prompting with PROMPT, let user edit COMMAND and eval result. diff --git a/src/eval.c b/src/eval.c index 12e811ce264..6cadda01efb 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2033,7 +2033,8 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) /* Does user want to enter debugger for this kind of error? */ && (signal_quit_p (sig) ? debug_on_quit - : wants_debugger (Vdebug_on_error, conditions)) + : (wants_debugger (Vdebug_from__eval_expression, conditions) + || wants_debugger (Vdebug_on_error, conditions))) && ! skip_debugger (conditions, combined_data) /* See commentary on definition of `internal-when-entered-debugger'. */ @@ -4299,6 +4300,13 @@ syms_of_eval (void) See also the variable `debug-on-quit' and `inhibit-debugger'. */); Vdebug_on_error = Qnil; + DEFVAR_LISP ("debug-from--eval-expression", Vdebug_from__eval_expression, + doc: /* Non-nil means enter debugger if an error is signaled. +This only applies in forms called by `eval-expression'. This variable +has the same semantics as `debug-on-error'. It is an internal variable +only. */); + Vdebug_from__eval_expression = Qnil; + DEFVAR_LISP ("debug-ignored-errors", Vdebug_ignored_errors, doc: /* List of errors for which the debugger should not be called. Each element may be a condition-name or a regexp that matches error messages. -- Alan Mackenzie (Nuremberg, Germany).
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 24 Nov 2023 20:22:25 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 24 15:22:25 2023 Received: from localhost ([127.0.0.1]:37324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6cgz-00048Y-JY for submit <at> debbugs.gnu.org; Fri, 24 Nov 2023 15:22:25 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1r6cgx-00048E-GX for 67196 <at> debbugs.gnu.org; Fri, 24 Nov 2023 15:22:24 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4D92644264A; Fri, 24 Nov 2023 15:22:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700857332; bh=EqY13nW2gY87ME43djIayR5dftYe7yaiOJrFObEGAAA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GNCi6PqgEhns0/JFz5u5j1rc1RGaX/Vp0BDTCFjT99Fy9IZ7Q9mXIW4ZlcpdZXxRj JoH9ZYQEyIcZ8oE6oFikKnYxRAu3K9XGSk/wxGZWdxcYhuqknGQ/FqYGXvc8tlyKtj rJyO66Ug6/j135/B27CctrxCPZM/W57Ln52NtGI34k+x73Y2JFLVrZ8wwHeJi/FwRV tDmMOZYG/oBbDyc7zPpEp9x+40oPDQEjxp1m4yC0OYm55zv8tCvodeJfGN2wW56iFw 6NP8qx7eUvuVJ9ImkHN59Vg4PVY51b/Jhzigc6HvIppffiXuWsTZaE6juh21wKp+cP O7hd/kVLSnIEw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5BC36442636; Fri, 24 Nov 2023 15:22:12 -0500 (EST) Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 32AC2120351; Fri, 24 Nov 2023 15:22:12 -0500 (EST) From: Stefan Monnier <monnier@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. In-Reply-To: <ZWDZF17mTpJp48ly@ACM> (Alan Mackenzie's message of "Fri, 24 Nov 2023 17:10:47 +0000") Message-ID: <jwvwmu66gwy.fsf-monnier+emacs@HIDDEN> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> Date: Fri, 24 Nov 2023 15:22:10 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.033 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > I can think of a way to do this (indeed, I've got a trial implementation > here which works). Eager to see it, Stefan
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 24 Nov 2023 18:48:57 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 24 13:48:57 2023 Received: from localhost ([127.0.0.1]:37261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6bEX-0007Rq-0G for submit <at> debbugs.gnu.org; Fri, 24 Nov 2023 13:48:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1r6bEV-0007RM-6w for 67196 <at> debbugs.gnu.org; Fri, 24 Nov 2023 13:48:55 -0500 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 <eliz@HIDDEN>) id 1r6bEJ-00078A-U8; Fri, 24 Nov 2023 13:48:44 -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=GYfqObDH7EPhSFpkVjuBEb4QMRaw31OPJPeTi4sla/0=; b=DBLU/pfrxPlf kg2H7NPYuIKHD7Zoo/K5b7nGsYq4Mn2f5oxuWfnRFraZmXgUZLCi/X9YRS16I9OaqeXgwvBRryOPR fZQ0wBCURwuLKHbwPjHImM+xS4nsV9ZxiKLvg61zP0vhZRyospyuAuf1SgjLz+/l82HdS7d1wgB4/ 1VpW/e/TPyD9ivyCNV3lRdqeAMsJ/wHA79MWS5S7vg/3n39r30Jd09VyCGABlMLPs47EoHp6DXUkZ 9PGNjAjAwLwrc/1s9Mj4N2pCD2BEcChwNt4FZ1ELqCHQgyoeKll7+oIkV+lXTnRo0wKuYwDQTqQFd FbElKlLKGipx1t6KxKgDew==; Date: Fri, 24 Nov 2023 20:48:40 +0200 Message-Id: <83ttpbdm2f.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> In-Reply-To: <ZWDZF17mTpJp48ly@ACM> (message from Alan Mackenzie on Fri, 24 Nov 2023 17:10:47 +0000) Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <ZWDZF17mTpJp48ly@ACM> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, monnier@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Fri, 24 Nov 2023 17:10:47 +0000 > Cc: Eli Zaretskii <eliz@HIDDEN>, 67196 <at> debbugs.gnu.org > From: Alan Mackenzie <acm@HIDDEN> > > 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'. First, the last two sentences above should be transposed, as the second one is not related to the 1st one, but the 3rd one is. And second, please try to reword so that the text is less complicated and easier to understand. Thanks.
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 24 Nov 2023 17:11:03 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 24 12:11:03 2023 Received: from localhost ([127.0.0.1]:37150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r6Zhn-0004mf-Gv for submit <at> debbugs.gnu.org; Fri, 24 Nov 2023 12:11:03 -0500 Received: from mail.muc.de ([193.149.48.3]:41682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acm@HIDDEN>) id 1r6Zhi-0004m5-I8 for 67196 <at> debbugs.gnu.org; Fri, 24 Nov 2023 12:11:01 -0500 Received: (qmail 10819 invoked by uid 3782); 24 Nov 2023 18:10:48 +0100 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 Received: (qmail 24659 invoked by uid 1000); 24 Nov 2023 17:10:47 -0000 Date: Fri, 24 Nov 2023 17:10:47 +0000 To: Stefan Monnier <monnier@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Message-ID: <ZWDZF17mTpJp48ly@ACM> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie <acm@HIDDEN> X-Primary-Address: acm@HIDDEN X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) 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).
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 19 Nov 2023 19:30:53 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 19 14:30:53 2023 Received: from localhost ([127.0.0.1]:52110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r4nVM-0001fl-Os for submit <at> debbugs.gnu.org; Sun, 19 Nov 2023 14:30:52 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1r4nVI-0001fW-BX for 67196 <at> debbugs.gnu.org; Sun, 19 Nov 2023 14:30:51 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4399E1000BC; Sun, 19 Nov 2023 14:30:41 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700422240; bh=A+wcE4j9hjUI67bDtJS5L1iyrBDI41+v3aH581P67bo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dq9ot/DkvBuwOhWUfESIe6dgGVoIXCHEgEgY8mm8H81Q+Z8Mk3zRGTN1uQDCuRa1Z mWcfNq3csMLllWEWqe7qqkE9rReqxiBM0jzDp2fSjSDmbZLuiEfOq+ES5R47bQSkHd 5ISaIBI+SAFKXqREB4gKHkhO1bFbgAn+fWbdW50yGrC+3NEjvisGj6SO+FwDQ90q2P UqePXfx70mRQhOJZxGaVkiUp4eQ2LnVFJo3Rgt0CicZpHzdf2u+FS7esw/ifeKTmMv wFcA8odlnONwBfrq9iKyVF7iwrpjvCfFNSc82ZGeMKF+ND0JF4F1ieSnumOvgSC2tS 9/+d/bKH3gglg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 90150100061; Sun, 19 Nov 2023 14:30:40 -0500 (EST) Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 612161201B2; Sun, 19 Nov 2023 14:30:40 -0500 (EST) From: Stefan Monnier <monnier@HIDDEN> To: dick <dick.r.chiang@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. In-Reply-To: <87a5r9efj0.fsf@dick> (dick's message of "Sun, 19 Nov 2023 13:58:43 -0500") Message-ID: <jwvedglee6c.fsf-monnier+emacs@HIDDEN> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> <83fs11k5qb.fsf@HIDDEN> <87a5r9efj0.fsf@dick> Date: Sun, 19 Nov 2023 14:30:40 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.129 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, acm@HIDDEN, Eli Zaretskii <eliz@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Eli wrote: > This is Emacs: the impossible we do today; miracles take > a little longer. To which dick wrote: > I assure you your smug self-satisfaction is shared only by the > unemployable programmers you compare yourself to. Thank you Dick for the subtle comic relief. Stefan
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 19 Nov 2023 17:34:20 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 19 12:34:20 2023 Received: from localhost ([127.0.0.1]:52027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r4lga-0004ZH-Cw for submit <at> debbugs.gnu.org; Sun, 19 Nov 2023 12:34:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1r4lgV-0004Z1-Ih for 67196 <at> debbugs.gnu.org; Sun, 19 Nov 2023 12:34:19 -0500 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 <eliz@HIDDEN>) id 1r4lgN-00037j-TM; Sun, 19 Nov 2023 12:34:07 -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=4XelMwY07oFU9rjCoQOCexyLaZLZpq3y4dK72ZAboVA=; b=IZ9G/VyWT5F7 POKSQe4XtsMdE0PD8HEKyn+LjoDtf6mTdcgCT8hVxp2M5S5irIGxpK/DkJ+7dE4oCpISX976fKmOV fw0CymHgya7uvO9cwqOU2pzNFUV85Vy7DVDD/etCSFsEZn/Y7sVopfZHjKlFFadxeH0UXdxqMiDJa bAK914FeyuNwDa7/KwOlqk3mrBODzFU+51xI4ot1HryrEMo8X3pl4b4RqwzPacVEFzz5Pr11dFgMT Cru+lSrLO4sxn/61U80TDnccPujOqJj1MnMXIv+gEhflFOvrwzJGjZyQbpsfanWa07uV2MXv6AIkA e8egRXdAT+xXoThy5EXTEQ==; Date: Sun, 19 Nov 2023 19:33:48 +0200 Message-Id: <83fs11k5qb.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Stefan Monnier <monnier@HIDDEN> In-Reply-To: <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> (message from Stefan Monnier on Sun, 19 Nov 2023 12:19:49 -0500) Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, acm@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Stefan Monnier <monnier@HIDDEN> > Cc: Eli Zaretskii <eliz@HIDDEN>, 67196 <at> debbugs.gnu.org > Date: Sun, 19 Nov 2023 12:19:49 -0500 > > it gives me the impression we're trying some impossible feat like > watching oneself sleep. This is Emacs: the impossible we do today; miracles take a little longer.
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 19 Nov 2023 17:20:03 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 19 12:20:03 2023 Received: from localhost ([127.0.0.1]:52019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r4lSk-0004DG-SR for submit <at> debbugs.gnu.org; Sun, 19 Nov 2023 12:20:03 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <monnier@HIDDEN>) id 1r4lSg-0004Cf-JN for 67196 <at> debbugs.gnu.org; Sun, 19 Nov 2023 12:20:02 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 98DE88076C; Sun, 19 Nov 2023 12:19:51 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700414390; bh=ucPeXfSj5FEP+jnofUd43Gv82WpJ7KtXn+fDCZua4zQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TY206xjC01/obu93B5erU56Q6CxfoNGBdfDXhRBfBmvUf4n1CgQl0LCDkRUJpognL EXF5R40e/KcCjDwImM0xYjICgOG5Dsy9pQn+rVv8PQievpmMIy0Fux88phgiF1VoQb +LocFBJkg6wO8yscee6km5Ukbr67WDuNTVCTrzs2A5rpTyTPUX78WbZ2UO5F6Fggm7 fP/h0uXFCtHVPNmxv6LFy+siZ/7j+IYapAeh0+/NPxrkb97HyvCqoyzLDA9pYmI+XE rDBq5ox4T6cUBwMcIYOeAI6mTyBBVrkKjYsNlrwlTbSa82JLDBgX+D6PuofeDZjjBL M/+CVVN7z6IgA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C4D9D8024B; Sun, 19 Nov 2023 12:19:50 -0500 (EST) Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9A1661203EF; Sun, 19 Nov 2023 12:19:50 -0500 (EST) From: Stefan Monnier <monnier@HIDDEN> To: Alan Mackenzie <acm@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. In-Reply-To: <ZVUGBolDKfgLNEy8@ACM> (Alan Mackenzie's message of "Wed, 15 Nov 2023 17:55:18 +0000") Message-ID: <jwvjzqdekij.fsf-monnier+emacs@HIDDEN> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> <ZVUGBolDKfgLNEy8@ACM> Date: Sun, 19 Nov 2023 12:19:49 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.022 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > 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. Stefan
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 15 Nov 2023 17:55:27 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 15 12:55:27 2023 Received: from localhost ([127.0.0.1]:53730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r3K6p-0001yA-0W for submit <at> debbugs.gnu.org; Wed, 15 Nov 2023 12:55:27 -0500 Received: from mail.muc.de ([193.149.48.3]:33689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acm@HIDDEN>) id 1r3K6m-0001xt-61 for 67196 <at> debbugs.gnu.org; Wed, 15 Nov 2023 12:55:25 -0500 Received: (qmail 61466 invoked by uid 3782); 15 Nov 2023 18:55:19 +0100 Received: from acm.muc.de (p4fe15c08.dip0.t-ipconnect.de [79.225.92.8]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 15 Nov 2023 18:55:18 +0100 Received: (qmail 24204 invoked by uid 1000); 15 Nov 2023 17:55:18 -0000 Date: Wed, 15 Nov 2023 17:55:18 +0000 To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Message-ID: <ZVUGBolDKfgLNEy8@ACM> References: <ZVTMOH229jaiw86s@ACM> <83a5rfq6i2.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83a5rfq6i2.fsf@HIDDEN> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie <acm@HIDDEN> X-Primary-Address: acm@HIDDEN X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Eli. On Wed, Nov 15, 2023 at 19:19:17 +0200, Eli Zaretskii wrote: > > Date: Wed, 15 Nov 2023 13:48:40 +0000 > > From: Alan Mackenzie <acm@HIDDEN> > > Hello, Emacs. > > On the master branch (and probably any recent Emacs): > > (i) emacs -Q > > (ii) C-h v debug-on-error RET > > (iii) M-: debug-on-error RET > > >From (ii) it will be seen that debug-on-error's value is nil. > > (iii) wrongly reports that its value is t. This is a bug. > > ######################################################################### > > What is happening here is that eval-expression binds debug-on-error to > > an uninterned symbol called "t", so that d-o-e will be set to non-nil > > for the evaluation of the coming form. > > This has the unwanted side effect of ignoring the actual value of d-o-e > > in forms which use it. For example, if the variable is set to a list of > > error symbols, this value gets ignored on evaluating a form with M-:. > Aren't we doing this on purpose, Stefan? 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. It would seem to me we really need two distinct variables for these two purposes. I think it's clear that purpose (ii) would be the one to retain use of debug-on-error. -- Alan Mackenzie (Nuremberg, Germany).
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at 67196) by debbugs.gnu.org; 15 Nov 2023 17:19:34 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 15 12:19:34 2023 Received: from localhost ([127.0.0.1]:53502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r3JY6-0006ZH-7B for submit <at> debbugs.gnu.org; Wed, 15 Nov 2023 12:19:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1r3JY4-0006Z0-5H for 67196 <at> debbugs.gnu.org; Wed, 15 Nov 2023 12:19:32 -0500 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 <eliz@HIDDEN>) id 1r3JXy-0002m0-6d; Wed, 15 Nov 2023 12:19:26 -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=7sEa6aX/LwDlxP66Y0ZK70lMx4pub+pJz8pR8tt5tss=; b=dswCjmtoIaYl UUFVzvi6N6aXtMm6cfTkWHeJxROYcWDDkoYcMy/OGqLKTnA8TKj1gZG/GGjNmP+wy6TQ0spac1/eK rSH+QlThK1RXW+lSuosZuYlINUj/2efMwTbkfqDpNmDXkxsRpt/C5zhjqMX4xUPinhovBak42px8/ df14P6NY8E3+HuIi+BfdVZ/RU2Hu44y4hinhquc+Cuz/9lwVD6TzIBCvd3dE0FDna5+4K0HNU3Itz NdFCiK8o730/YwEmARajaMebTp2Ffo8zN2faAf5DaFG2EEff1VsEhvvZc1TtbaAn+IhCMIQWo1hlG Snxwa0ASt7IV7jWmCGYEkQ==; Date: Wed, 15 Nov 2023 19:19:17 +0200 Message-Id: <83a5rfq6i2.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Alan Mackenzie <acm@HIDDEN>, Stefan Monnier <monnier@HIDDEN> In-Reply-To: <ZVTMOH229jaiw86s@ACM> (message from Alan Mackenzie on Wed, 15 Nov 2023 13:48:40 +0000) Subject: Re: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. References: <ZVTMOH229jaiw86s@ACM> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67196 Cc: 67196 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Wed, 15 Nov 2023 13:48:40 +0000 > From: Alan Mackenzie <acm@HIDDEN> > > Hello, Emacs. > > On the master branch (and probably any recent Emacs): > > (i) emacs -Q > (ii) C-h v debug-on-error RET > (iii) M-: debug-on-error RET > > >From (ii) it will be seen that debug-on-error's value is nil. > (iii) wrongly reports that its value is t. This is a bug. > > ######################################################################### > > What is happening here is that eval-expression binds debug-on-error to > an uninterned symbol called "t", so that d-o-e will be set to non-nil > for the evaluation of the coming form. > > This has the unwanted side effect of ignoring the actual value of d-o-e > in forms which use it. For example, if the variable is set to a list of > error symbols, this value gets ignored on evaluating a form with M-:. Aren't we doing this on purpose, Stefan?
bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 15 Nov 2023 17:02:05 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 15 12:02:04 2023 Received: from localhost ([127.0.0.1]:53333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1r3JHA-0005z1-Je for submit <at> debbugs.gnu.org; Wed, 15 Nov 2023 12:02:04 -0500 Received: from lists.gnu.org ([2001:470:142::17]:49592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <acm@HIDDEN>) id 1r3JH8-0005xa-1V for submit <at> debbugs.gnu.org; Wed, 15 Nov 2023 12:02:03 -0500 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 <acm@HIDDEN>) id 1r3GGR-00007v-Ni for bug-gnu-emacs@HIDDEN; Wed, 15 Nov 2023 08:49:07 -0500 Received: from mail.muc.de ([193.149.48.3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <acm@HIDDEN>) id 1r3GGP-000724-Nr for bug-gnu-emacs@HIDDEN; Wed, 15 Nov 2023 08:49:07 -0500 Received: (qmail 79097 invoked by uid 3782); 15 Nov 2023 14:48:41 +0100 Received: from acm.muc.de (p4fe15c08.dip0.t-ipconnect.de [79.225.92.8]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 15 Nov 2023 14:48:40 +0100 Received: (qmail 11906 invoked by uid 1000); 15 Nov 2023 13:48:40 -0000 Date: Wed, 15 Nov 2023 13:48:40 +0000 To: bug-gnu-emacs@HIDDEN Subject: M-: uses a wrong value of debug-on-error when it is nil. Message-ID: <ZVTMOH229jaiw86s@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie <acm@HIDDEN> X-Primary-Address: acm@HIDDEN Received-SPF: pass client-ip=193.149.48.3; envelope-from=acm@HIDDEN; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.1 (/) Hello, Emacs. On the master branch (and probably any recent Emacs): (i) emacs -Q (ii) C-h v debug-on-error RET (iii) M-: debug-on-error RET From (ii) it will be seen that debug-on-error's value is nil. (iii) wrongly reports that its value is t. This is a bug. ######################################################################### What is happening here is that eval-expression binds debug-on-error to an uninterned symbol called "t", so that d-o-e will be set to non-nil for the evaluation of the coming form. This has the unwanted side effect of ignoring the actual value of d-o-e in forms which use it. For example, if the variable is set to a list of error symbols, this value gets ignored on evaluating a form with M-:. -- Alan Mackenzie (Nuremberg, Germany).
Alan Mackenzie <acm@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#67196
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.