From unknown Sun Aug 17 04:19:24 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#76949 <76949@debbugs.gnu.org> To: bug#76949 <76949@debbugs.gnu.org> Subject: Status: 30.1; --debug-init and condition-case-unless-debug Reply-To: bug#76949 <76949@debbugs.gnu.org> Date: Sun, 17 Aug 2025 11:19:24 +0000 retitle 76949 30.1; --debug-init and condition-case-unless-debug reassign 76949 emacs submitter 76949 "Nussbaum Ferdinand" severity 76949 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 13:19:56 2025 Received: (at submit) by debbugs.gnu.org; 11 Mar 2025 17:19:56 +0000 Received: from localhost ([127.0.0.1]:45383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ts3Gl-00004r-6U for submit@debbugs.gnu.org; Tue, 11 Mar 2025 13:19:55 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53236) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ts3Gf-0008W1-Tw for submit@debbugs.gnu.org; Tue, 11 Mar 2025 13:19:50 -0400 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 1ts3GE-0006aO-Im for bug-gnu-emacs@gnu.org; Tue, 11 Mar 2025 13:19:26 -0400 Received: from mail-switzerlandnorthazlp170100000.outbound.protection.outlook.com ([2a01:111:f403:c213::] helo=ZRAP278CU002.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts3G6-0002kZ-MM for bug-gnu-emacs@gnu.org; Tue, 11 Mar 2025 13:19:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TH8fs9gbB8NLlu8ifJhIaEMbJpXJmIXPkiZBhB6wJ1o/ryVjfpFTqcrmJFIFK2mxGjZWl2usirl4KkUYRL6ZQKFExHwU0wMJahByVHMCn5oKZ9fjAhk3uFoHNREU6ofkedhVfpOVmm/NM0NoSIlN36pmosFpouj5c9c/Y40gRZmZF0KjZXncuEMFFdO2Z8tjWQ3fH9Ow6Dc/0KKJbdpEdaur4E6WjMyZU+rhhtIynoS+w8p2zgHM+aBKa0htHC7Im8JwmDOGuU15peoapwxum4ZIZZkEqD5o4VcJR8U+t4CwGUTlmnEAe0xwE+chtkxWbftujK06rRq6HFv9NOm3gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E94xiLzEokq6tDTOoCGaxVJm1AapkPsWOwdh30lIX+k=; b=a3VVMwIMlAwLvJvEp3YaFzYNCgB2U/CXF8fuGFISeceZEs5v4RPJpRzpNYC3VKu0C3aVpMxXmy0CsdY+8TSZCde3wZpoWx/yOhNecGFV2iDs/AgW6v+o19+Pc7Zdwd84bHaOOV02Dvnet3kOrDZ4WoTqQ1pTdo20xPNW1KEcrfMiLgu4/igI8c7U7B8hVGiJEgNtOjeK+B2JhnNN3ILN4mpU1vLfTSFcHY9wtyCfb8pHau0v/MDewsudsSk8aXtsYnNxCVd0cRF84/ecYZnYPIrEYUxYSEd3pMueC7yE/blkDFFj/l1oXzBJ5wO75Qsi3RQpe5QmwDkLMuS4SkweOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=inf.ethz.ch; dmarc=pass action=none header.from=inf.ethz.ch; dkim=pass header.d=inf.ethz.ch; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ethz.onmicrosoft.com; s=selector1-ethz-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E94xiLzEokq6tDTOoCGaxVJm1AapkPsWOwdh30lIX+k=; b=nNuLoOY6dzyfPypYULKimbwRhFA7QrPXmQtPgsb0+4fFB0AVX61K6aOL01PENNK4mOiP1CUzZvQ6N+W+e5lnwaiBGgYbzEAdj59A9T7qMZyhvBJqmRz8IZgB44cH09III9zzPmtD/KD9tfGNaNkr78zDQrrc1pi4P7+qbHUzmNc= Received: from GV0P278MB1254.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:5d::8) by ZR0P278MB1285.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:81::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8511.27; Tue, 11 Mar 2025 17:13:56 +0000 Received: from GV0P278MB1254.CHEP278.PROD.OUTLOOK.COM ([fe80::a450:70ed:589b:8298]) by GV0P278MB1254.CHEP278.PROD.OUTLOOK.COM ([fe80::a450:70ed:589b:8298%2]) with mapi id 15.20.8511.026; Tue, 11 Mar 2025 17:13:56 +0000 From: "Nussbaum Ferdinand" To: "bug-gnu-emacs@gnu.org" Subject: 30.1; --debug-init and condition-case-unless-debug Thread-Topic: 30.1; --debug-init and condition-case-unless-debug Thread-Index: AQHbkbrNmxixvug+cUOO4PnlptnWrw== Date: Tue, 11 Mar 2025 17:13:56 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=inf.ethz.ch; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: GV0P278MB1254:EE_|ZR0P278MB1285:EE_ x-ms-office365-filtering-correlation-id: c4d5cc45-e4e2-4790-46d7-08dd60c01b8f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|366016|10070799003|1800799024|8096899003|38070700018; x-microsoft-antispam-message-info: =?Windows-1252?Q?4oCBD0fQDfg85lspqSEwfpKEZu84tVyek0gWU4nZoWqq3uE96vuoSNI8?= =?Windows-1252?Q?7J6f8dduhleBj1EHxzWUg2jjfQLnHzc6XvlzIZnKINylFbn0D+mcLk1F?= =?Windows-1252?Q?JkkaA70vKlzU4mTG/n7PeBbrQzob1HOVAOw0A0tddigztX8zBo8dAwgJ?= =?Windows-1252?Q?JG1uKD/EWSjtEMF5n20rcTbsFLEP9eEAdP8gNCHAzzReQdoPwBn4uk/1?= =?Windows-1252?Q?Ubv8IxQDq63j/WHEG++UpZRy1W+xBcz/Nui/XG02SrxoK5dj9Fi1YZtQ?= =?Windows-1252?Q?RlWwqEzLTy2DJP51Pw1XT/fDPcFGmOZtosLHaLQuZdCmZleyMsnv8CQv?= =?Windows-1252?Q?QsNfazfCXweHYAkw1UJPTXaZWNw4jF/ysZ8L24lOeTZf88I7tWNLU6U2?= =?Windows-1252?Q?VVc6yEiScSITImcr5RX/BPLGdGkhQLbaDTGn99tknF4DNX9s3bbPQtnG?= =?Windows-1252?Q?t3TlaVyRJRqI2czgNSw1/pWI4JrHoiPLsFm+866m5Eh+nLVMjRlOyoNo?= =?Windows-1252?Q?/pNdXzTq2Fz4TxCYnfE8WMe/MyI8FJmVHYTw6Bur7vHpLOfm4OyE9CuL?= =?Windows-1252?Q?EBCWyrjBwIJKU14O7qrbxyx20TqPg3O5BLFK9CfKFGHOFkRnAgBOVfGG?= =?Windows-1252?Q?NOzT2TzuM2A/SzZqnOIZqmM2U67q6rF0g5P1XM8yhNG8AonGAtGHQxjA?= =?Windows-1252?Q?UzOYgktCZXsO3b1I/tNtxBtBaEzVhdUGDJlnX8nvfOdNMpcfbBih7bct?= =?Windows-1252?Q?neVsxRN2utyuw1td+cG1oVMQJzJIvjw+lXm2TugHN/7afnGiiBoXj8H4?= =?Windows-1252?Q?uZH+GQkQTcWsvKQ7V28cqQfEEJx5y7kVWWmnmClW76axyDBNI0oaFqqM?= =?Windows-1252?Q?LNnsIDwS8IX9HgBra0RfzCqJk8YIsHoK6f6tNhtKbDHwrGumcijQ4T37?= =?Windows-1252?Q?RFKKIsP49YGdHvFlAgSs44zO7dPXV0yegPzlDCSV63+tEHYyPFmtWa28?= =?Windows-1252?Q?5jiTJInLYzWEGeNCgI2qMHQs/LLuAyt7DMXpW4p37C4EsaPWCDIM5Oyf?= =?Windows-1252?Q?QC95RFmy93yoI10cDU8SYivfIr6grErbsANx0IRF+JCpU6TO9/BHW6nj?= =?Windows-1252?Q?RZtRo0DmygCBxHxulhEgr+1iMFSvAt2TAEC7K3ihTameYYpK/vE0Osqn?= =?Windows-1252?Q?7CXytRX5Hgz4rbpAOKY8/SSK/61Q/LzjUHA543/BLyf8hslySMlyBIKx?= =?Windows-1252?Q?xhmOh+4gikvdPDzvzjCq4HapJRikoOHbZjAxtzIYNME3RYZ4bVL1PA6T?= =?Windows-1252?Q?/BYlXllMNMLedoF6QpcVt2E3zUZRNbzcXfb85QkcDdflf5Hsko0PNdYI?= =?Windows-1252?Q?jFkImAJ9nTiahwDNKlRTt7p+MxobtAIDVjcOmrzVzom4YYLnRSBuuagN?= =?Windows-1252?Q?a/aqiZInkhCsr5hPNvIp9mw1TA6tvnb24PJzNJlVNuIWVFSxnOFRqog4?= =?Windows-1252?Q?uq4ltF6Zxh6WkmJ+7335r434MRnrQQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:GV0P278MB1254.CHEP278.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(10070799003)(1800799024)(8096899003)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?zPW58SfPgfIw1xAo11OAiz+F7gl3/bOn1bX7Uc2LWDmwq91Gp+bn9dYU?= =?Windows-1252?Q?p/9//a6GQ+CaC2QRfkRqhl4qG2skL0/IdF4JklrIlwh88HjMGqRmSOMY?= =?Windows-1252?Q?WhFunRpub8Z/72pz8260YPX9nq3Epoz/JrJFoCO5z6xkMRfytGH1iyKI?= =?Windows-1252?Q?7fXgLzHGauUvHXtVH4aWv3MhmNlxve0KephJX+DLImVLzSPPjRliBVIn?= =?Windows-1252?Q?dgzIauV2j0lzmw3BNKtDerp2vVHTGXZxR7eOntBpFmU+sBWEm0WQsdr1?= =?Windows-1252?Q?ELxdc+jrM9g5aB+C4mIZGiIfsQY182qVQArocP3oP8+LjN8Uv4gpyJMS?= =?Windows-1252?Q?28jdhJ3oXAjLmyjQVCkAWM4aEjvWcyj2DePnPWkNV9vegzHGcucB7PK0?= =?Windows-1252?Q?gdKLfBg0mZGrk+u4k2NKABuyUNJiDhiQoVqyeYD/6tTrryWHg/wnljKv?= =?Windows-1252?Q?4WtUFW/GUI32YjhXTnmMZKM3ERKRIF4Xn5FpTEdSYygTyzx0GEJ4+UmT?= =?Windows-1252?Q?Ht/r0N18nUNGy/U0qytdK7/pR/xQUAu1aMf2OWkg6yYabp65bQDWYUfx?= =?Windows-1252?Q?tV5i1X09stSMlycCjDTZY66AIGtpzBKV8ALgMWzmEXtQjfnf2iGMkB1x?= =?Windows-1252?Q?DLVK4k5ySs1IKGLyC9vyHiS2KTJb2E+5Z7/RaZ+6u2bWUN8TQMn2/K63?= =?Windows-1252?Q?QvOCt+wvT6ZEJHHlttCm742xpf+fxWRwOqlki6loLeW8Cyl/EeteVnKe?= =?Windows-1252?Q?DF4aTfPwo3gW4xd+syhVwO6ChKc4OWCobh+JaXtlKL8ATXvL6bsfit1C?= =?Windows-1252?Q?48VdIiJURSUUMokEcZ8CxynLAxJzIptRGAfcCCE8EDpcbDJrktYqXLOP?= =?Windows-1252?Q?T7kpcKU1PvZpCiJcI0iadEdPlGmDsEl+tgzZCmUsDHxxrRakcjXlsLne?= =?Windows-1252?Q?H0UbJSdYqfgC64l7ZRMTmVI0lsEACLDhncF9aQVxFKbeaoYCqBZd71I0?= =?Windows-1252?Q?QSJheWBcEWC+PrdbhGts3cHIWWMFzbjLepIhlGr9w53QOWzzETa5/Shs?= =?Windows-1252?Q?gGsrvWpwrzhy3BCC7YdnJzBn21hKwce1D1P843lkn8OWhCAT/uH/wVyH?= =?Windows-1252?Q?ixal3ney3jVN7ls5JsYGY3YKJgzTxvyh65cYNxmxvH5dVr2UGsy1S/a1?= =?Windows-1252?Q?dR6m9WstAwcsPeW0Wl4Kt9HHx3LC7FrDTfdiLO+k4/HbhZ9u5HP/i/pU?= =?Windows-1252?Q?zQJEp6vgZ+Gcu/Z0s6KVQRtWVkJt6E1w3bNt4eKtKW4IsQ1TpOWJFTLc?= =?Windows-1252?Q?NdatL0rrSBuHmouZ/VNGL0G5ioZwLtuxOBAAeezuZiZMPnNVsKQZC5N1?= =?Windows-1252?Q?nAm4iJ8p/o8pnng85zAj2mP86AMA+DrSKFGoXkmwRFw7LVCfFVrjwgIU?= =?Windows-1252?Q?zKBXZt01v74EkibGbyLfhpCgwaY2FwkGv66t+qqx1q2RMwxAzw7eexZ3?= =?Windows-1252?Q?HmqRoeK5dmVCChcxd/o/LwHCQZerizfdXF+qZ4ViGQzkXtUQUP7CSdQJ?= =?Windows-1252?Q?JhDswfymv6KmAfwo8p/+V+OwZ1Vm1axxPZJ8usl3wJYUBFXtDA8/5Hr6?= =?Windows-1252?Q?/gNeG22+2pmUAokoBobNluZYI2BO4Y3j1+E0cZTE26F/O/VyZVehXc7Y?= =?Windows-1252?Q?H2C0uUyQEzcHiEUww9QaSSJYIGv3Ba2YQ73tXCxfY5P55AGynLjJm3YX?= =?Windows-1252?Q?imfDkBNe2E1U5uzd+Pk=3D?= Content-Type: multipart/alternative; boundary="_000_GV0P278MB125423C7034727B3B1171ADAC4D62GV0P278MB1254CHEP_" MIME-Version: 1.0 X-OriginatorOrg: inf.ethz.ch X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: GV0P278MB1254.CHEP278.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: c4d5cc45-e4e2-4790-46d7-08dd60c01b8f X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2025 17:13:56.8711 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9634a6ec-a266-45a3-ab14-74c4211fc582 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /Wx1dr4x1WvnIMIS2iUTyzvOOq5NSdG6/T+GV+GVdZdXw2jqBF0wOvTjEdQSoJuaKKMHQ3xFNv3imlyoVdpIgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZR0P278MB1285 Received-SPF: pass client-ip=2a01:111:f403:c213::; envelope-from=ferdinand.nussbaum@inf.ethz.ch; helo=ZRAP278CU002.outbound.protection.outlook.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: "me@bcc32.com" , "monnier@iro.umontreal.ca" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --_000_GV0P278MB125423C7034727B3B1171ADAC4D62GV0P278MB1254CHEP_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Errors inside condition-case-unless-debug do not trigger the debugger when = the --debug-init startup option is set (and debug-on-error is not additionally = and explicitly set to a non-nil value). This can be reproduced, for example, by adding the following to init.el: (condition-case-unless-debug nil (error "error") (error (message "error caught"))) and restarting Emacs with --debug-init. In Emacs 29 this enters the debugge= r (as expected), while in Emacs 30 the message "error caught" is displayed. On a related note, the Emacs Lisp reference manual still says the following= : "[...] use the option =91--debug-init=92. This binds debug-on-error to t while loa= ding the init file, [...]". (https://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.= html#Error-Debugging) AFAICT this is no longer correct since the implementation uses handler-bind= instead. (Originally reported in https://github.com/syl20bnr/spacemacs/issues/16871 and https://github.com/syl20bnr/spacemacs/issues/16619#issuecomment-2708510= 954.) Best, Ferdinand --_000_GV0P278MB125423C7034727B3B1171ADAC4D62GV0P278MB1254CHEP_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Err= ors inside condition-case-unless-debug do not trigger the debugger when the=
--debug-init startup option is set (and debug-on-error is not additionally = and
explicitly set to a non-nil value).

