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

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

> From: Antoine Levitt <[email-masked]>
> Date: Tue, 08 Dec 2020 16:56:50 +0100
> Cc: [email-masked]
> 
> The original bug might have been at least partially closed, I now don't
> see this as much as I used to in code buffers (but it might equally have
> been a change in my config). However I do see this *a lot* in tex files,
> reproductibly, and it's still very annoying. I'd love it if this was
> fixed!
> 
> 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).
> 
> 
> 
> 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)

I don't think I understand what is the complaint here.  The screen
position of the cursor _is_ preserved with these settings, don't you
agree?  They are preserved on my system: I did many C-v and M-v, and
the cursor stays on the same spot on display, moving a few pixels here
and there when the line at cursor is smaller or taller than the
default.

If this is what you see, then what is NOT working as expected in this
scenario?

The original report was talking about C-v followed by M-v producing a
1-line displacement.  Is _that_ the problem?  If so, why did you
expect Emacs to come to the same place, AFAIK there's no guarantee of
that when variable-height text is involved.