From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Date: Sat, 25 Nov 2023 09:23:42 -0500 Message-ID: References: <83a5rfq6i2.fsf@gnu.org> <83ttpbdm2f.fsf@gnu.org> <83il5qe00e.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20272"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67196@debbugs.gnu.org, Eli Zaretskii To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 25 15:24:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r6ta7-00053N-0q for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Nov 2023 15:24:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6tZf-00036Y-8o; Sat, 25 Nov 2023 09:23:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6tZd-00035u-OE for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 09:23:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6tZd-00052a-Gj for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 09:23:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6tZi-0000zS-JG for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 09:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Nov 2023 14:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67196 X-GNU-PR-Package: emacs Original-Received: via spool by 67196-submit@debbugs.gnu.org id=B67196.17009222373787 (code B ref 67196); Sat, 25 Nov 2023 14:24:02 +0000 Original-Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 14:23:57 +0000 Original-Received: from localhost ([127.0.0.1]:38228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6tZc-0000z1-Tk for submit@debbugs.gnu.org; Sat, 25 Nov 2023 09:23:57 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6tZa-0000yo-N4 for 67196@debbugs.gnu.org; Sat, 25 Nov 2023 09:23:55 -0500 Original-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== Original-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) Original-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) In-Reply-To: (Alan Mackenzie's message of "Sat, 25 Nov 2023 10:32:23 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274981 Archived-At: > 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