Subject: Re: bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer

From: Michael Heerdegen <[email-masked]>
Date: Sun, 21 Apr 2024 06:24:26 +0200

Hello,

Something that might be related:

If you edebug some code that uses `unwind-protect' to ensure certain
cleanup things are done, and you quit Edebug before those protected
forms are reached, they will never be executed.  This can break your
session in diverse surprising ways.

Here is a harmless example to demonstrate what I mean:

#+begin_src emacs-lisp
(defvar a 0)

(unwind-protect
    (progn (setq a 27)
           (message "%d" (+ a 19)))
  (setq a 0))
#+end_src

When you edebug the `unwind-protect' form and hit q (quit) when the
`message' call has been reached, your session will remain with a binding
of 27 for a - which is normally impossible and should never happen.

Quitting Edebug is a very dangerous operation for an Emacs session.

Michael.