Subject: Re: bug#44933: 27.1; Ephemeral frame selection shrinks minibuffer

From: Sean Devlin <[email-masked]>
Date: Sat, 12 Dec 2020 15:23:17 -0500

Hi Martin,

Thanks for waiting on this update.

I instrumented the code in a couple key places and then exercised the bug. Attached is the log showing what happened.

Basically, I put two calls to my log function around the window selection in ’term-emulate-terminal and one inside ‘window—resize-root-window-vertically. Next, I opened a term window running a script that prints some output every few seconds. I had one frame running the script under term, and I selected a second frame and invoked some completing read command. As before, the minibuffer window shrank when the script printed some output.

You can find the start of each entry by searching for the regexp “^>>>>”. I wasn’t sure what to include in each entry, but I printed the selected frame, the selected window, that window’s buffer, and a backtrace. I can easily add more information and run the experiment again, if there’s something else you’d like to see.

Thanks!

> On Dec 2, 2020, at 1:24 PM, Sean Devlin <[email-masked]> wrote:
> 
> Hi Martin,
> 
> Thanks for all the helpful info!
> 
>> On Dec 2, 2020, at 2:52 AM, martin rudalics <[email-masked]> wrote:
>> 
>>> I forgot to say that _all_ normal mini window resizing goes through
>>> 'window--resize-root-window-vertically' in window.el.  So it will
>>> probably suffice to instrument just that function (in an already running
>>> Emacs only, else you have to rebuild because window.el is preloaded) and
>>> don't have to tinker with C code at all.
>> 
>> Imprecise again: The above covers only the automatic resizing triggered
>> by redisplay (which is what we are interested in).  Manual resizing the
>> minibuffer window is done in 'window--resize-mini-window' (also in
>> window.el) so if such manual resizing may happen in between you have to
>> instrument that as well.
> 
> I see, I’ll take a look at these functions. Thanks!
> 
>> 
>> martin