Subject: bug#57266: Maintaining the base_line_number cache

From: Eli Zaretskii <[email-masked]>
Date: Mon, 22 Aug 2022 21:35:54 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked]
> Date: Mon, 22 Aug 2022 14:02:44 -0400
> 
> > Which is why I'm perfectly OK with documenting what the code does.
> 
> But I'm not.  Because I don't really know what the code does.
> The doc I wrote documents the design I came up with based on my
> understanding of what the code does.

IME, our "understanding" what the display code does is frequently
flawed, and we discover that too late.

> I went through the trouble of figuring out a design of how things
> *should* work, document it, and adjust the code to match the design.
> So I'm not interested in pushing some half-assed version of it that
> documents a design that doesn't match the reality, nor pushing partial
> fixes/workarounds (for borderline cases that noone ever bumped into
> anyway) while keeping the mess of unexplained hacks.

I agree that if we were writing the display engine today, we'd do many
things differently and more cleanly.  But we are not at that place,
and the (marginal at best) advantages of having the code match your
understanding do not justify the risk of subtle and hard-to-debug
display glitches.

> > Please!  I hope my requests mean something, given that I'm the only
> > one who works on bugs in these areas, and probably will keep doing
> > that for the observable future.
> 
> Indeed, my proposed patch is not a bug fix.
> It's a code-maintenance patch.  It's meant to improve the code, not
> the behavior.

Sorry, I had (and still have from time to time) enough fallout from
similar experiments of yours around Emacs 25, which also aimed at
improving the code (by removing various reasons to perform more
thorough redisplay).  I'd rather not repeat that.