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 #77 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: Fri, 26 Jun 2020 00:20:07 +0300
On 25.06.2020 23:11, Alan Mackenzie wrote:

> Sluggish performance isn't about "usually" and 98% of the time; it's
> about unusual constellations and the other 2%.

Still, a slow-ish fill-paragraph is nowhere near as bad as, say, 
slowdown during typing.

>>> Then why not do in mmm-mode what I'm doing in CC Mode, mhtml-mode and
>>> js-mode, i.e. add ad hoc code to handle precisely the case of js-mode?
> 
>> That would be something every user that configures a submode class using
>> js-mode have to be aware of. That's not easy to document, or even if we
>> made sure it's documented, to be sure that users read it.
> 
> Are you telling me that mmm-mode couldn't keep a watch out for js-mode,
> leaving other libraries untroubled?  Again, the trouble here appears to
> arise from using something (a mode) without first initialising it.

Sounds like special-casing js-mode, before-change-functions and this 
particular function all together. Basically, like a magic constant in 
the code.

This is ultimately doable, but I'm not sure how to write a patch for it 
which wouldn't leave me feeling dirty after.

>> These do seem to be the options: some C core support (though I'm not
>> clear on the particulars of the proposed design), or switching from
>> ad-hoc caches to syntax-propertize-function and and associated
>> syntax-ppss cache.
> 
> The syntax-propertize-function approach is poor design.  It restricts the
> use of the syntax-table text property too much.  syntax-ppss has had a
> troubled history and doesn't do the right thing in narrowed buffers.  It
> advertises itself as a magic wand which does everything, but when you've
> been enticed into committing your SW to it, you then find out it's less
> than magic, and you've got to call ugly functions by hand at strange
> times, and are restricted in how and when you can use it.

Despite certain edge cases, I've had a lot of success with it. Both in 
major modes, and in mmm-mode thanks to it.




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.