On 9/22/2025 8:09 AM, [email protected] wrote:
2. Superior Multi-Language Highlighting (via Polymode):
This is the core technical advantage. context-lmtx-mode uses
polymode to correctly handle and highlight different languages
embedded within a .ctx file. This means if you have Lua code inside
\startluacode, Metapost code inside \startMPcode, or XML blocks,
each snippet gets its own proper syntax highlighting and indentation.
This is a common pain point in other editors, and I wanted to solve
it properly.
Just for the record. The code base actually evolved in sync with the way
we highlight. This can be emulated with
\usemodule[scite]
\starttyping[option=TEX]
....
\stoptyping
This also supports nesting of mp and lua and some more (not all nesting
makes sense). It's kind of the reference for context syntax
highlighting. (We do have specific highlighters for xml, pdf, sql .. the
things i needed so to say).
The information for this is part of the context distribution, like
commands, keywords, classifications, etc. It comes in editor specific
support and in xml files that describe the commands etc. If needed
additional files can be generated (we do it for some editors with
>mtxrun --script interface) but I have no clue what data emacs needs.
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________