Subject: Re: bug#18195: 24.3.92; window-screen-lines is not accurate

From: Eli Zaretskii <[email-masked]>
Date: Fri, 08 Aug 2014 12:16:33 +0300

> Date: Fri, 08 Aug 2014 10:41:13 +0200
> From: martin rudalics <[email-masked]>
> CC: [email-masked], [email-masked]
> 
> Seriously, why should
> 
> (let ((overlay (make-overlay (point-min) (point-max))))
>    (overlay-put overlay 'display "???????")
>    (prog1
>        (window-text-pixel-size)
>      (delete-overlay overlay)))
> 
> cause a "momentarily flashing in the window"?

It shouldn't.  But AFAIU, this is not what is wanted here, because the
problem is where in the buffer to put the overlay.  In the above
example, you put it at point-min, but that position needs to be
_computed_ based on the pixel-size of the text to be put in the
overlay.

IOW, your suggested solution is incomplete, unless you intend the
application to do some iterative process, each time changing the
position where it puts the overlay and adjusting it in the next
iteration based on the results of window-text-pixel-size.