Subject: bug#56682: Fix the long lines font locking related slowdowns

From: Gregory Heytings <[email-masked]>
Date: Fri, 29 Jul 2022 20:48:23 +0000

>
> At least applying that change does not seem to have negative effects.
>

Actually it does, with the same recipe:

emacs -Q
M-: (progn (set-frame-width nil 119) (set-frame-height nil 38)) RET
C-x C-f dictionary.json RET y
C-s aan SPC

So you can forget this patch.

>
> diff --git a/src/xdisp.c b/src/xdisp.c
> index b1ee7889d4..e415320a52 100644
> --- a/src/xdisp.c
> +++ b/src/xdisp.c
> @@ -3429,6 +3429,12 @@ init_iterator (struct it *it, struct window *w,
>     {
>       it->narrowed_begv = get_narrowed_begv (w, window_point (w));
>       it->narrowed_zv = get_narrowed_zv (w, window_point (w));
> +      if (charpos >= 0
> +         && (charpos < it->narrowed_begv || charpos > it->narrowed_zv))
> +       {
> +         it->narrowed_begv = get_narrowed_begv (w, charpos);
> +         it->narrowed_zv = get_narrowed_zv (w, charpos);
> +       }
>     }
>
>   /* If a buffer position was specified, set the iterator there,
>