Am 25.03.26 um 23:27 schrieb Jim:
FWIW, *part* of what I am trying to do here is to improve how AUCTeX deals
with ConTeXt. If I want to typeset a small portion of a large document,
AUCTeX needs to find what the LaTeX people call the "preamble", which is
(AIUI) the part before the "\begin{document}". But ConTeXt is more
flexible, and I'm trying to hone in on how the "preamble" can be
automatically found.
If a document uses
\environment ...
\startcomponent ...
...
then one can say the "preamble" is that stuff before \startcomponent.
But if one uses them the other way, automatically finding the "preamble" is
trickier. Or maybe in general next to impossible.
If you document it that way, then it’s probably ok if AUCtex only
recognizes everything before the first \start… as preamble.
e.g. \startdocument or any other “documents” that are defined with
\definedocument
also \startMPpage
Thanks for those two. I expect that user-defined commands to start the
document will be difficult to deal with, but I'll add \startdocument and
\startMPpage (I should have remembered that one!) to the list.
Also remember that there can be multiple or nested \environment calls –
in bigger projects, I split the environment into topics like colors,
fonts, layout…
An environment is only loaded once even if called multiple times, in
opposite to \input, so it doesn’t matter if you call it from the project
and the component.
Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________