GNU bug report logs - #41897
28.0.50; JavaScript comment filling with mhtml-mode

Previous Next

Package: emacs;

Reported by: Simen Heggestøyl <simenheg <at> runbox.com>

Date: Tue, 16 Jun 2020 17:10:01 UTC

Severity: normal

Found in version 28.0.50

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 41897 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Simen Heggestøyl <simenheg <at> runbox.com>,
 41897 <at> debbugs.gnu.org
Subject: Re: bug#41897: 28.0.50; JavaScript comment filling with mhtml-mode
Date: Tue, 23 Jun 2020 17:23:53 +0300
On 23.06.2020 11:36, Alan Mackenzie wrote:

>> 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?
> 
> The cost is tiny.  c-truncate-lit-pos-cache is a defsubst which does
> nothing but three copies of
> 
>      (setq cache-limit (min beg cache-limit))
> 
> .  All the intricacies of manipulating the cache take place whilst it is
> being used.
> 
>> Or if that's undesirable, js-fill-paragraph could do that.
> 
> No, it really has to be in a before-change-functions function, to keep
> track of the bound of the valid cache.

So it's really fine if it's called from HTML/CSS hunks as well?

And there's no way to just "reset" it to an appropriate value?

>> This way, I think it would automatically make it compatible with
>> mmm-mode. Or at least more compatible.
> 
> Maybe putting the two c-foreign-* functions into mmm-mode would work.

mmm-mode is a minor mode, it doesn't always deal with CC Mode.

And its configurations don't usually result in new major modes either.

I wouldn't say it's very hard to make it work, but I don't see a "neat" 
way to do either.

Have you considered adding variables that hold the cache to 
mhtml--crucial-variable-prefix as well? Would that make it work?




This bug report was last modified 5 years and 42 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.