emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-28 9c0eec4ed8: * src/window.c (select_window): Fix assert for


From: Stefan Monnier
Subject: Re: emacs-28 9c0eec4ed8: * src/window.c (select_window): Fix assert for buffer = non-active minibuffer
Date: Wed, 24 Aug 2022 22:28:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Hi Alan,

Alan Mackenzie [2022-08-19 11:07:49] wrote:
> branch: emacs-28
> commit 9c0eec4ed86713519819b2e33dc3fff23f0e5f3d
> Author: Alan Mackenzie <acm@muc.de>
> Commit: Alan Mackenzie <acm@muc.de>
>
>     * src/window.c (select_window): Fix assert for buffer = non-active 
> minibuffer
> ---
>  src/window.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/window.c b/src/window.c
> index 2576b66a18..35ec2a1f90 100644
> --- a/src/window.c
> +++ b/src/window.c
> @@ -554,7 +554,9 @@ select_window (Lisp_Object window, Lisp_Object norecord,
>        frame is active.  */
>        Fselect_frame (frame, norecord);
>        /* Fselect_frame called us back so we've done all the work already.  */
> -      eassert (EQ (window, selected_window));
> +      eassert (EQ (window, selected_window)
> +            || (EQ (window, f->minibuffer_window)
> +                && NILP (Fminibufferp (XWINDOW (window)->contents, Qt))));
>        return window;
>      }
>    else

Thinking again about this patch, I wonder if it's the right behavior.

I mean, in the case that your patch now allows, we return from
`select-window` without having selected the requested window (we
selected that window's frame, but not that actual window because it's
a mini-window whose minibuffer is not currently active).

I understand that it's not a good idea to select that mini-window, but
maybe instead of terminating as if we'd done it, we should signal an
error in that case because that window is not currently selectable,
a bit like a dead window.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]