Subject: bug#40052: CC Mode 5.34 (C++//l); cc-mode hangs fontifying src/hotspot/share/runtime/globals.hpp in OpenJDK

From: Stefan Monnier <[email-masked]>
Date: Fri, 15 May 2020 17:07:28 -0400

[ Just a side, question, really.  ]

Hi Alan,

> This hits a bug in Emacs where it allows the backward search operation
> for a comment start, when point is at the beginning of the line
> following an escaped newline.  Such a position can never be an end of a
> comment in C++.

This problems seems to apply to `c-mode` as much as to `c++-mode`, so
I took a quick look to see if it also affects `sm-c-mode` (tested with
Emacs-26) and it seems not to be the case.

(At least, scrolling and editing this file in `sm-c-mode` is not
unusably slow (tho it is a bit sluggish, especially editing, which is
slowed down by `sm-c-mode`s feature that re-aligns the trailing
backslashes after each edit)).

> The fix to Emacs won't actually be getting released until Emacs 28, so
> in the meantime, please try the following patch.  The files to patch are

This makes it sound like it's related to a bug in the C code.
Is it something you already fixed?  Is it the new
`comment-end-can-be-escaped` thingy?

I understand that it could speed things up here, but at the same time
"LFs which don't end a comment" are the rule rather than the exception,
so if it's a performance problem for those backslash-escaped LFs, why
doesn't it also affect all the other LFs?

        Stefan