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.help Subject: Re: Error does not throw to debugger in 'when' block Date: Thu, 12 Jan 2023 10:28:35 +0200 Message-ID: <83o7r4kvgs.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5057"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 12 09:29:28 2023 Return-path: Envelope-to: geh-help-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 1pFsxj-00010v-Sq for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 12 Jan 2023 09:29:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFswb-0006GG-Bo; Thu, 12 Jan 2023 03:28:17 -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 1pFswW-0006CL-0U for help-gnu-emacs@gnu.org; Thu, 12 Jan 2023 03:28:12 -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 1pFswV-0003ax-Od for help-gnu-emacs@gnu.org; Thu, 12 Jan 2023 03:28:11 -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=LxD2tOlUKi0wYAZFQe8PPrcIfxLDckHrysjA/xZscWA=; b=sSMqpJSBwXB0 syRjqI/2m0HudbTuQzPySBkVniOmx4Pd7WJjC+3ELi11S9sKmevAItBOEIPnW9/kJjsTr/QAIbHWv jDYJcrlIe8hjl80P4EKgMDqn9e84qVkAnYJaJakPbryTiF6howNfczr36eE5TtGVDY5QkjiEGRTE+ qFgJ0h1xNesYKZZx7GvXs5F4GVQ2pbHFG3p7sAqrI1lVY1TZiuKhmha6H92wIt71cbEt7LJavas7b 8WwR/TY8jz+v/BSxF+TDKuwKi+sC1OyXKgr+wF1xXUQ6bZYKq/xUpvsUUovVkMeDtqGgn8zDlqHmf TF8aZJq5DDVGIfixyyKsMQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFswL-0007Yt-Q3 for help-gnu-emacs@gnu.org; Thu, 12 Jan 2023 03:28:05 -0500 In-Reply-To: (message from Arthur Miller on Thu, 12 Jan 2023 07:51:01 +0100) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142211 Archived-At: > From: Arthur Miller > Date: Thu, 12 Jan 2023 07:51:01 +0100 > > When running this little code, I have observed that 'error' does not end in > debugger: > > (defun new-patch (&optional patch-name) > (interactive "sPatch name: ") > (let ((path (expand-file-name patch-name))) > (message "PATH: %s" path) > (when (file-exists-p path) > (error "A worktree with this name already exists")))) > > If I run this code, I see it correctly executes error, but it does not open > debugger. If I place cursor after the error form, debugger is > opened. Value of debug-on-error is 't. > > This is output in *Messages* buffer for 'Emacs -Q': > > PATH: /home/arthur/repos/emsrc/28.2 > progn: A worktree with this name already exists > Mark set [2 times] > > Just curious, is this intended new behaviour for 'error' or a bug? How exactly do you "run this code"? The details matter.