Subject: Re: bug#32825: 27.0.50; Deterministic window management

From: Juri Linkov <[email-masked]>
Date: Wed, 07 Nov 2018 23:55:14 +0200

>> Isn't this bad that this function does the double work, i.e.
>> first displays the buffer, then reverts, and if everything is right,
>> displays the same buffer again.  Shouldn't it display the buffer
>> only once, then check if everything is right, and revert only
>> if not.
>
> The primal problem this was supposed to solve is:
>
> (1) Get the size (typically the body width) of the window supposed to
>     display a buffer (typically a doc or man buffer).
>
> (2) Format the buffer in some way so that it fits into (1)'s size.
>
> (3) Call 'display-buffer' to actually display the buffer.

This is why man.el currently uses a simpler solution:

(1) Call 'display-buffer' to display the buffer.

(2) Format the buffer in some way so that it fits into displayed size.

> We obviously could use this approach to revert 'display-buffer'
> whenever it did something bad.  But we shouldn't do that by default,
> the overhead for storing the configurations is not negligible.

When a man page is not found, currently it reverts 'display-buffer'.

What benefits would be provided by the approach that uses
'display-buffer-try-and-revert'?