Subject: bug#8355: 24.0.50; Boxes in mode-line and scrolling

From: Antoine Levitt <[email-masked]>
Date: Fri, 11 Dec 2020 13:25:16 +0100

11 December 2020 12:59 +01, Eli Zaretskii:
>> I assumed small, random variations in height of amplitude δh around a
>> reference height h0, and n δh >> h0. Then the place where you fall
>> before rounding is randomly distributed. You'll get movement only if
>> you've rounded up or down by about the half-separation, which should
>> happen a fraction 1/pixel height of the time. I have lines about 20px
>> tall, so that's 5%; I multiply by two to account for the possibility of
>> having rounded both up and down. If anything this should be an
>> overestimate; but again my assumptions are probably unrealistic (eg for
>> instance in my tex files the δh is always positive, which might explain
>> why I always see movement in the same direction).
>
> You assume random distribution of taller or smaller lines through the
> document, but that is not necessarily true.  There could be large
> groups of smaller or taller lines, which will skew the percentage.
>
> Anyway, an example where this happens will be useful to at least
> understand what's going on, and perhaps provide a better solution.

I completely agree my assumptions are unrealistic, it was just to
get a baseline for what to expect.

So, on the tex file from arxiv I posted
(https://arxiv.org/e-print/2003.00726), I tried the following: from
emacs -Q with

(setq scroll-conservatively 100000000)
(setq scroll-preserve-screen-position 'stay)

go to a random line, C-l, C-v, M-v, see if the cursor moved. I did a
macro with that, and repeating it I'm able to get eg from line 368 to
line 305. Most lines are 18px, some 19. My screen is about 30 lines
tall, so the fact this phenomenon appears for ~65 contiguous lines (ie
more than two screenfuls) suggests that it's more than just bad luck.
For reproducibility, I'm using stock GTK emacs -Q on a 1366x768 screen
with Monospace Regular 11 font in fullscreen.

Best,
Antoine