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.
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.