Subject: bug#36859: Customizable fit-window-to-buffer

From: Juri Linkov <[email-masked]>
Date: Sun, 04 Aug 2019 22:27:03 +0300

>> Or maybe 'shrink-window-if-larger-than-buffer' could be added in the body
>> of another new ALIST argument 'post-display-function'.
>
> Where would that 'post-display-function' be called?  This wouldn't be
> any more in the scope of 'display-buffer'.

Oops.

> I'm still not convinced that this display buffer then fill buffer then
> fit/shrink window according to buffer size metaphor makes any sense.
> If we want to make the window size follow the buffer size, the buffer
> should have been filled before being displayed.

In case of an asynchronous command like vc-log and vc-diff
postponing display-buffer might be undesirable because
their output might be useful to see while still incomplete.

OTOH, the current situation is not perfect either:
when an asynchronous command finishes, it unexpectedly
forces the window resizing.