Subject: Re: bug#63455: 30.0.50; display-buffer-in-direction is always resizing

From: Juri Linkov <[email-masked]>
Date: Tue, 16 May 2023 19:35:59 +0300

> We could write a function similar to 'completions--fit-window-to-buffer'
> (do you know what the &rest _ args there are used for?) like

Looks like the &rest _ args is defensive programming.

> (defun maybe-fit-window-to-buffer (&optional window)
>   "Fit WINDOW to buffer if 'temp-buffer-resize-mode' is on."
>   (when temp-buffer-resize-mode
>     (resize-temp-buffer-window window)))
>
> and use that in all occasions where we want to resize a window outside
> the scope of 'with-temp-buffer-window' when 'temp-buffer-resize-mode'
> was turned on by the user (leaving alone the behavior of the earlier
> mentioned 're-builder' etc. which apparently work without complaints).

This helper could be useful.  Maybe it should be added
when such need arises.