[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error does not throw to debugger in 'when' block
From: |
Eli Zaretskii |
Subject: |
Re: Error does not throw to debugger in 'when' block |
Date: |
Thu, 12 Jan 2023 10:28:35 +0200 |
> From: Arthur Miller <arthur.miller@live.com>
> 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.