Subject: Re: bug#72487: calculator-electric-mode causes freeze on subsequent use of minibuffer

From: martin rudalics <[email-masked]>
Date: Fri, 23 Aug 2024 10:42:46 +0200

> I can offer the attached patch to provisionally handle this problem.

I now pushed it to the release branch.  Please check again with your
scenarios.

The patch does not fix a conceptual discrepancy between minibuffers and
their depth.  As an example, try with emacs -Q:

C-h f

M-x

(setq foo (window-buffer (minibuffer-window)))

C-h v

(kill-buffer foo)

Now C-g will tell me

completing-read-default: Selecting deleted buffer [2 times]

And ESC ESC ESC gets me

keyboard-escape-quit: No catch for tag: exit, t [6 times]
minibuffer-quit-recursive-edit: No catch for tag: exit, #[0 "\301\300\242S!\207" [(2) minibuffer-quit-recursive-edit] 2]

so I will be trapped in these for the rest of my session.

Since I do not consider killing minibuffers as something reasonable to
do, I won't try to fix this for the release branch.  The most simple
solution might be to inhibit killing of buffers used by the minibuffer
code.

martin