Subject: Re: bug#70213: Info-mode side window fit-window-to-buffer issue

From: Joseph Turner <[email-masked]>
Date: Sun, 07 Apr 2024 10:53:00 -0700

martin rudalics <[email-masked]> writes:

>>> In emacs -Q on master after Jan 6 patch, eval this:
>>
>> Maybe Martin could help to solve this problem (Cc-ed).
>>
>>> (progn
>>>    (setq fit-window-to-buffer-horizontally t)
>>>
>>>    (setq display-buffer-alist
>>>          '(((derived-mode . Info-mode)
>>>             display-buffer-in-side-window
>>>             (side . right)
>>>             (window-width . fit-window-to-buffer))
>>> 	  ((derived-mode . messages-buffer-mode)
>>>             display-buffer-in-side-window
>>>             (side . right)
>>>             (window-width . fit-window-to-buffer)))))
>
> At the time we call 'fit-window-to-buffer' the buffer is empty so we
> show only 'window-min-width' columns.  Don't we have 'body-function' for
> that?

Thanks for the review!  We have the same understanding of the issue.

What do you mean by 'body-function'?

>>> I would expect the *info* window to fit to the buffer contents
>>> when it first appears.  The patch I sent earlier fixes this.
>
> That patch is
>
> Display-buffer-after-ensuring-it-contains-text.patch

> IIUC.  It already explains the problem in its name and does look good to
> me.

Thanks for the review!  Stephen, Juri, Eli, WDYT?

Joseph