Subject: bug#41897: 28.0.50; JavaScript comment filling with mhtml-mode

From: Dmitry Gutov <[email-masked]>
Date: Tue, 23 Jun 2020 03:02:48 +0300

Hi Alan,

On 22.06.2020 22:17, Alan Mackenzie wrote:
> +(defun c-foreign-truncate-lit-pos-cache (beg _end)
> +  "Truncate CC Mode's literal cache.
> +
> +This function should be added to the `before-change-functions'
> +hook by major modes that use CC Mode's filling functionality
> +without initializing CC Mode.  Currently (2020-06) these are
> +js-mode and mhtml-mode."
> +  (c-truncate-lit-pos-cache beg))

Could you explain this part?

Is that literal cache looked up once during filling, or is it used 
multiple times during the execution of c-fill-paragraph? If the latter 
(and it does serve as a cache this way), perhaps it could be cleared 
once, at the beginning of c-fill-paragraph, instead of adding a runtime 
cost to every edit?

Or if that's undesirable, js-fill-paragraph could do that.

This way, I think it would automatically make it compatible with 
mmm-mode. Or at least more compatible.