Subject: bug#46097: 27.1; Minibuffer may not be current when running minibuffer-exit-hook

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 13 Jun 2022 21:08:39 +0200

klubujevetru <[email-masked]> writes:

> Open the minibuffer with C-x C-f, switch to another window with C-x o
> and abort the minibuffer with C-] (abort-recursive-edit).
> minibuffer-exit-hook ends up running without the minibuffer being the
> current buffer.
>
> This may cause problems if a minibuffer adds a cleanup function the hook
> locally, see for example discussion at
> https://github.com/oantolin/embark/issues/114
> The cleanup function fails to run in this situation because the local
> value of the hook isn't considered.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I can reproduce this in Emacs 27.1, but this has apparently been changed
sometime after this -- in Emacs 29, the hook seems to always be run with
the minibuffer as the active buffer, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no