summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/context.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/context.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/context.mkiv237
1 files changed, 143 insertions, 94 deletions
diff --git a/Master/texmf-dist/tex/context/base/context.mkiv b/Master/texmf-dist/tex/context/base/context.mkiv
index 33fa3a901ac..8f3586dea98 100644
--- a/Master/texmf-dist/tex/context/base/context.mkiv
+++ b/Master/texmf-dist/tex/context/base/context.mkiv
@@ -11,36 +11,76 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% syst-cat -> catc-ini + vectors
-% spec-* -> special backends for luatex
+\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
+
+%D From the next string (which is set by the script that assembles the
+%D distribution) later on we will calculate a number that can be used
+%D by use modules to identify the feature level. Starting with version
+%D 2004.8.30 the low level interface is english. Watch out and adapt
+%D your styles an modules.
+
+\edef\contextformat {\jobname}
+\edef\contextversion{2011.05.18 18:04}
+
+%D For those who want to use this:
+
+\let\fmtname \contextformat
+\let\fmtversion\contextversion
+
+%D Loading:
+
+\edef\mksuffix {mkiv}
+\edef\contextmark{MKIV}
+
+\ifx\normalinput\undefined \let\normalinput\input \fi
+
+\def\loadcorefile#1{\normalinput#1\relax}
+\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax}
+\def\loadmkiifile#1{}
+\def\loadmkivfile#1{\normalinput#1.mkiv\relax}
+\def\loadmkvifile#1{\normalinput#1.mkvi\relax}
%D First we load the system modules. These implement a lot of
-%D manipulation macros. The first one loads \PLAIN\ \TEX, as
-%D minimal as possible.
+%D manipulation macros. We start with setting up some basic \TEX\
+%D machinery.
+
+\loadmarkfile{syst-ini}
+
+%D Some checking (more primitives are now defined):
+
+\ifdefined\defaultinterface \else \def\defaultinterface {english} \fi
+%ifdefined\messageinterface \else \let\messageinterface \defaultinterface \fi
+\ifdefined\defaultlanguagetag \else \def\defaultlanguagetag{en} \fi
-\loadcorefile{syst-ini}
+%D We just quit if new functionality is expected.
\ifnum\luatexversion<60 % also change message
\writestatus{!!!!}{Your luatex binary is too old, you need at least version 0.60!}
\expandafter\end
\fi
-\newtoks\contextversiontoks \contextversiontoks\expandafter{\contextversion} % at the lua end
+%D There is only this way to pass the version info
+%D to \LUA\ (currently).
-\loadcorefile{norm-ctx}
-\loadcorefile{syst-pln}
+\newtoks\contextversiontoks \contextversiontoks\expandafter{\contextversion}
-\newif\ifCONTEXT \CONTEXTtrue % will disappear
+%D Now the more fundamnetal code gets defined.
+
+\loadmarkfile{norm-ctx}
+\loadmarkfile{syst-pln}
+\loadmarkfile{syst-mes}
\loadmarkfile{luat-cod}
\loadmarkfile{luat-bas}
\loadmarkfile{luat-lib}
\loadmarkfile{catc-ini}
-\loadcorefile{catc-act}
-\loadcorefile{catc-def}
-\loadcorefile{catc-ctx}
-\loadcorefile{catc-sym}
+\loadmarkfile{catc-act}
+\loadmarkfile{catc-def}
+\loadmarkfile{catc-ctx}
+\loadmarkfile{catc-sym}
+
+\loadmarkfile{cldf-ini}
% From here on we have \unexpanded being \normalprotected, as we
% already had \unexpanded long before etex came around.
@@ -48,10 +88,8 @@
\loadmarkfile{syst-aux}
\loadmarkfile{syst-lua}
\loadmarkfile{syst-con}
-\loadcorefile{syst-ltx}
\loadmarkfile{syst-fnt}
-\loadmarkfile{syst-str}
\loadmarkfile{syst-rtp}
\loadmarkfile{supp-fil}
@@ -62,48 +100,52 @@
\loadmarkfile{char-act}
\loadmarkfile{mult-ini}
-\loadcorefile{mult-fst}
-\loadcorefile{mult-sys}
-\loadcorefile{mult-def}
+%loadmarkfile{mult-fst} % obsolete
+\loadmarkfile{mult-sys}
+\loadmarkfile{mult-def}
\loadmarkfile{mult-chk}
-\loadmarkfile{mult-cld}
+\loadmarkfile{mult-aux}
+
+\loadmarkfile{cldf-int} % interface
\loadmarkfile{luat-ini}
\loadmarkfile{toks-ini}
+\loadmarkfile{attr-ini}
+
+\loadmarkfile{core-var}
+\loadmarkfile{core-env}
+
+\loadmarkfile{layo-ini}
+
\loadmarkfile{node-ini}
\loadmarkfile{node-fin}
\loadmarkfile{node-mig}
\loadmarkfile{node-par}
%loadmarkfile{node-pag}
-\loadmarkfile{core-var}
-
\loadmarkfile{back-ini}
-\loadmarkfile{lpdf-ini} % some day back-ini will load this
-\loadmarkfile{lpdf-pdx} % might be merged into lpdf-ini
-\loadmarkfile{back-pdf} % some day back-ini will load this
-
-\loadmarkfile{attr-ini}
-\loadmarkfile{core-env}
+\loadmarkfile{attr-col}
+\loadmarkfile{attr-lay}
+\loadmarkfile{attr-neg}
+\loadmarkfile{attr-eff}
\loadmarkfile{trac-tex}
-\loadmarkfile{trac-lmx}
\loadmarkfile{trac-deb}
-\loadmarkfile{blob-ini} % not to be used, we only use a helper
+%loadmarkfile{blob-ini} % not to be used, we only use a helper
-\loadcorefile{supp-box}
+\loadmarkfile{supp-box}
-\loadcorefile{supp-vis}
-\loadcorefile{supp-fun}
+\loadmarkfile{supp-vis}
+\loadmarkfile{supp-fun}
\loadmarkfile{supp-ran}
\loadmarkfile{supp-mat}
-\loadcorefile{supp-ali}
-\loadcorefile{supp-num}
+\loadmarkfile{supp-ali}
+\loadmarkfile{supp-num}
\loadmarkfile{typo-ini}
@@ -111,16 +153,14 @@
\loadmarkfile{core-fil}
\loadmarkfile{core-con}
-\loadcorefile{cont-fil}
+\loadmarkfile{cont-fil}
\loadmarkfile{regi-ini}
-\loadcorefile{regi-syn}
\loadmarkfile{enco-ini}
\loadmarkfile{hand-ini}
\loadmarkfile{lang-ini}
\loadmarkfile{lang-lab}
-\loadmarkfile{lang-wrd}
\loadmarkfile{unic-ini}
@@ -131,51 +171,41 @@
\loadmarkfile{colo-ini}
\loadmarkfile{colo-ext}
+\loadmarkfile{node-bck} % overloads anch-pgr (experimental and undocumented)
+
\loadmarkfile{trac-vis}
\loadmarkfile{lang-mis}
\loadmarkfile{lang-url}
-
-\loadcorefile{lang-ger}
-\loadcorefile{lang-ita}
-\loadcorefile{lang-sla}
-\loadcorefile{lang-alt}
-\loadcorefile{lang-ana}
-\loadcorefile{lang-art}
-\loadcorefile{lang-bal}
-\loadcorefile{lang-cel}
-\loadcorefile{lang-grk}
-\loadcorefile{lang-ind}
-\loadcorefile{lang-ura}
-\loadcorefile{lang-vn}
-\loadcorefile{lang-cyr}
-
-\loadmarkfile{lang-ara}
-\loadmarkfile{lang-cjk}
+\loadmarkfile{lang-def}
+\loadmarkfile{lang-wrd} % can be optional
\loadmarkfile{symb-ini}
\loadmarkfile{sort-ini}
+\loadmkvifile{pack-mis}
\loadmarkfile{pack-rul}
\loadmarkfile{lxml-ini}
\loadmarkfile{lxml-sor}
\loadmarkfile{strc-ini}
+\loadmarkfile{strc-tag}
\loadmarkfile{strc-doc}
+\loadmarkfile{strc-num}
\loadmarkfile{strc-mar}
\loadmarkfile{strc-prc}
\loadmarkfile{strc-sbe}
\loadmarkfile{strc-lst}
\loadmarkfile{strc-sec}
-\loadmarkfile{strc-num}
+\loadmarkfile{strc-pag} % hm, depends on core-num
\loadmarkfile{strc-ren}
\loadmarkfile{strc-xml}
-\loadmarkfile{strc-pag} % hm, depends on core-num
\loadmarkfile{strc-def} % might happen later
\loadmarkfile{strc-ref}
\loadmarkfile{strc-reg}
+\loadmarkfile{strc-lev} % experiment
\loadmarkfile{spac-hor}
\loadmarkfile{spac-ver}
@@ -188,7 +218,9 @@
\loadmarkfile{anch-pos}
-\loadmarkfile{scrn-nav}
+\loadmkvifile{scrn-ini}
+\loadmkvifile{scrn-ref}
+
\loadmarkfile{pack-obj}
\loadmarkfile{strc-itm}
@@ -212,31 +244,46 @@
\loadmarkfile{page-mul}
\loadmarkfile{page-set}
\loadmarkfile{pack-lyr}
+\loadmarkfile{pack-pos}
\loadmarkfile{page-mak}
\loadmarkfile{page-lin}
\loadmarkfile{page-par}
-\loadmarkfile{page-mar}
+%loadmarkfile{page-mar} % also commented code in anch-pgr.mkiv
+\loadmarkfile{typo-mar}
\loadmarkfile{core-job} % why so late?
\loadmarkfile{buff-ini}
\loadmarkfile{buff-ver}
+\loadmarkfile{buff-par}
+
+\loadmarkfile{buff-imp-tex} % optional as also runtime if not loaded
+\loadmarkfile{buff-imp-mp} % optional as also runtime if not loaded
+\loadmarkfile{buff-imp-lua} % optional as also runtime if not loaded
+\loadmarkfile{buff-imp-xml} % optional as also runtime if not loaded
+
+\loadmarkfile{buff-imp-parsed-xml} % optional
+%loadmarkfile{buff-imp-parsed-lua} % optional
\loadmarkfile{strc-blk}
\loadmarkfile{page-imp}
+\loadmarkfile{page-sel} % optional
+\loadmarkfile{page-com} % optional
+
+\loadmkvifile{scrn-pag}
+\loadmkvifile{scrn-wid}
+\loadmkvifile{scrn-but}
+\loadmkvifile{scrn-bar}
-\loadmarkfile{scrn-int}
-\loadmarkfile{scrn-men}
-\loadmarkfile{scrn-but}
-\loadmarkfile{scrn-bar}
\loadmarkfile{strc-bkm} % bookmarks
\loadmarkfile{tabl-com}
\loadmarkfile{tabl-pln}
-\loadcorefile{thrd-tab}
-\loadmarkfile{tabl-tab}
+
+\loadmarkfile{tabl-tab} % thrd-tab stripped and merged
+
\loadmarkfile{tabl-tbl}
\loadmarkfile{tabl-ntb}
\loadmarkfile{tabl-nte}
@@ -245,8 +292,8 @@
\loadmarkfile{java-ini}
-\loadmarkfile{scrn-fld}
-\loadmarkfile{scrn-hlp}
+\loadmkvifile{scrn-fld}
+\loadmkvifile{scrn-hlp}
\loadmarkfile{char-enc}
\loadmarkfile{font-ini}
@@ -256,9 +303,12 @@
\loadmarkfile{font-col}
\loadmarkfile{font-gds}
+\loadmarkfile{blob-ini} % not to be used, we only use a helper
+
+\loadmarkfile{typo-cln}
\loadmarkfile{typo-spa}
\loadmarkfile{typo-krn}
-\loadmarkfile{typo-mir}
+\loadmarkfile{typo-dir}
\loadmarkfile{typo-brk}
\loadmarkfile{typo-cap}
\loadmarkfile{typo-dig}
@@ -266,22 +316,18 @@
\loadmarkfile{type-ini}
\loadmarkfile{type-set}
+\loadmarkfile{type-def}
+\loadmarkfile{type-lua}
\loadmarkfile{scrp-ini}
-\loadmarkfile{prop-ini}
-\loadmarkfile{prop-lay}
-\loadmarkfile{prop-mis}
+\loadmarkfile{prop-ini} % only for downward compatibility
\loadmarkfile{mlib-ctx}
-\loadmarkfile{mlib-pdf}
-\loadmarkfile{mlib-pps}
\loadmarkfile{meta-ini}
\loadmarkfile{meta-tex}
-\loadmarkfile{meta-pdf}
\loadmarkfile{meta-fun}
-
\loadmarkfile{meta-pag}
\loadmarkfile{page-flw}
@@ -314,6 +360,7 @@
\loadmarkfile{core-fnt}
\loadmarkfile{node-rul}
+\loadmarkfile{node-spl}
\loadmarkfile{strc-not}
\loadmarkfile{strc-lnt}
@@ -323,27 +370,29 @@
\loadmarkfile{grph-trf}
\loadmarkfile{grph-inc}
\loadmarkfile{grph-fig}
+\loadmarkfile{grph-raw}
\loadmarkfile{pack-box}
\loadmarkfile{pack-bar}
\loadmarkfile{page-app}
\loadmarkfile{meta-fig}
-\loadmarkfile{node-bck} % overloads anch-pgr (experimental and undocumented)
-
-\loadcorefile{lang-spa}
+\loadmarkfile{lang-spa} % will become obsolete
\loadmarkfile{bibl-bib}
\loadmarkfile{bibl-tra}
-\loadmarkfile{x-xtag} % at some point this will not be preloaded
+%loadmarkfile{x-xtag} % no longer preloaded
-\loadcorefile{meta-xml}
+\loadmarkfile{meta-xml}
-\loadcorefile{cont-log}
+\loadmarkfile{cont-log}
\loadmarkfile{task-ini}
+\loadmarkfile{cldf-ver} % verbatim, this can come late
+\loadmarkfile{cldf-com} % commands, this can come late
+
\loadmarkfile{core-ctx}
\loadmarkfile{core-ini}
@@ -353,28 +402,28 @@
%usemodule[x][res-08] % rlx runtime conversion
%usemodule[x][res-12] % rli external indentification
-\unprotect
+% now we hook in backend code (needs checking)
-\setupcurrentlanguage[\s!en]
+\loadmarkfile{back-pdf} % actually, this one should load the next three
+\loadmarkfile{mlib-pdf}
+\loadmarkfile{mlib-pps}
+\loadmarkfile{grph-epd}
+\loadmarkfile{meta-pdf}
+
+\loadmarkfile{back-exp}
+
+\setupcurrentlanguage[\defaultlanguagetag]
\prependtoks
- \ctxlua{statistics.starttiming(ctx)}%
+ \ctxlua{statistics.starttiming(statistics)}%
\to \everyjob
\appendtoks
- \ctxlua{statistics.stoptiming(ctx)}%
+ \ctxlua{statistics.stoptiming(statistics)}%
\to \everyjob
\appendtoks
- \writestatus\m!lua{used config path - \ctxlua{tex.print(caches.configpath())}}%
- \writestatus\m!lua{used cache path - \ctxlua{tex.print(caches.path)}}%
-\to \everydump
-
-\appendtoks
- \ctxlua {
- statistics.report_storage("log")
- statistics.save_fmt_status("\jobname","\contextversion","context.tex")
- }%
+ \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.mkiv")}% can become automatic
\to \everydump
-\protect \errorstopmode \dump \endinput
+\errorstopmode \dump \endinput