This can be reproduced, for example, by adding the following to init.el:

(condition-case-unless-debug nil
    (error "error")
  (error
   (message "error caught")))

and restarting Emacs with --debug-init. In Emacs 29 this enters the debugge= r
(as expected), while in Emacs 30 the message "error caught" is di= splayed.

On a related note, the Emacs Lisp reference manual still says the following= : "[...]
use the option =91--debug-init=92. This binds debug-on-error to t while loa= ding the
init file, [...]".
(https://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.= html#Error-Debugging)
AFAICT this is no longer correct since the implementation uses handler-bind= instead.

(Originally reported in https://github.com/syl20bnr/spacemacs/issues/16871<= /div>
and https://github.com/syl20bnr/spacemacs/issues/16619#issuecomment-2708510= 954.)

Best,
Ferdinand
--_000_GV0P278MB125423C7034727B3B1171ADAC4D62GV0P278MB1254CHEP_-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 11 16:42:06 2025 Received: (at submit) by debbugs.gnu.org; 11 Mar 2025 20:42:06 +0000 Received: from localhost ([127.0.0.1]:45993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ts6QQ-0004VU-Hz for submit@debbugs.gnu.org; Tue, 11 Mar 2025 16:42:06 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34192) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ts6QN-0004Us-FZ for submit@debbugs.gnu.org; Tue, 11 Mar 2025 16:42:04 -0400 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 1ts6QF-0006V9-5N for bug-gnu-emacs@gnu.org; Tue, 11 Mar 2025 16:41:55 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts6QA-0006m3-3l for bug-gnu-emacs@gnu.org; Tue, 11 Mar 2025 16:41:54 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B0552443569; Tue, 11 Mar 2025 16:41:44 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1741725703; bh=PqeJkDqVsSjhZhboJMrYDb6h+fFQFXchVn4+wX+h3+M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dPxIFJFds5LziQmkofaHTqJ+/wcYgtHhQjnxrDsKhkZeFg7HCqJdA0blH8bgiFl8m 03F1A1VknJSf9inZOG6IRuF+odkKMZZQndXQnQjlqrFpSecoGYNmB50FMKFNKLGEyY tQalX5QS7l1ubRp1yTet6Z75YWKrXPKUa2yXmPEOTuvWnHIEx+be/zCg5xPYYbqkbS n1ZDMSl3a+AFZvhV06emtEjE7LD7Sy96+8o1CZbldMeygPzu7mtnBYkbzOfOKsUWwc RZMjHRbW7zeUWbbZbNYEPspua+yAOBqmFBR/YsiFyR3AEZaowXQC1b8pwzH+MWxAmz oNAKXtNJnrlRw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B3302443566; Tue, 11 Mar 2025 16:41:43 -0400 (EDT) Received: from pastel (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 81AB0120644; Tue, 11 Mar 2025 16:41:43 -0400 (EDT) From: Stefan Monnier To: "Nussbaum Ferdinand" Subject: Re: 30.1; --debug-init and condition-case-unless-debug In-Reply-To: (Nussbaum Ferdinand's message of "Tue, 11 Mar 2025 17:13:56 +0000") Message-ID: References: Date: Tue, 11 Mar 2025 16:41:42 -0400 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.369 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 X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit Cc: "bug-gnu-emacs@gnu.org" , "me@bcc32.com" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Errors inside condition-case-unless-debug do not trigger the debugger when the > --debug-init startup option is set (and debug-on-error is not additionally and > explicitly set to a non-nil value). Indeed this is the direct consequence of: > AFAICT this is no longer correct since the implementation uses handler-bind instead. It seems cumbersome to fix this without re-introducing the problem that `handler-bind` addresses, so I'm in favor of fixing the doc rather than the code. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 12 08:56:11 2025 Received: (at 76949) by debbugs.gnu.org; 12 Mar 2025 12:56:11 +0000 Received: from localhost ([127.0.0.1]:47832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tsLd4-0005lL-Fl for submit@debbugs.gnu.org; Wed, 12 Mar 2025 08:56:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55896) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tsLd1-0005l3-IE for 76949@debbugs.gnu.org; Wed, 12 Mar 2025 08:56:08 -0400 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 1tsLct-00062a-9s; Wed, 12 Mar 2025 08:56:00 -0400 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=A5lp5VvLbG3U8sSmM2F21jxQhpHAVtA5i4uZubjxFE8=; b=Xs05o83a+PU+ HcT5KRsYBTDR41+KhpM35Zs/IiaAbjZ+biSb/zw+JASuNRuHQnqQjn7IFY9K29LoT7M5ggQcs+wLS B/yLZ7fHrKOgUKatoc7lD4ZkNSXSGUfYO4+vtcYD4dQPbF+Lk3LGnfuEma8epKqaE6j6wOeBwUR9l U2isAfxZnmjUIAGlErmlUB0beF/TKtOKTlMGTf9fdAPA4bNfqqbeWYAIu44t0CrGG5MpQcqhtaVgi 7qLpa8GH91KrOsUjYdAmfcR8LubO49YliJqQ5TGDbQNK133P1784Dz5zt5kOy5EEM1NEi0AR5lvU8 UyhFNbHfAaW4YrHhK/Q4Xw==; Date: Wed, 12 Mar 2025 14:55:43 +0200 Message-Id: <86h63y76i8.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#76949: 30.1; --debug-init and condition-case-unless-debug References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76949 Cc: ferdinand.nussbaum@inf.ethz.ch, me@bcc32.com, 76949@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 76949@debbugs.gnu.org, me@bcc32.com > Date: Tue, 11 Mar 2025 16:41:42 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > Errors inside condition-case-unless-debug do not trigger the debugger when the > > --debug-init startup option is set (and debug-on-error is not additionally and > > explicitly set to a non-nil value). > > Indeed this is the direct consequence of: > > > AFAICT this is no longer correct since the implementation uses handler-bind instead. > > It seems cumbersome to fix this without re-introducing the problem that > `handler-bind` addresses, so I'm in favor of fixing the doc rather than > the code. Feel free to fix the documentation. But it would be nice if we could tell users what to use instead of condition-case-unless-debug in these cases. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 13 00:22:05 2025 Received: (at 76949) by debbugs.gnu.org; 13 Mar 2025 04:22:05 +0000 Received: from localhost ([127.0.0.1]:52684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tsa55-0000dI-PO for submit@debbugs.gnu.org; Thu, 13 Mar 2025 00:22:05 -0400 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]:48859) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tsYF4-0003WJ-Ph for 76949@debbugs.gnu.org; Wed, 12 Mar 2025 22:24:17 -0400 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1030D254012F; Wed, 12 Mar 2025 22:24:09 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Wed, 12 Mar 2025 22:24:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bcc32.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1741832648; x=1741919048; bh=Z/BSctlXJH nc892UIVv6BCBgv3w972rW8ylSH78oz6o=; b=ZGopUf19JVaPuNnQNhYCRi9sRt z5X0+n8VtZBY02IWePIELE9bUgdyf3tVu1MiILLbTOp6z1bsCI6FWtbbdpkyV/wq 0EZ1d8106w4maitpLZ8ZUE4yzUAQT/0KrHhq9nYaB5sKf3Xzu6ujQCg0H8l2DIjb lTas/byspZhYVX1RsiaUel9uymu12/Uhll8rLBOoZB0zzZ5eonVLPwa+1xiTtmDX k41hejiGONst7WQ/l/eoznLF+hAqoi+6vSkU0SrjzKVctfjvsVr/mSUbfsYOv/q8 oz3GDnNBtriDaFLHIm954DqAvPpbih6hwl4Y0dbLudbP3MOzrP+z/qhYlZ6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1741832648; x=1741919048; bh=Z/BSctlXJHnc892UIVv6BCBgv3w972rW8yl SH78oz6o=; b=hkkJxvSfGjTAoDaxd+6bmVXXzs6us4vDd2SFPCKePdEzy8rFipR IqBusTpgAnaYkeCbg4bzgGgNH52btDf1/k+CKFyO36K/o+sLXOUDxKXF3XimYrKd kBBgFHYKWHGxvCudk9HKPXG0EU4cT6ORAE48u1TQ30h1zXFgk5zqGKUlDil8Mg+R 2CXhlpUmSqK/3Gd5DijMAyFyhDJBGhjy27eMSbbSIaL8R/fx7I03pKuTKf4T7JIq bZFKOMGsZwlUhEHpvs1B0OCW30VIYjv02HoQ4OC3Teeh7RyYoyJmyKqvC7NW21ux sFItgE6ENmizTONIizLYmGyK+7dsKUsfE+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdeijeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgesthdtredttder tdenucfhrhhomheptegrrhhonhcukggvnhhguceomhgvsegstggtfedvrdgtohhmqeenuc ggtffrrghtthgvrhhnpefhgefhvdekueekuedvieethedtueekgfdttdehueefjeelveff tdduudfggeeiieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehmvgessggttgefvddrtghomhdpnhgspghrtghpthhtohephedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepmhgvsegstggtfedvrdgtohhmpdhrtghpthhtohepje eileegleesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehfvghrughinhgr nhgurdhnuhhsshgsrghumhesihhnfhdrvghthhiirdgthhdprhgtphhtthhopehmohhnnh hivghrsehirhhordhumhhonhhtrhgvrghlrdgtrgdprhgtphhtthhopegvlhhiiiesghhn uhdrohhrgh X-ME-Proxy: Feedback-ID: i80f14645:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Mar 2025 22:24:08 -0400 (EDT) From: Aaron Zeng To: Eli Zaretskii Subject: Re: bug#76949: 30.1; --debug-init and condition-case-unless-debug In-Reply-To: <86h63y76i8.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 12 Mar 2025 14:55:43 +0200") References: <86h63y76i8.fsf@gnu.org> User-Agent: mu4e 1.12.7; emacs 30.1 Date: Wed, 12 Mar 2025 22:24:07 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 76949 X-Mailman-Approved-At: Thu, 13 Mar 2025 00:22:03 -0400 Cc: ferdinand.nussbaum@inf.ethz.ch, me@bcc32.com, Stefan Monnier , 76949@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) With apologies to the maintainers, I accidentally replied directly to Stefan rather than reply-all. Copying in some context from our exchange below (hand-edited from the most recent email I received from Stefan): > Aaron Zeng writes: > > > Stefan Monnier writes: > > > > >> It seems cumbersome to fix this without re-introducing the > > >> problem that > > >> `handler-bind` addresses, so I'm in favor of fixing the doc > > >> rather than > > >> the code. > > > > > > I understand this to mean that we should fix the doc to > > > reflect that > > > `debug-on-error` is no longer explicitly non-nil when > > > --debug-init is > > > passed. > > > > Yes. > > > > > But for the other issue, I think we should still make it so > > > that > > > condition-case-unless-debug works with --debug-init as > > > advertised (and > > > as it did in Emacs 29). Do you agree? > > > > No, for the same reason: `condition-case-unless-debug` depends > > on the > > value of `debug-on-error`, not on whether the user has asked > > some variant of > > "show the debugger when there's an error". > > condition-case-unless-debug's docstring says "it does not > prevent > debugging". It also alludes to the value of debug-on-error, but > this > doc could change as well :) Yes, but it would bring us back to the problem of how to implementing it without re-introducing the problem. > I would argue, the intention of the programmer who used > condition-case-unless-debug likely doesn't depend on the exact > value > of debug-on-error, but rather, whether or not the user "wants" > to > invoke the debugger when an error is signaled inside the body. > > > Another way to look at it: > > > > `--debug-init` is there so you can debug an error that breaks > > your init. > > In the case of `condition-case-unless-debug`, the error > > presumably > > doesn't break your init, since it is properly caught and > > handled. > > In my experience, condition-case-unless-debug seems to be often > used > to "ignore" an error but not properly catch and handle it. For > example in the macroexpansion of `with-demoted-errors`, or in > the > original place where I found this: Spacemacs, where it is used > to log > an error message somewhere and proceed with installing the rest > of the > packages that are needed even if one installation fails. > > For me, the major concern is, code which was intended to be > called > during init and used condition-case-unless-debug to make its > errors > non-fatal but debuggable, has broken in a backwards-incompatible > way, > and also doesn't seem to have an obvious way forwards. There's a simple way forward: set `debug-on-error`.