From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67196: M-: uses a wrong value of debug-on-error when it is nil. Date: Sat, 25 Nov 2023 15:04:08 +0200 Message-ID: <8334wuc7cn.fsf@gnu.org> References: <83ttpbdm2f.fsf@gnu.org> <83il5qe00e.fsf@gnu.org> <83edgecce4.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7963"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67196@debbugs.gnu.org, monnier@iro.umontreal.ca To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 25 14:05:11 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 1r6sLO-0001t2-Sa for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Nov 2023 14:05:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6sLD-0005OI-PD; Sat, 25 Nov 2023 08:04: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 1r6sLB-0005OA-Bh for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 08:04: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 1r6sLB-000515-0Z for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 08:04:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6sLF-0007Bg-Un for bug-gnu-emacs@gnu.org; Sat, 25 Nov 2023 08:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Nov 2023 13:05:01 +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.170091746627557 (code B ref 67196); Sat, 25 Nov 2023 13:05:01 +0000 Original-Received: (at 67196) by debbugs.gnu.org; 25 Nov 2023 13:04:26 +0000 Original-Received: from localhost ([127.0.0.1]:38113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6sKg-0007AO-0k for submit@debbugs.gnu.org; Sat, 25 Nov 2023 08:04:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6sKe-0007A8-Lx for 67196@debbugs.gnu.org; Sat, 25 Nov 2023 08:04:25 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 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==; In-Reply-To: (message from Alan Mackenzie on Sat, 25 Nov 2023 12:40:03 +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:274974 Archived-At: > Date: Sat, 25 Nov 2023 12:40:03 +0000 > Cc: monnier@iro.umontreal.ca, 67196@debbugs.gnu.org, acm@muc.de > From: Alan Mackenzie > > > 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.