Subject: Re: bug#56305: 29.0.50; 'yes-or-no-p' deselects minibuffer frame

From: Eli Zaretskii <[email-masked]>
Date: Mon, 11 Jul 2022 14:12:39 +0300

> Date: Mon, 11 Jul 2022 09:45:59 +0200
> Cc: Eli Zaretskii <[email-masked]>, [email-masked],
>  [email-masked]
> From: martin rudalics <[email-masked]>
> 
>  > Anyway, we'll have to decide soon what to do for Emacs 28.2.  The first
>  > pretest is already out there.  What we do needs to be simple and safe.
>  > The alternatives so far seem to be do nothing, apply the 53-line
>  > deletion from master (which Eli has already rejected) or apply my patch
>  > above (fixed to work with tty's).  At the moment, I would favour the
>  > last of these.
> 
> For Emacs 28.2 I could imagine something like
> 
> diff --git a/src/frame.c b/src/frame.c
> index 0c278259a7..27442ee120 100644
> --- a/src/frame.c
> +++ b/src/frame.c
> @@ -1499,7 +1499,8 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
>   #else /* ! 0 */
>     /* Instead, apply it only to the frame we're pointing to.  */
>   #ifdef HAVE_WINDOW_SYSTEM
> -  if (track && FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->get_focus_frame)
> +  if (track && NILP (Vinhibit_redisplay)
> +      && FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->get_focus_frame)
>       {
>         Lisp_Object focus, gfocus;
> 
> that is use the analogous unpleasant hack from resize_mini_window.

Can you tell how inhibit-redisplay is related to the original recipe
in this bug?  Specifically, at what point is inhibit-redisplay set in
that recipe and by which code?

Thanks.