diff options
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/back-pdf.mkiv | 10 | ||||
-rw-r--r-- | tex/context/base/catc-ini.mkiv | 19 | ||||
-rw-r--r-- | tex/context/base/core-def.mkiv | 1 | ||||
-rw-r--r-- | tex/context/base/core-job.mkiv | 3 | ||||
-rw-r--r-- | tex/context/base/math-ini.mkiv | 4 | ||||
-rw-r--r-- | tex/context/base/mult-cld.lua | 30 | ||||
-rw-r--r-- | tex/context/base/pack-obj.mkiv | 4 | ||||
-rw-r--r-- | tex/context/base/syst-aux.mkiv | 30 | ||||
-rw-r--r-- | tex/context/base/type-ini.mkiv | 65 | ||||
-rw-r--r-- | tex/context/base/type-set.mkiv | 12 |
10 files changed, 96 insertions, 82 deletions
diff --git a/tex/context/base/back-pdf.mkiv b/tex/context/base/back-pdf.mkiv index 1a99a91a2..e0b1b46e6 100644 --- a/tex/context/base/back-pdf.mkiv +++ b/tex/context/base/back-pdf.mkiv @@ -110,16 +110,6 @@ \pdfbackendsetinfo{ConTeXt.Url} {www.pragma-ade.com}% \to \everylastbackendshipout -%D Unfortunately this is still needed (also for \METAPOST\ to -%D \PDF\ converter): - -% \def\doresetmapfilelist -% {\global\let\doresetmapfilelist\relax -% \pdfmapfile{original-empty.map}} -% -% \appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryxform -% \appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryximage - %D Transformations. Some day we will use primitives (once they're fixed). \def\dostartrotation#1% grouped diff --git a/tex/context/base/catc-ini.mkiv b/tex/context/base/catc-ini.mkiv index fbc8630de..56a8f87e1 100644 --- a/tex/context/base/catc-ini.mkiv +++ b/tex/context/base/catc-ini.mkiv @@ -247,16 +247,19 @@ %D what the next macros do. Saving the catcodes can be %D disabled by saying \type{\localcatcodestrue}. +% quite likely we will define \unexpanded earlier on so +% that \normalprotected will go + \let\savedcatcodetable\relax \newcount\catcoderestorelevel -\def\pushcatcodetable +\normalprotected\def\pushcatcodetable {\advance\catcoderestorelevel\plusone \tracepushcatcodetable \expandafter\chardef\csname scct:\number\catcoderestorelevel\endcsname\currentcatcodetable} -\def\popcatcodetable +\normalprotected\def\popcatcodetable {\ifcase\catcoderestorelevel \showcatcodenestingerror \else @@ -265,22 +268,22 @@ \advance\catcoderestorelevel\minusone \fi} -\def\showcatcodenestingerror % can be overloaded +\normalprotected\def\showcatcodenestingerror % can be overloaded {\immediate\write16{}% \immediate\write16{Fatal error: catcode push/pop mismatch. Fix this!}\wait\end \immediate\write16{}} -\def\restorecatcodes % takes previous level +\normalprotected\def\restorecatcodes % takes previous level {\ifnum\catcoderestorelevel>\plusone \expandafter\catcodetable\csname scct:\number\numexpr\catcoderestorelevel-1\relax\endcsname \fi} \newtoks\everycatcodetable -\def\setcatcodetable#1% - {\catcodetable#1% - \the\everycatcodetable - \tracesetcatcodetable} +\normalprotected\def\setcatcodetable#1% + {\catcodetable#1% + \the\everycatcodetable + \tracesetcatcodetable} \def\dotracecatcodetable#1{\immediate\write16{[#1]}} diff --git a/tex/context/base/core-def.mkiv b/tex/context/base/core-def.mkiv index 44e59ecae..fd91cddf6 100644 --- a/tex/context/base/core-def.mkiv +++ b/tex/context/base/core-def.mkiv @@ -31,6 +31,7 @@ \ifdefined\thirdstagepreloadfonts \else \let\thirdstagepreloadfonts \relax \fi \ifdefined\fourthstagepreloadfonts \else \let\fourthstagepreloadfonts\relax \fi +%prependtoks \preloadtypescript \to \everyjob \appendtoks \showcontextbanner \to \everyjob \appendtoks \initializenewlinechar \to \everyjob \appendtoks \calculatecurrenttime \to \everyjob diff --git a/tex/context/base/core-job.mkiv b/tex/context/base/core-job.mkiv index ad75cd079..4f4636ba9 100644 --- a/tex/context/base/core-job.mkiv +++ b/tex/context/base/core-job.mkiv @@ -68,8 +68,7 @@ {\readsysfile{#1.\mksuffix}{\showmessage\m!systems2{#1.\mksuffix}}\donothing} \def\loadsystemfiles - {\reportprotectionstate - \doloadsystemfile\f!newfilename % new code, to be integrated at some point, plus fixes posted on the list + {\doloadsystemfile\f!newfilename % new code, to be integrated at some point, plus fixes posted on the list \doloadsystemfile\f!locfilename % new code, somewhat experimental, not distributed (outside the dev group) \doloadsystemfile\f!expfilename % new code, very experimental, can be engine specific, mostly for me only \doloadsystemfile\f!sysfilename} % local settings, but probably not that good an idea to use diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv index 07a93d548..5b017e055 100644 --- a/tex/context/base/math-ini.mkiv +++ b/tex/context/base/math-ini.mkiv @@ -414,12 +414,14 @@ \egroup \appendtoks + \setfalse\knuthmode \catcode\underscoreasciicode\othercatcode \catcode\circumflexasciicode\othercatcode \catcode\ampersandasciicode \othercatcode \to \everynonknuthmode \appendtoks + \settrue\knuthmode \catcode\underscoreasciicode\subscriptcatcode \catcode\circumflexasciicode\superscriptcatcode \catcode\ampersandasciicode \alignmentcatcode @@ -459,7 +461,7 @@ \unexpanded\def\stopasciimode {\popcatcodetable - \donknuthmode} + \ifconditional\knuthmode\else\donknuthmode\fi} %D Needed for unicode: diff --git a/tex/context/base/mult-cld.lua b/tex/context/base/mult-cld.lua index 24660b3a4..08446a7ca 100644 --- a/tex/context/base/mult-cld.lua +++ b/tex/context/base/mult-cld.lua @@ -148,17 +148,6 @@ function context.popcatcodes() contentcatcodes = currentcatcodes end -function context.unprotect() - insert(catcodestack,currentcatcodes) - currentcatcodes = prtcatcodes - contentcatcodes = currentcatcodes -end - -function context.protect() - currentcatcodes = remove(catcodestack) or currentcatcodes - contentcatcodes = currentcatcodes -end - function tex.fprint(...) -- goodie texsprint(currentcatcodes,format(...)) end @@ -397,6 +386,25 @@ local defaultcaller = caller setmetatable(context, { __index = indexer, __call = caller } ) +-- now we tweak unprotect and protect + +function context.unprotect() + -- at the lua end + insert(catcodestack,currentcatcodes) + currentcatcodes = prtcatcodes + contentcatcodes = currentcatcodes + -- at the tex end + flush("\\unprotect") +end + +function context.protect() + -- at the tex end + flush("\\protect") + -- at the lua end + currentcatcodes = remove(catcodestack) or currentcatcodes + contentcatcodes = currentcatcodes +end + -- logging local trace_stack = { } diff --git a/tex/context/base/pack-obj.mkiv b/tex/context/base/pack-obj.mkiv index e2620955d..6af439021 100644 --- a/tex/context/base/pack-obj.mkiv +++ b/tex/context/base/pack-obj.mkiv @@ -90,6 +90,8 @@ % end % \stopluacode % +% \unprotect +% % \newbox \objectbox % \newtoks \everyobject % \newif \ifinobject @@ -101,7 +103,7 @@ % % \def\objectoffset{1cm} % -% \everyobject{\the\everyPDFxform} +% \everyobject{\the\pdfbackendeveryxform} % % \let\doresetobjects\relax % diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv index e12951fa4..c2a47b828 100644 --- a/tex/context/base/syst-aux.mkiv +++ b/tex/context/base/syst-aux.mkiv @@ -37,7 +37,20 @@ \unprotect -\let\reportprotectionstate\relax +%D \macros +%D {unexpanded} +%D +%D Because we use this module only in \MKIV, we have removed the +%D old protection code. +%D +%D \starttyping +%D \unexpanded\def\somecommand{... ... ...} +%D \stoptyping +%D +%D This overloads the \ETEX\ primitive but as we already had an \MKII\ +%D solution we keep the same name for a similar mechanism. + +\let\unexpanded\normalprotected %D \macros %D {doifolderversionelse} @@ -454,21 +467,6 @@ \def\globallet{\global\let} \let\glet\globallet %D \macros -%D {unexpanded} -%D -%D Because we use this module only in \MKIV, we have removed the -%D old protection code. -%D -%D \starttyping -%D \unexpanded\def\somecommand{... ... ...} -%D \stoptyping -%D -%D This overloads the \ETEX\ primitive but as we already had an \MKII\ -%D solution we keep the same name for a similar mechanism. - -\let\unexpanded\normalprotected - -%D \macros %D {doifundefined,doifdefined, %D doifundefinedelse,doifdefinedelse, %D doifalldefinedelse} diff --git a/tex/context/base/type-ini.mkiv b/tex/context/base/type-ini.mkiv index fce3cd816..298618a4a 100644 --- a/tex/context/base/type-ini.mkiv +++ b/tex/context/base/type-ini.mkiv @@ -132,11 +132,31 @@ \def\preloadtypescripts{\ifproductionrun\settrue\preloadingtypescripts\fi} +\prependtoks + \preloadtypescripts +\to \everyjob + +% \long\def\xxstarttypescript#1\stoptypescript +% {\global\loadedtypescripts\@EA{\the\loadedtypescripts\starttypescript#1\stoptypescript}} +% +% \long\def\xxstarttypescriptcollection#1\stoptypescriptcollection +% {\global\loadedtypescripts\@EA{\the\loadedtypescripts\starttypescriptcollection#1\stoptypescriptcollection}} + +\newcount\nofpreloadedtypescripts % it's faster to append references than blobs + \long\def\xxstarttypescript#1\stoptypescript - {\global\loadedtypescripts\@EA{\the\loadedtypescripts\starttypescript#1\stoptypescript}} + {\global\advance\nofpreloadedtypescripts\plusone + \edef\currentpreloadedtypescript{\??ts:\the\nofpreloadedtypescripts}% + \setgvalue\currentpreloadedtypescript{\starttypescript#1\stoptypescript}% + %\global\loadedtypescripts\@EAEAEA{\@EA\the\@EA\loadedtypescripts\@EA\getvalue\@EA{\currentpreloadedtypescript}}} + \normalexpanded{\global\loadedtypescripts{\the\@EA\loadedtypescripts\noexpand\csname\currentpreloadedtypescript\endcsname}}} \long\def\xxstarttypescriptcollection#1\stoptypescriptcollection - {\global\loadedtypescripts\@EA{\the\loadedtypescripts\starttypescriptcollection#1\stoptypescriptcollection}} + {\global\advance\nofpreloadedtypescripts\plusone + \edef\currentpreloadedtypescript{\??ts:\the\nofpreloadedtypescripts}% + \setgvalue\currentpreloadedtypescript{\starttypescriptcollection#1\stoptypescriptcollection}% + %\global\loadedtypescripts\@EAEAEA{\@EA\the\@EA\loadedtypescripts\@EA\getvalue\@EA{\currentpreloadedtypescript}}} + \normalexpanded{\global\loadedtypescripts{\the\@EA\loadedtypescripts\noexpand\csname\currentpreloadedtypescript\endcsname}}} \def\dododousetypescriptfile#1% {\setfalse\quittingtypescript @@ -169,17 +189,17 @@ \egroup \expandafter\let\csname\??ts:\c!file:\currenttypefile\endcsname\loadedtypescripts} -% \def\doprocesstypescriptfile -% {\ctxlua{commands.doprocesstypescriptfile("\currenttypefile")}} - \def\doprocesstypescriptfile - {\startreadingfile - \pushendofline - \unprotect - \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}% - \protect - \popendofline - \stopreadingfile} + {\ctxlua{commands.doprocesstypescriptfile("\currenttypefile")}} + +% \def\doprocesstypescriptfile +% {\startreadingfile +% \pushendofline +% \unprotect +% \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}% +% \protect +% \popendofline +% \stopreadingfile} \def\usetypescriptonce {\dotripleempty\dousetypescriptonce} @@ -344,14 +364,6 @@ \def\doloadmapline [#1][#2]{\ctxlua{fonts.map.loadline("#1","#2")}} \def\forgetmapfiles {\ctxlua{fonts.map.reset()}} -\let\loadallfontmapfiles\relax -\let\allfontmapsfiles \empty -\let\preloadmapfile \loadmapfile -\let\resetmapfiles \forgetmapfiles -\let\disablemapfiles \forgetmapfiles - -\newif\ifautoloadmapfiles - % \appendtoks % \pdfmapfile{}% somehow does not work at the lua end % \to \everyjob @@ -481,14 +493,13 @@ \fi \fi \fi \ifmmode\mr\else\tf\fi} % needed ? -% \def\usetypefile[#1]% recurses on path ! % no storage? obsolete? -% %{\edef\currenttypefile{\f!typeprefix#1}% -% {\edef\currenttypefile{#1}% -% \ctxlua{commands.doprocesstypescriptfile("\currenttypefile")}} +% \def\usetypefile[#1]% recurses on path ! +% {\edef\currenttypefile{\f!typeprefix#1}% +% \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}} -\def\usetypefile[#1]% recurses on path ! - {\edef\currenttypefile{\f!typeprefix#1}% - \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}} +\def\usetypefile[#1]% recurses on path ! % no storage? obsolete? + {\edef\currenttypefile{#1}% + \ctxlua{commands.doprocesstypescriptfile("\currenttypefile")}} %D For Taco: %D diff --git a/tex/context/base/type-set.mkiv b/tex/context/base/type-set.mkiv index b25fe5ad9..89dd68a8f 100644 --- a/tex/context/base/type-set.mkiv +++ b/tex/context/base/type-set.mkiv @@ -67,11 +67,11 @@ %definefontsynonym [SansCaps] [SansBold] \stopsetups -%usetypescriptfile[type-def] % preloaded in main context.mkiv file -%usetypescriptfile[type-lua] % preloaded in main context.mkiv file -%usetypescriptfile[type-tmf] % replaced by otf (mkiv) en one (mkii) -\usetypescriptfile[type-siz] -\usetypescriptfile[type-otf] -\usetypescriptfile[type-loc] +%usetypescriptfile[def] % preloaded in main context.mkiv file +%usetypescriptfile[lua] % preloaded in main context.mkiv file +%usetypescriptfile[tmf] % replaced by otf (mkiv) en one (mkii) +\usetypescriptfile[siz] +\usetypescriptfile[otf] +\usetypescriptfile[loc] \protect \endinput |