GNU bug report logs - #46097
27.1; Minibuffer may not be current when running minibuffer-exit-hook

Previous Next

Package: emacs;

Reported by: klubujevetru <klubujevetru <at> cock.li>

Date: Mon, 25 Jan 2021 10:58:01 UTC

Severity: normal

Found in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 46097 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: klubujevetru <klubujevetru <at> cock.li>, 46097 <at> debbugs.gnu.org
Subject: Re: bug#46097: 27.1; Minibuffer may not be current when running
 minibuffer-exit-hook
Date: Mon, 25 Jan 2021 20:04:42 +0100
> 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.

But both, current buffer and selected window, might be of interest for
the function running that hook.  So I think we should not change the
current behavior but rather document it and provide better access to
find the minibuffer that was just aborted.  The only way I found is

(window-buffer (active-minibuffer-window))

Why don't we provide a function like 'active-minibuffer'?  Or even a
function like 'minibuffer-list'?

martin




This bug report was last modified 3 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.