Subject: Re: bug#66764: 29.1; Emacs scrolls for "(goto-char (point-max))" instead of jumping

From: Herman, Géza <[email-masked]>
Date: Fri, 27 Oct 2023 11:43:28 +0200

On 10/27/23 08:50, Eli Zaretskii wrote:
> AFAIU, the font-lock-keywords setting above causes the display engine
> to call this function every time it moves across some chunk of text,
> which slows down redisplay.  This shows with scroll-conservatively set
> to a large value because Emacs then attempts to find the minimum
> amount of scrolling the screen in order to bring point into the view.
As far as I understand, if the buffer is fully font-locked, then this 
function won't be called again, unless the buffer is modified. So this 
shouldn't be a problem. But even if this is not true, I've been using 
this setting for a long time, I didn't notice any performance problems 
with it.

> It is a known fact that modes which use advanced font-lock settings
> should adapt to the long-line situation (when the function
> long-line-optimizations-p returns non-nil)
This setting comes from a package named hl-todo. I believe it is done 
this way so it only highlights TODO items which are in comments/strings. 
Maybe there is a better way to achieve this, I don't know.

> so I think you should
> modify your font-lock settings to avoid this problem in that case.
I turned off long-line optimizations instead, because it causes other 
problems as well (mentioned in my previous email).