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

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 04 Aug 2022 08:23:23 +0200

By the way, playing with Alan's example here a bit...  To recap, this is
the test case (in a .cc file):

---
char long_line[] = R"foo(

)foo"
---

If I insert a 1M long line there (with `C-y'), Emacs will hang
indefinitely.  Wasn't the long-line stuff supposed to trigger in these
situations?  Or is it hanging in some cc-mode stuff before we get that
far?

`C-g' a number of times will eventually get out of the hang, but then
Emacs hangs again.  `C-g' again a few times breaks out of that, and then
finally Emacs becomes responsive.  If I load the file with the 1M line
from the start, then Emacs is responsive all the time.