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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 08 Dec 2020 20:29:57 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked], Eli Zaretskii <[email-masked]>
> Date: Tue, 08 Dec 2020 19:18:12 +0100
> 
> Antoine Levitt <[email-masked]> writes:
> 
> > Here's a reproducer from emacs -Q (just reproduced on 27.1):
> >
> > Set
> > (setq scroll-conservatively 100000000)
> > (setq scroll-preserve-screen-position 'stay)
> >
> > Open a latex file of some complexity (with sections and math, for
> > instance https://arxiv.org/e-print/2003.00726, but it works on any tex
> > file), and make sure it's in latex-mode. Go somewhere in the middle of
> > the file, center point (C-l), then scroll up then down (C-v and M-v).
> 
> Yup; I can reproduce this in Emacs 28 -- point moves around a lot when
> paging back and forth.

I wouldn't say "a lot".  On my system it moves by less than a screen
line.

> > I traced it down to
> > lines of varying heights: it disappears if I set
> > (setq font-latex-fontify-script nil)
> > (setq font-latex-fontify-sectioning 'color)
> 
> Yes, I guess this is due to the mixture of line heights in that
> buffer -- when it's computing how many lines to scroll back and forth,
> it's not being consistent when going forward and backward.
> 
> Eli, does this sound familiar to you?

Not really.  I will look into it, in case there's some off-by-one, but
you are probably right about the reason.