Subject: Re: bug#57207: 29.0.50; Fontification is slow after e7b5912b23 (Improvements to long lines handling)

From: Eli Zaretskii <[email-masked]>
Date: Sun, 21 Aug 2022 16:39:52 +0300

> Date: Sun, 21 Aug 2022 13:32:16 +0000
> From: Gregory Heytings <[email-masked]>
> cc: Eli Zaretskii <[email-masked]>, [email-masked], [email-masked]
> 
> 
> >
> > Here's a full test case.
> >
> 
> Thanks!
> 
> >
> > emacs -Q and then:
> >
> > (progn
> >  (pop-to-buffer "foo.txt")
> >  (flyspell-mode)
> >  (insert "\n\n"
> > 	  (propertize (make-string 20000 ?x) 'display "foo")
> > 	  "\n\nbar\nzot\n")
> >  (goto-char (point-min)))
> >
> > Then type `d'.  Everything after "foo" disappears.
> >
> 
> It doesn't, here :(  Strange...

It does here.

Btw, one more aspect of narrowing in safe_run_hooks_maybe_narrowed is
that the clip_changed flag of the current buffer is set, which means
any calls to 'redisplay' inside the hook will cause the display engine
to work harder.  If we temporarily restore the narrowing in
redisplay_internal, we may wish to undo that, but doing so will only
be possible if we save the original state of the flag, before
narrow-to-region inside safe_run_hooks_maybe_narrowed, in the
outermost-narrowing value, or something like that.