diff options
Diffstat (limited to 'tex')
33 files changed, 275 insertions, 287 deletions
diff --git a/tex/context/base/attr-ini.mkiv b/tex/context/base/attr-ini.mkiv index b0a56145c..051128558 100644 --- a/tex/context/base/attr-ini.mkiv +++ b/tex/context/base/attr-ini.mkiv @@ -43,8 +43,8 @@ \definesystemattribute[transparency] \chardef\transparencyattribute \dogetattributeid{transparency} \definesystemattribute[background] \chardef\backgroundattribute \dogetattributeid{background} \definesystemattribute[colorintent] \chardef\colorintentattribute \dogetattributeid{colorintent} -\definesystemattribute[negative] -\definesystemattribute[effect] +\definesystemattribute[negative] \chardef\negativeattribute \dogetattributeid{negative} +\definesystemattribute[effect] \chardef\effectattribute \dogetattributeid{effect} \definesystemattribute[viewerlayer] \chardef\viewerlayerattribute \dogetattributeid{viewerlayer} \definesystemattribute[layoutcomponent] \chardef\layoutcomponentattribute\dogetattributeid{layoutcomponent} \definesystemattribute[reference] \chardef\referenceattribute \dogetattributeid{reference} @@ -72,7 +72,7 @@ \def\setcolormodel#1% {\currentcolormodel\ctxlua{tex.print(colors.setmodel('#1'))}% - \dosetattribute{colormodel}{\the\currentcolormodel}} + \attribute\colormodelattribute\currentcolormodel} \setcolormodel{all} @@ -87,7 +87,7 @@ % transparency \def\registertransparency#1#2#3% - {\setevalue{(ts:#1)}{\dosetattribute{transparency}{\ctxlua{tex.print(transparencies.register(#2,#3))}}}} + {\setevalue{(ts:#1)}{\attribute\transparencyattribute\ctxlua{tex.write(transparencies.register(#2,#3))} }} \def\sometransparencyswitch#1{\csname(ts:#1)\endcsname} @@ -102,7 +102,7 @@ % overprint \def\registercolorintent#1#2% - {\setevalue{(os:#1)}{\dosetattribute{colorintent}{\ctxlua{tex.print(colorintents.register('#2'))}}}} + {\setevalue{(os:#1)}{\attribute\colorintentattribute\ctxlua{tex.write(colorintents.register('#2'))} }} \def\dotriggercolorintent {\ctxlua{colorintents.enable()}% @@ -114,12 +114,12 @@ \installattributestack\colorintentattribute -\setevalue{(os:#\v!none}{\doresetattribute{colorintent}} % does this work out ok? +\setevalue{(os:#\v!none}{\attribute\colorintentattribute\attributeunsetvalue} % does this work out ok? % negative \def\registernegative#1#2% - {\setevalue{(ns:#1)}{\dosetattribute{negative}{\ctxlua{tex.print(negatives.register('#2'))}}}} + {\setevalue{(ns:#1)}{\attribute\negativeattribute\ctxlua{tex.write(negatives.register('#2'))} }} \def\dotriggernegative {\ctxlua{negatives.enable()}% @@ -133,7 +133,7 @@ \def\registereffect#1#2#3% #2=stretch #3=rulethickness {\setxvalue{(es:#1:#2:\number\dimexpr#3\relax)}% - {\dosetattribute{effect}{\ctxlua{tex.print(effects.register('#1',#2,\number\dimexpr#3\relax))}}}} + {\attribute\effectattribute\ctxlua{tex.write(effects.register('#1',#2,\number\dimexpr#3\relax))} }} \def\dotriggereffect {\ctxlua{effects.enable()}% @@ -150,17 +150,12 @@ % viewerlayers (will probably change a bit) -% \def\registerviewerlayer#1#2% global ! -% {\setxvalue{(vl:#1)}{\dosetattribute{viewerlayer}{\ctxlua{tex.print(viewerlayers.register('#2'))}}}} -% -% \setevalue{(vl:)}{\doresetattribute{viewerlayer}} -% % needs to work over stopitemize grouping etc \def\registerviewerlayer#1#2% global ! - {\setxvalue{(vl:#1)}{\global\dosetattribute{viewerlayer}{\ctxlua{tex.print(viewerlayers.register('#2'))}}}} + {\setxvalue{(vl:#1)}{\global\attribute\viewerlayerattribute\ctxlua{tex.write(viewerlayers.register('#2'))} }} -\setevalue{(vl:)}{\global\doresetattribute{viewerlayer}} +\setevalue{(vl:)}{\global\attribute\viewerlayerattribute\attributeunsetvalue} \def\dotriggerviewerlayer {\ctxlua{viewerlayers.enable()}% diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv index 091ccc747..fc81908e4 100644 --- a/tex/context/base/colo-ini.mkiv +++ b/tex/context/base/colo-ini.mkiv @@ -716,7 +716,7 @@ \def\dosetcolormodel#1% no message {\currentcolormodel\ctxlua{tex.print(colors.setmodel('#1',\ifweightGRAY true\else false\fi))}% - \dosetattribute{colormodel}{\the\currentcolormodel}} + \attribute\colormodelattribute\currentcolormodel} \setcolormodel{all} @@ -826,7 +826,7 @@ \ifx\@@rastervalue\empty \let\@@rastervalue\@@rsscreen \fi - \dosetattribute\s!color{\ctxlua{tex.sprint(colors.definesimplegray("_raster_",\@@rastervalue))}}} + \attribute\colorattribute\ctxlua{tex.sprint(colors.definesimplegray("_raster_",\@@rastervalue))}\relax} \def\dodefinefastcolor[#1][#2]% still not fast but ok {\ctxlua{colors.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}% @@ -903,14 +903,6 @@ \ifx\maintextcolor\empty\else\doactivatecolor\maintextcolor\fi \to \everybeforeoutput -% \def\startregistercolor[#1]% probably obsolete -% {\doifelsenothing{#1} -% {\let\stopregistercolor\relax} -% {\edef\stopregistercolor -% {\dosetattribute\s!color {\dogetattribute\s!color }% -% \dosetattribute\s!transparency{\dogetattribute\s!transparency}}% -% \doactivatecolor{#1}}} - \def\registermaintextcolor{\ctxlua{colors.main = \thecolorattribute\maintextcolor}} \def\starttextcolor[#1]% diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index f256094f7..5b751a632 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -47,11 +47,6 @@ \unexpanded\def\textplus {\char"002B } % plus -% \def\registerviewerlayer#1#2% global ! -% {\setxvalue{(vl:#1)}{\global\dosetattribute{viewerlayer}{\ctxlua{tex.print(viewerlayers.register('#2'))}}}} - -% \setevalue{(vl:)}{\global\doresetattribute{viewerlayer}} - \let\\=\crlf % till we fixed all styles % \def\pagedir{\expandafter\gobblethreearguments} @@ -138,8 +133,6 @@ % end) % } -\definestartstop[randomized][\c!before=\dosetattribute{case}{8},\c!after=] - \protect \endinput % \expanded{\defineactivecharacter \number"2000E} {\textdir TRT\relax} diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 6687be198..1bfc24608 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2010.01.05 16:47} +\newcontextversion{2010.01.08 23:58} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 3a64eb824..0906b2e4e 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2010.01.05 16:47} +\edef\contextversion{2010.01.08 23:58} %D For those who want to use this: diff --git a/tex/context/base/font-gds.mkiv b/tex/context/base/font-gds.mkiv index afdede721..921a2097a 100644 --- a/tex/context/base/font-gds.mkiv +++ b/tex/context/base/font-gds.mkiv @@ -35,14 +35,14 @@ \definecolor[colorscheme:2:2][m=.75] \definecolor[colorscheme:2:1][y=.75] -\definesystemattribute[colorscheme] +\definesystemattribute[colorscheme] \chardef\colorschemeattribute \dogetattributeid{colorscheme} \def\setfontcolorscheme {\ctxlua{fonts.goodies.colorschemes.enable()}% - \xdef\setfontcolorscheme[##1]{\dosetattribute{colorscheme}{##1}}% + \xdef\setfontcolorscheme[##1]{\attribute\colorschemeattribute##1\relax}% \setfontcolorscheme} -\edef\resetfontcolorscheme{\doresetattribute{colorscheme}} +\edef\resetfontcolorscheme{\attribute\colorschemeattribute\attributeunsetvalue} \protect \endinput diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index d01c5d7e9..6ff3d4086 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -1222,13 +1222,15 @@ otf.enhancers["reorganize kerns"] = function(data,filename) local offset = offsets[baseoffset + sk] --~ local offset = offsets[sk] -- (fk-1) * maxseconds + sk] local splt = split[sv] - for i=1,#splt do - local second_unicode = splt[i] - if tonumber(second_unicode) then - lookupkerns[second_unicode] = offset - else - for s=1,#second_unicode do - lookupkerns[second_unicode[s]] = offset + if splt then + for i=1,#splt do + local second_unicode = splt[i] + if tonumber(second_unicode) then + lookupkerns[second_unicode] = offset + else + for s=1,#second_unicode do + lookupkerns[second_unicode[s]] = offset + end end end end @@ -1240,13 +1242,15 @@ otf.enhancers["reorganize kerns"] = function(data,filename) for fk=1,#firsts do local fv = firsts[fk] local splt = split[fv] - for i=1,#splt do - local first_unicode = splt[i] - if tonumber(first_unicode) then - do_it(fk,first_unicode) - else - for f=1,#first_unicode do - do_it(fk,first_unicode[f]) + if splt then + for i=1,#splt do + local first_unicode = splt[i] + if tonumber(first_unicode) then + do_it(fk,first_unicode) + else + for f=1,#first_unicode do + do_it(fk,first_unicode[f]) + end end end end diff --git a/tex/context/base/math-def.mkiv b/tex/context/base/math-def.mkiv index 79c832b4f..201b93657 100644 --- a/tex/context/base/math-def.mkiv +++ b/tex/context/base/math-def.mkiv @@ -40,7 +40,7 @@ \to \everysetupmathematics % \appendtoks -% \ifconditional\automathpunctuation\dosetattribute{mathpunctuation}\plusone\fi +% \ifconditional\automathpunctuation\attribute\mathpunctuationattribute\plusone\fi % \to \everymathematics \setupmathematics[\v!autopunctuation=\v!yes] @@ -106,7 +106,10 @@ % using attributes -\def\choosemathbig#1#2{\dosetattribute{mathsize}{#1}\left#2\right.\doresetattribute{mathsize}} +\def\choosemathbig#1#2% + {\attribute\mathsizeattribute#1\relax + \left#2\right.% + \attribute\mathsizeattribute\attributeunsetvalue} \definemathcommand [big] {\choosemathbig\plusone } \definemathcommand [Big] {\choosemathbig\plustwo } diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv index b62f6507d..b6fe66b2e 100644 --- a/tex/context/base/math-ini.mkiv +++ b/tex/context/base/math-ini.mkiv @@ -47,16 +47,16 @@ \registerctxluafile{math-map}{1.001} \registerctxluafile{math-noa}{1.001} -\definesystemattribute[mathalphabet] -\definesystemattribute[mathsize] -\definesystemattribute[mathpunctuation] -\definesystemattribute[mathgreek] +\definesystemattribute[mathalphabet] \chardef\mathalphabetattribute \dogetattributeid{mathalphabet} +\definesystemattribute[mathsize] \chardef\mathsizeattribute \dogetattributeid{mathsize} +\definesystemattribute[mathpunctuation] \chardef\mathpunctuationattribute \dogetattributeid{mathpunctuation} +\definesystemattribute[mathgreek] \chardef\mathgreekattribute \dogetattributeid{mathgreek} % todo: only in mmode -\unexpanded\def\mathgreekupright{\dosetattribute {mathgreek}{11}} -\unexpanded\def\mathgreekitalic {\dosetattribute {mathgreek}{22}} -\unexpanded\def\mathgreekdefault{\doresetattribute{mathgreek}} +\unexpanded\def\mathgreekupright{\attribute\mathgreekattribute11 } +\unexpanded\def\mathgreekitalic {\attribute\mathgreekattribute22 } +\unexpanded\def\mathgreekdefault{\attribute\mathgreekattribute\attributeunsetvalue} \let\mathgreeknormal\mathgreekupright \let\mathgreeknone \mathgreekdefault @@ -452,17 +452,17 @@ % [lc uc] normal (upright) = 2, italic = 3, none = 0/1 -\setevalue{\??mo:greek:\v!normal :\v!normal}{\dosetattribute {mathgreek}{22}} -\setevalue{\??mo:greek:\v!normal :\v!italic}{\dosetattribute {mathgreek}{23}} -\setevalue{\??mo:greek:\v!normal :\v!none }{\dosetattribute {mathgreek}{21}} +\setevalue{\??mo:greek:\v!normal :\v!normal}{\attribute\mathgreekattribute22 } +\setevalue{\??mo:greek:\v!normal :\v!italic}{\attribute\mathgreekattribute23 } +\setevalue{\??mo:greek:\v!normal :\v!none }{\attribute\mathgreekattribute21 } -\setevalue{\??mo:greek:\v!italic :\v!normal}{\dosetattribute {mathgreek}{32}} -\setevalue{\??mo:greek:\v!italic :\v!italic}{\dosetattribute {mathgreek}{33}} -\setevalue{\??mo:greek:\v!italic :\v!none }{\dosetattribute {mathgreek}{31}} +\setevalue{\??mo:greek:\v!italic :\v!normal}{\attribute\mathgreekattribute32 } +\setevalue{\??mo:greek:\v!italic :\v!italic}{\attribute\mathgreekattribute33 } +\setevalue{\??mo:greek:\v!italic :\v!none }{\attribute\mathgreekattribute31 } -\setevalue{\??mo:greek:\v!none :\v!normal}{\dosetattribute {mathgreek}{12}} -\setevalue{\??mo:greek:\v!none :\v!italic}{\dosetattribute {mathgreek}{13}} -\setevalue{\??mo:greek:\v!none :\v!none }{\doresetattribute{mathgreek}} +\setevalue{\??mo:greek:\v!none :\v!normal}{\attribute\mathgreekattribute12 } +\setevalue{\??mo:greek:\v!none :\v!italic}{\attribute\mathgreekattribute13 } +\setevalue{\??mo:greek:\v!none :\v!none }{\attribute\mathgreekattribute\attributeunsetvalue} \appendtoks \csname\??mo:greek:\@@molcgreek:\@@moucgreek\endcsname @@ -495,7 +495,7 @@ \to \everysetupmathematics \appendtoks - \ifconditional\automathpunctuation\dosetattribute{mathpunctuation}\plusone\fi + \ifconditional\automathpunctuation\attribute\mathpunctuationattribute\plusone\fi \to \everymathematics \setupmathematics diff --git a/tex/context/base/node-bck.mkiv b/tex/context/base/node-bck.mkiv index 758e598e8..41a6da2cb 100644 --- a/tex/context/base/node-bck.mkiv +++ b/tex/context/base/node-bck.mkiv @@ -84,14 +84,14 @@ \global\maxtabularcolorcolumn\tabulatecolumn \fi \setxvalue{\??tt:c:\the\tabulatecolumn}{#1}% - \dosetattribute{background}\plusone + \attribute\backgroundattribute\plusone \faststartcolor[#1]\strut\char0\faststopcolor \endgroup} \def\repeatsettabulatecolor {\begingroup \ifcsname\??tt:c:\the\tabulatecolumn\endcsname - \dosetattribute{background}\plusone + \attribute\backgroundattribute\plusone \faststartcolor[\csname\??tt:c:\the\tabulatecolumn\endcsname]\strut\char0\faststopcolor \fi \endgroup} diff --git a/tex/context/base/node-fin.mkiv b/tex/context/base/node-fin.mkiv index 8c15eb57d..9a5ce6f32 100644 --- a/tex/context/base/node-fin.mkiv +++ b/tex/context/base/node-fin.mkiv @@ -20,7 +20,7 @@ \registerctxluafile{node-fin}{1.001} % we might generalize this one -\definesystemattribute[trigger] % feature inheritance +\definesystemattribute[trigger] \chardef\triggerattribute \dogetattributeid{trigger} % feature inheritance \def\finalizeobjectbox #1{\ctxlua{nodes.process_page(tex.box[\number#1])}} \def\finalizeshipoutbox#1{\ctxlua{nodes.process_page(tex.box[\number#1])}} @@ -29,11 +29,11 @@ \newcount\attributeboxcount -\edef\startinheritattributes{\dosetattribute {trigger}{1}} -\edef\stopinheritattributes {\doresetattribute{trigger}} +\edef\startinheritattributes{\attribute\triggerattribute\plusone} +\edef\stopinheritattributes {\attribute\triggerattribute\attributeunsetvalue} -\def\doattributedcopy {\afterassignment\dodoattributedcopy\attributeboxcount} -\def\doattributedbox {\afterassignment\dodoattributedbox \attributeboxcount} +\def\doattributedcopy{\afterassignment\dodoattributedcopy\attributeboxcount} +\def\doattributedbox {\afterassignment\dodoattributedbox \attributeboxcount} \def\dodoattributedcopy {\startinheritattributes diff --git a/tex/context/base/node-par.mkiv b/tex/context/base/node-par.mkiv index 7f7ca9977..ae56f85d7 100644 --- a/tex/context/base/node-par.mkiv +++ b/tex/context/base/node-par.mkiv @@ -30,23 +30,23 @@ \registerctxluafile{node-par}{1.001} -\definesystemattribute[parbuilder] +\definesystemattribute[parbuilder] \chardef\parbuilderattribute \dogetattributeid{parbuilder} \newcount\nofparbuilders \def\defineparbuilder[#1]% {\global\advance\nofparbuilders\plusone \ctxlua{parbuilders.register("#1",\number\nofparbuilders)}% - \setxvalue{\??ng:#1}{\dosetattribute{parbuilder}{\number\nofparbuilders}}} + \setxvalue{\??ng:#1}{\attribute\parbuilderattribute\nofparbuilders}} \def\startparbuilder[#1]% - {\edef\@@currentparbuilder{\number\dogetattribute{parbuilder}}% + {\edef\@@currentparbuilder{\number\attribute\parbuilderattribute}% \globalpushmacro\@@currentparbuilder \getvalue{\??ng:#1}} \def\stopparbuilder {\globalpopmacro\@@currentparbuilder - \dosetattribute{parbuilder}{\@@currentparbuilder}} + \attribute\parbuilderattribute\@@currentparbuilder\relax} % no high level interface, after all implementing a linebreaker is not something that % the average user will do diff --git a/tex/context/base/node-rul.mkiv b/tex/context/base/node-rul.mkiv index f55bd28ec..c89ccb784 100644 --- a/tex/context/base/node-rul.mkiv +++ b/tex/context/base/node-rul.mkiv @@ -125,8 +125,8 @@ \def\dodoruledindeed#1% {\advance\csname\??on:#1:c\endcsname\plusone \scratchcounter\csname\??on:#1:c\endcsname - \dosetattribute{ruled}{\numexpr1000*\scratchcounter - +\csname\??on#1\ifcsname\??on#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname}} + \attribute\ruledattribute\numexpr1000*\scratchcounter + +\csname\??on#1\ifcsname\??on#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname} % ungrouped @@ -262,8 +262,8 @@ % {\def\currentshift{#1}% % \advance\csname\??ra:#1:c\endcsname\plusone % \scratchcounter\csname\??ra:#1:c\endcsname -% \dosetattribute{shifted}{\numexpr1000*\scratchcounter -% +\csname\??ra#1\ifcsname\??ra#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname}% +% \attribute\shiftedattribute\numexpr1000*\scratchcounter +% +\csname\??ra#1\ifcsname\??ra#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname % \setupalign[\shiftparameter\c!align]% % \dosetshiftattributes\c!style\c!color} @@ -284,8 +284,8 @@ {\def\currentshift{#1}% \advance\csname\??ra:#1:c\endcsname\plusone \scratchcounter\csname\??ra:#1:c\endcsname - \dosetattribute{shifted}{\numexpr1000*\scratchcounter - +\csname\??ra#1\ifcsname\??ra#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname}% + \attribute\shiftedattribute\numexpr1000*\scratchcounter + +\csname\??ra#1\ifcsname\??ra#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname \dosetshiftattributes\c!style\c!color \dosetupisolatedalign{\shiftparameter\c!align}} diff --git a/tex/context/base/page-ini.mkiv b/tex/context/base/page-ini.mkiv index fae7611ac..ae53abd8c 100644 --- a/tex/context/base/page-ini.mkiv +++ b/tex/context/base/page-ini.mkiv @@ -246,7 +246,7 @@ % When issuing two \par\penalty-\plustenthousand's, only the first % triggers the otr; obscure feature or optimization? -\def\outputcounter{-100010} % -10010 +\newcount\outputcounter \outputcounter=-100010 % -10010 \def\doinvokeoutput {\iftraceotr @@ -255,35 +255,50 @@ \expandafter\dodoinvokeoutput \fi} -\def\outputmessage#1#2#3% - {\iftraceotr\writestatus\m!otr{#1 #2 \number#3}\fi} +\def\doshowoutputmessage#1#2#3% + {\writestatus\m!otr{#1 #2 \number#3}} \def\dodoinvokeoutput#1% - {\outputmessage+{special}{#1}% - \bgroup\par\penalty#1\relax\egroup - \outputmessage-{special}{#1}} + {\bgroup\par\penalty#1\egroup} \def\dodotracedoutput#1% - {\outputmessage+{traced}{#1/\the\outputpenalty}% + {\doshowoutputmessage+{traced}{#1/\the\outputpenalty}% \writestatus\m!otr{c:\number\mofcolumns,v:\the\vsize,g:\the\pagegoal,t:\the\pagetotal}% \dodoinvokeoutput{#1}% \writestatus\m!otr{c:\number\mofcolumns,v:\the\vsize,g:\the\pagegoal,t:\the\pagetotal}% - \outputmessage-{traced}{#1/\the\outputpenalty}} + \doshowoutputmessage-{traced}{#1/\the\outputpenalty}} \def\installoutput#1#2% \invoke \action - {\decrement\outputcounter - \edef#1{\noexpand\doinvokeoutput{\outputcounter}}% - \setvalue{\@@OTR\outputcounter}{#2}} + {\global\advance\outputcounter\minusone + \edef#1{\noexpand\doinvokeoutput{\number\outputcounter}}% + \setvalue{\@@OTR\number\outputcounter}{#2}} + +\def\invoketracedoutputroutine + {\doshowoutputmessage+{trying}\outputpenalty + \ifcsname\@@OTR\the\outputpenalty\endcsname + \doshowoutputmessage+{special}\outputpenalty + \csname\@@OTR\the\outputpenalty\endcsname + \doshowoutputmessage-{special}\outputpenalty + \else + \doshowoutputmessage+{normal}\outputpenalty + \the\OTRcommand\output + \doshowoutputmessage-{normal}\outputpenalty + \fi + \doshowoutputmessage-{trying}\outputpenalty} -\def\invokeoutputroutine - {\outputmessage+{trying}\outputpenalty - \executeifdefined{\@@OTR\the\outputpenalty}\dodonormaloutput - \outputmessage-{trying}\outputpenalty} +\def\invokenormaloutputroutine + {\ifcsname\@@OTR\the\outputpenalty\endcsname + \csname\@@OTR\the\outputpenalty\endcsname + \else + \the\OTRcommand\output + \fi} -\def\dodonormaloutput - {\outputmessage+{normal}\outputpenalty - \the\OTRcommand\output - \outputmessage-{normal}\outputpenalty} +\def\invokeoutputroutine + {\iftraceotr + \expandafter\invoketracedoutputroutine + \else + \expandafter\invokenormaloutputroutine + \fi} \mainoutput{\invokeoutputroutine} \output{\inotrtrue\the\mainoutput} @@ -556,7 +571,7 @@ \dosupereject \fi \doflushspread - \dopostponeblock} + \doflushpostponedcontent} \def\dooutput {\finaloutput\unvbox\normalpagebox} @@ -886,7 +901,7 @@ % \setnextsubpageno % nog eens: als in pagina (tbv standaard opmaak) \dontshowboxes % dan hier blokkeren en verderop resetten % \shipoutfacingpage - \checkmargeblokken + \checkmarginblocks \the\beforeeverypage \normalexpanded{\global\beforepage\emptytoks\the\beforepage}% \scratchtoks\beforepage\global\beforepage\emptytoks\the\scratchtoks % was \flushtoks\beforepage \inpagebodytrue\buildpagebody#1#2% diff --git a/tex/context/base/page-lay.mkiv b/tex/context/base/page-lay.mkiv index c7dabb66d..80e2574c6 100644 --- a/tex/context/base/page-lay.mkiv +++ b/tex/context/base/page-lay.mkiv @@ -995,12 +995,12 @@ \newif\ifshiftedrealpageno -% We could use nested if here plu ssone \@EAEAEA's but but the +% We could use nested if here plus some \@EAEAEA's but but the % next variant has less expansion which is nicer in tracing. -\def\doifoddpageelse {\ifshiftedrealpageno\expandafter\doifoddpageelseyes\else\expandafter\doifoddpageelsenop\fi} -\def\doifoddpageelseyes{\ifodd\realpageno\expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments\fi} -\def\doifoddpageelsenop{\ifodd\realpageno\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi} +\def\doifoddpageelse {\ifshiftedrealpageno\expandafter\doifoddpageelseyes \else\expandafter\doifoddpageelsenop \fi} +\def\doifoddpageelseyes{\ifodd \realpageno\expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments \fi} +\def\doifoddpageelsenop{\ifodd \realpageno\expandafter\firstoftwoarguments \else\expandafter\secondoftwoarguments\fi} \let\doifonevenpaginaelse\doifoddpageelse @@ -1032,6 +1032,30 @@ \def\settexthoffset {\texthoffset\doifbothsides\backspace\backspace{\dimexpr\paperwidth-\backspace-\makeupwidth\relax}} +% The next hack is too tricky as we may shipout more pages: +% +% \def\freezepagestatechecks +% {\the\everyfreezepagestatechecks} +% +% \newtoks \everyfreezepagestatechecks +% +% \appendtoks +% \doifbothsides +% {\let\doifbothsides\firstofthreearguments}% +% {\let\doifbothsides\secondofthreearguments}% +% {\let\doifbothsides\thirdofthreearguments}% +% \rightorleftpageaction +% {\let\rightorleftpageaction\firstoftwoarguments}% +% {\let\rightorleftpageaction\secondoftwoarguments}% +% \doifmarginswapelse +% {\let\doifmarginswapelse\firstoftwoarguments}% +% {\let\doifmarginswapelse\secondoftwoarguments}% +% \to \everyfreezepagestatechecks +% +% \prependtoks +% \freezepagestatechecks +% \to \everybeforeshipout + \def\goleftonpage {\hskip-\dimexpr\leftmargindistance+\leftmarginwidth+\leftedgedistance+\leftedgewidth\relax} diff --git a/tex/context/base/page-lin.mkiv b/tex/context/base/page-lin.mkiv index fc813953f..8c7144a48 100644 --- a/tex/context/base/page-lin.mkiv +++ b/tex/context/base/page-lin.mkiv @@ -21,11 +21,11 @@ \registerctxluafile{page-lin}{1.001} -\definesystemattribute[line-number] -\definesystemattribute[line-reference] +\definesystemattribute[line-number] \chardef\linenumberattribute \dogetattributeid{line-number} +\definesystemattribute[line-reference] \chardef\linereferenceattribute \dogetattributeid{line-reference} -\appendtoksonce\doresetattribute{line-number}\to\everyforgetall -\appendtoksonce\dosetattribute{display-math}{1}\to\everybeforedisplayformula +\appendtoksonce \attribute\linenumberattribute \attributeunsetvalue \to \everyforgetall +\appendtoksonce \attribute\displaymathattribute\plusone \to \everybeforedisplayformula \newcount\linenumber \newbox \linenumberscratchbox @@ -88,7 +88,7 @@ \or \mkdefinetextlinenumbering % restart \fi - \dosetattribute{line-number}{\getvalue{ln:c:\currentlinenumbering}}} + \attribute\linenumberattribute\getvalue{ln:c:\currentlinenumbering}\relax} \def\mksetuptextlinenumbering {\ifcsname ln:c:\currentlinenumbering\endcsname @@ -101,7 +101,7 @@ \fi} \def\mkstoptextlinenumbering - {\doresetattribute{line-number}} + {\attribute\linenumberattribute\attributeunsetvalue} % we could make this a bit more efficient by putting the end reference % in the same table as the start one but why make things complex ... @@ -111,7 +111,7 @@ \def\mksomelinereference#1#2#3% {\dontleavehmode\begingroup \global\advance\linerefcounter\plusone - \dosetattribute{line-reference}\linerefcounter + \attribute\linereferenceattribute\linerefcounter #3% % for the moment we use a simple system i.e. no prefixes etc .. todo: store as number \expanded{\dodosetreference{line}{#2}{conversion=\linenumberparameter\c!conversion}{\the\linerefcounter}}% kind labels userdata text @@ -458,10 +458,10 @@ \def\mkstarttextlinenumbering#1#2% {\ctxlua{nodes.lines.flowed.prepare("#1")}% - \dosetattribute{line-number}{#2}} + \attribute\linenumberattribute#2\relax} \def\mkstoptextlinenumbering - {\doresetattribute{line-number}} + {\attribute\linenumberattribute\attributeunsetvalue} \def\mkmaketextlinenumber#1#2% {\hbox \bgroup diff --git a/tex/context/base/page-mis.mkiv b/tex/context/base/page-mis.mkiv index a620835e4..14a35fb70 100644 --- a/tex/context/base/page-mis.mkiv +++ b/tex/context/base/page-mis.mkiv @@ -15,18 +15,18 @@ \unprotect -\newif\ifmargeblokken +\newif\ifmarginblocks \def\dosetupmarginblocks[#1]% {\getparameters[\??mb][#1]% \doifelse\@@mbstate\v!start {\showmessage\m!layouts4\empty - \margeblokkentrue + \marginblockstrue \let\somenextfloat\dosomenextfloat \let\startmarginblock\dostartmarginblock \let\stopmarginblock\dostopmarginblock}% {\showmessage\m!layouts5\empty - \margeblokkenfalse + \marginblocksfalse \def\somenextfloat[##1]% {\someelsefloat[##1,\v!here]}% \let\startmarginblock\dontstartmargeblok @@ -64,16 +64,16 @@ \@@mbbottom}% \fi} -\def\plaatsrechtermargeblok +\def\placerightmarginblock {\hskip\rightmarginwidth} -\def\plaatslinkermargeblok +\def\placeleftmarginblock {\hskip\leftmarginwidth} -\def\checkmargeblokken - {\ifvoid\marginbox\else\docheckmargeblokken\fi} +\def\checkmarginblocks + {\ifvoid\marginbox\else\docheckmarginblocks\fi} -\def\docheckmargeblokken % erg inefficient +\def\docheckmarginblocks % erg inefficient {\setbox\preparedmarginbox\vbox {\forgetall \splittopskip\topskip @@ -134,7 +134,7 @@ \egroup \@@mbafter} -\newcounter\nofpostponedblocks +\newcount\nofpostponedblocks \newif\ifinpostponing @@ -159,66 +159,77 @@ % % \starttext \dorecurse{4}{\input tufte \page} \stoptext -\newtoks \postponedpageblocks -\newcounter\nofpostponedpageblocks +\newtoks \postponedpageblocks +\newcount \nofpostponedpageblocks % \ifinpostponing: handhaven, want gebruikt in stijlen ! ! ! ! ! -\def\flushpagefloats - {\doifoddpageelse - {\ifvoid\collectedleftpagefloats - \ifvoid\collectedrightpagefloats\else - \unvbox\collectedrightpagefloats - \page - %\the\everytopofpage - \fi - \fi} - {\ifvoid\collectedleftpagefloats\else - \unvbox\collectedleftpagefloats +\def\doflushoddpagefloats + {\ifvoid\collectedleftpagefloats + \ifvoid\collectedrightpagefloats\else + \unvbox\collectedrightpagefloats \page %\the\everytopofpage - \fi - \ifvoid\collectedrightpagefloats\else - \unvbox\collectedrightpagefloats - \page - %\the\everytopofpage - \fi}% - \ifvoid\collectedpagefloats\else + \fi + \fi} + +\def\doflushevenpagefloats + {\ifvoid\collectedleftpagefloats\else + \unvbox\collectedleftpagefloats + \page + %\the\everytopofpage + \fi + \ifvoid\collectedrightpagefloats\else + \unvbox\collectedrightpagefloats + \page + %\the\everytopofpage + \fi} + +\def\doflushcommonpagefloats + {\ifvoid\collectedpagefloats\else % message \unvbox\collectedpagefloats \fi} +\def\doflushpagefloats + {\doifoddpageelse + \doflushoddpagefloats + \doflushevenpagefloats + \doflushcommonpagefloats} + % \def\flushrestfloats % {\doif{\floatsharedparameter\c!cache}\v!no\doflushfloats} % \let\flushrestfloats\relax -\def\dopostponeblock - {\bgroup % new may 2004 - \setsystemmode\v!postponing % new may 2004 +\def\dodoflushpostponedblocks + {\bgroup % we need the font switch, else problems inside split verbatim + \setnormalcatcodes % postponing in verbatim + \restoreglobalbodyfont + \global\pagetotal\zeropoint + \global\inpostponingtrue + \the\postponedpageblocks + \dorecurse\nofpostponedblocks + {\getbuffer[pbuf-\recurselevel]}% + \doflushfloats % new but potential dangerous + \global\nofpostponedblocks\zerocount + \global\inpostponingfalse + \egroup} + +\def\doflushpostponedblocks + {\ifinpostponing \else + \ifcase\nofpostponedblocks \else \dodoflushpostponedblocks \fi + \ifcase\nofpostponedpageblocks \else \dodoflushpostponedblocks \fi + \fi} + +\def\doflushpostponedcontent + {\bgroup + \setsystemmode\v!postponing \the\everytopofpage %\flushrestfloats - \flushpagefloats - \donefalse - \ifinpostponing \else - \ifcase\nofpostponedblocks \else \donetrue \fi - \ifcase\nofpostponedpageblocks \else \donetrue \fi - \fi - \ifdone - \bgroup % we need the color/font switch, else problems inside split verbatim - \setnormalcatcodes % postponing in verbatim - \restoreglobalbodyfont % The \nof-test is - \global\pagetotal\zeropoint % recently added and - \global\inpostponingtrue % definitely needed else - \the\postponedpageblocks % we can loose or disorder - \dorecurse\nofpostponedblocks % floats; anyhow, this - {\getbuffer[pbuf-\recurselevel]}% % mechanism is still - \doflushfloats % new but potential dangerous % suboptimal and needs a - \doglobal\newcounter\nofpostponedblocks % proper analysis - \global\inpostponingfalse - \egroup - \fi - \egroup} % new may 2004 + \doflushpagefloats + \doflushpostponedblocks + \egroup} \def\getpostponedblock#1#2% {\doif{#1}\realfolio{\getbuffer[rbuf-#2]}} % no \ifnum, avoid \fi @@ -231,20 +242,20 @@ \doifnextoptionalelse{\egroup\nodostartpostponing}{\egroup\dodostartpostponing}} \def\nodostartpostponing[#1]% - {\doglobal\increment\nofpostponedpageblocks + {\global\advance\nofpostponedpageblocks\plusone % hm, never reset? \bgroup % a little bit of misusing grouping \doifinstring{+}{#1}\advance \realpageno#1\relax % ugly but efficient \doglobal\appendetoks\noexpand\getpostponedblock - {\realfolio}{\nofpostponedpageblocks}\to\postponedpageblocks + {\realfolio}{\number\nofpostponedpageblocks}\to\postponedpageblocks \egroup - \showmessage\m!layouts3\nofpostponedpageblocks - \dostartbuffer[rbuf-\nofpostponedpageblocks]% + \showmessage\m!layouts3{\number\nofpostponedpageblocks}% + \dostartbuffer[rbuf-\number\nofpostponedpageblocks]% [\e!start\v!postponing][\e!stop\v!postponing]} \def\dodostartpostponing - {\doglobal\increment\nofpostponedblocks - \showmessage\m!layouts3\nofpostponedblocks - \expanded{\dostartbuffer[pbuf-\nofpostponedblocks][\e!start\v!postponing][\e!stop\v!postponing]}} + {\global\advance\nofpostponedblocks\plusone + \showmessage\m!layouts3{\number\nofpostponedblocks}% + \expanded{\dostartbuffer[pbuf-\number\nofpostponedblocks][\e!start\v!postponing][\e!stop\v!postponing]}} % Setups: diff --git a/tex/context/base/page-txt.mkiv b/tex/context/base/page-txt.mkiv index 9d5faa9f5..5cdc0cf5c 100644 --- a/tex/context/base/page-txt.mkiv +++ b/tex/context/base/page-txt.mkiv @@ -689,13 +689,8 @@ %D This code will move to \type {page-flt.tex}. -\appendtoks - \plaatsrechtermargeblok \hskip-\rightmarginwidth -\to \rightmargintextcontent - -\appendtoks - \plaatslinkermargeblok \hskip-\leftmarginwidth -\to \leftmargintextcontent +\appendtoks \placerightmarginblock \hskip-\rightmarginwidth \to \rightmargintextcontent +\appendtoks \placeleftmarginblock \hskip-\leftmarginwidth \to \leftmargintextcontent %D The next hook will later be used for keeping track of %D positions, i.e.\ it will provide a proper (page diff --git a/tex/context/base/scrp-ini.mkiv b/tex/context/base/scrp-ini.mkiv index 3382ef4b6..0d0c2c125 100644 --- a/tex/context/base/scrp-ini.mkiv +++ b/tex/context/base/scrp-ini.mkiv @@ -16,8 +16,8 @@ \registerctxluafile{scrp-ini}{1.001} \registerctxluafile{scrp-cjk}{1.001} -\definesystemattribute[preproc] -\definesystemattribute[prestat] +\definesystemattribute[preproc] \chardef\preprocattribute \dogetattributeid{preproc} +\definesystemattribute[prestat] \chardef\prestatattribute \dogetattributeid{prestat} %D Since scripts need specific \LUA\ code we use hard coded attribute %D values, but we might have more tricks at some time, so we use a @@ -73,9 +73,9 @@ \edef\currentscriptattribute{\scriptparameter\s!attribute}% \ifx\currentscriptattribute\empty \let\currentscript\empty - \doresetattribute{preproc}% + \attribute\preprocattribute\attributeunsetvalue \else - \dosetattribute{preproc}\currentscriptattribute % we can speed this up by storing the attribute in ??ls:a:#1 + \attribute\preprocattribute\currentscriptattribute\relax % we can speed this up by storing the attribute in ??ls:a:#1 \fi} \def\setscript [#1]{\dosetscript{#1}} diff --git a/tex/context/base/spac-ver.mkiv b/tex/context/base/spac-ver.mkiv index b0e2603f3..8c89c945b 100644 --- a/tex/context/base/spac-ver.mkiv +++ b/tex/context/base/spac-ver.mkiv @@ -1198,11 +1198,11 @@ \definesystemattribute[skip-category] \chardef\skipcategoryattribute \dogetattributeid{skip-category} \definesystemattribute[skip-penalty] \chardef\skippenaltyattribute \dogetattributeid{skip-penalty} \definesystemattribute[skip-order] \chardef\skiporderattribute \dogetattributeid{skip-order} -\definesystemattribute[display-math] +\definesystemattribute[display-math] \chardef\displaymathattribute \dogetattributeid{display-math} \definesystemattribute[snap-method] \chardef\snapmethodattribute \dogetattributeid{snap-method} \definesystemattribute[snap-done] \chardef\snapdoneattribute \dogetattributeid{snap-done} -%definesystemattribute[snap-category] +%definesystemattribute[snap-category] \chardef\snapcategoryattribute \dogetattributeid{snap-category} % TODO: NAMED SNAPPERS @@ -1223,7 +1223,7 @@ \ifcsname\currentsnapper\endcsname \else \setevalue\currentsnapper{\ctxlua{vspacing.define_snap_method("#1","#2")}}% \fi - \setevalue{\??gr:#1}{\dosetattribute{snap-method}{\csname\currentsnapper\endcsname}}} + \setevalue{\??gr:#1}{\attribute\snapmethodattribute\csname\currentsnapper\endcsname\space}} \def\definegridsnapping {\dodoubleargument\dodefinegridsnapping} @@ -1233,7 +1233,7 @@ \edef\resetsnapvalue {%\gridsnappingfalse - \doresetattribute{snap-method}} + \attribute\snapmethodattribute\attributeunsetvalue} \def\setsnapvalue#1% {%\gridsnappingtrue @@ -1484,12 +1484,12 @@ % {\ctxlua{nodes.setsnapvalue(1,\number\openstrutheight,\number\openstrutdepth)}} % % \def\doenablegridsnapping -% {\dosetattribute{snap-category}{1}% +% {\attribute\snapcategoryattribute\plusone % \topskip\strutht % \offinterlineskip} % % \def\dodisablegridsnapping -% {\doresetattribute{snap-category}% +% {\attribute\snapcategoryattribute\attributeunsetvalue % % reset topskip % \oninterlineskip} @@ -1865,54 +1865,3 @@ {\endgraf\dorecurse{\iffirstargument#1\else3\fi}\crlf} \protect \endinput - -\dorecurse{2}{ - $2^{2^{2^{2}}}$ $2_{2_{2_{2}}}^{2^{2^{2^{2^{2^{2^{2^{2^{2}}}}}}}}}$ - \input tufte \inframed {tufte} - \par -} - -\dorecurse{100} { - - \kern \recurselevel pt - - \vbox { - \endgraf \strut first \endgraf - {\dosetattribute{skip-category}{1}\vskip10pt} - {\dosetattribute{skip-category}{1}\vskip40pt} - {\dosetattribute{skip-category}{1}\vskip20pt} - {\dosetattribute{skip-category}{2}\vskip10pt} - \endgraf \strut second \endgraf - } - - \endgraf \strut first \endgraf - {\dosetattribute{skip-category}{1}\vskip10pt} - {\dosetattribute{skip-category}{1}\vskip40pt} - {\dosetattribute{skip-category}{1}\vskip20pt} - {\dosetattribute{skip-category}{1}\vskip40pt} - \endgraf \strut second \endgraf - - {\dosetattribute{skip-category}{0}\vskip10pt} % remove - {\dosetattribute{skip-category}{1}\vskip10pt} % take largest - {\dosetattribute{skip-category}{1}\vskip40pt} - {\dosetattribute{skip-category}{1}\vskip40pt} - {\dosetattribute{skip-category}{1}\vskip40pt} - {\dosetattribute{skip-category}{1}\vskip40pt} - {\dosetattribute{skip-category}{1}\vskip40pt} - {\dosetattribute{skip-category}{1}\dosetattribute{skip-order}{10}\vskip20pt} - {\dosetattribute{skip-category}{4}\dosetattribute{skip-order}{10}\vskip20pt} - {\dosetattribute{skip-category}{1}\vskip60pt} - {\dosetattribute{skip-category}{1}\vskip20pt} - {\dosetattribute{skip-category}{0}\vskip10pt} - - third (no break after this) - - {\dosetattribute{skip-category}{1}\dosetattribute{skip-penalty}{100000}\vskip10pt} - {\dosetattribute{skip-category}{1}\dosetattribute{skip-penalty}{100000}\vskip20pt} - {\dosetattribute{skip-category}{1}\vskip10pt} - {\dosetattribute{skip-category}{1}\vskip20pt} - - fourth - \vskip10pt - fifth -} diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv index a6258dd22..f50688a69 100644 --- a/tex/context/base/strc-des.mkiv +++ b/tex/context/base/strc-des.mkiv @@ -515,7 +515,7 @@ {\iftrialtypesetting \else \begingroup \currentdescriptionsynchronize - \dosetattribute{destination}\currentdescriptionattribute % todo, whole text + \attribute\destinationattribute\currentdescriptionattribute\relax % todo, whole text \forcecolorhack \endgroup \fi#1} diff --git a/tex/context/base/strc-flt.mkiv b/tex/context/base/strc-flt.mkiv index d826b067e..046045355 100644 --- a/tex/context/base/strc-flt.mkiv +++ b/tex/context/base/strc-flt.mkiv @@ -604,12 +604,12 @@ {\normalexpanded{\noexpand\doifcommonelse{#2}{\flushfloatslist}}\doflushfloats\donothing}% % but which should be done before using box \floatbox \fi - \ifmargeblokken + \ifmarginblocks \doifinset\v!margin{#2}\endgraf \fi \global\insidefloattrue \begingroup % ** - \ifmargeblokken + \ifmarginblocks \doifinset\v!margin{#2}{\hsize\@@mbwidth}% \fi \the\everyinsidefloat diff --git a/tex/context/base/strc-itm.mkiv b/tex/context/base/strc-itm.mkiv index bb3a785ce..a67321e63 100644 --- a/tex/context/base/strc-itm.mkiv +++ b/tex/context/base/strc-itm.mkiv @@ -102,7 +102,7 @@ }) }% \xdef\currentitemattribute{\number\lastdestinationattribute}% - \begingroup\dosetattribute{destination}\currentitemattribute\kern\zeropoint\endgroup % todo + \begingroup\attribute\destinationattribute\currentitemattribute\kern\zeropoint\endgroup % todo \fi} diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua index 8cd4b2cbc..b21b6e524 100644 --- a/tex/context/base/strc-ref.lua +++ b/tex/context/base/strc-ref.lua @@ -900,8 +900,9 @@ function jobreferences.filter(name,...) -- number page title ... local filter = filters[kind] or filters.generic filter = filter and (filter[name] or filter.unknown or filters.generic[name] or filters.generic.unknown) if filter then - logs.report("referencing","name '%s', kind '%s', using dedicated filter",name,kind) ---~ print(table.serialize {...}) + if trace_referencing then + logs.report("referencing","name '%s', kind '%s', using dedicated filter",name,kind) + end filter(data,name,...) elseif trace_referencing then logs.report("referencing","name '%s', kind '%s', using generic filter",name,kind) diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv index 71dd8f6b8..a50c7d714 100644 --- a/tex/context/base/strc-ref.mkiv +++ b/tex/context/base/strc-ref.mkiv @@ -160,7 +160,7 @@ },"\@@iafocus") }% \xdef\currentdestinationattribute{\number\lastdestinationattribute}% - \begingroup\dosetattribute{destination}\currentdestinationattribute\hbox{}\endgroup % todo + \begingroup\attribute\destinationattribute\currentdestinationattribute\hbox{}\endgroup % todo \fi \fi} @@ -525,7 +525,7 @@ {\global\advance\locationcount\plusone} \def\thisissomeinternal#1#2% tag reference (only for old time sake) - {\begingroup\dosetattribute{destination}{\ctxlua{jobreferences.mark("#1:#2")}}\hbox{}\endgroup} + {\begingroup\attribute\destinationattribute\ctxlua{jobreferences.mark("#1:#2")}\hbox{}\endgroup} \def\gotosomeinternal#1#2#3#4% {\ifinternalnamedreferences diff --git a/tex/context/base/tabl-tbl.mkii b/tex/context/base/tabl-tbl.mkii index eafb41d47..09fa4105c 100644 --- a/tex/context/base/tabl-tbl.mkii +++ b/tex/context/base/tabl-tbl.mkii @@ -1222,7 +1222,7 @@ \ifnum\noftabulatelines>\plusone \ifnum\noftabulatelines<\minusnoftabulatelines % \vskip \topskip\allowbreak \vskip-\topskip - \vskip1\topskip\allowbreak1\vskip-\topskip + \vskip1\topskip\allowbreak\vskip-1\topskip \vskip-\tabulateparameter\c!rulethickness \dotabulaterule \fi diff --git a/tex/context/base/typo-brk.mkiv b/tex/context/base/typo-brk.mkiv index f53e44810..e63232087 100644 --- a/tex/context/base/typo-brk.mkiv +++ b/tex/context/base/typo-brk.mkiv @@ -17,7 +17,7 @@ \registerctxluafile{typo-brk}{1.001} -\definesystemattribute[breakpoint] +\definesystemattribute[breakpoint] \chardef\breakpointattribute \dogetattributeid{breakpoint} % compound stuff (under construction) @@ -53,7 +53,7 @@ \def\setbreakpoints {\ctxlua{breakpoints.enable()}% - \gdef\setbreakpoints[##1]{\dosetattribute{breakpoint}{\csname\??bp:##1\endcsname}}% + \gdef\setbreakpoints[##1]{\attribute\breakpointattribute\csname\??bp:##1\endcsname\relax}% \setbreakpoints} \letvalue{\??bp:\s!reset}\attributeunsetvalue diff --git a/tex/context/base/typo-cap.mkiv b/tex/context/base/typo-cap.mkiv index 40885d6c2..bc4b9a00c 100644 --- a/tex/context/base/typo-cap.mkiv +++ b/tex/context/base/typo-cap.mkiv @@ -17,7 +17,7 @@ \registerctxluafile{typo-cap}{1.001} -\definesystemattribute[case] +\definesystemattribute[case] \chardef\caseattribute \dogetattributeid{case} %D \macros %D {Word, Words, WORD, WORDS} @@ -53,7 +53,7 @@ \unexpanded\def\setcharactercasing {\ctxlua{cases.enable()}% - \gdef\setcharactercasing[##1]{\dosetattribute{case}{\number##1}}% + \gdef\setcharactercasing[##1]{\attribute\caseattribute##1\relax}% \setcharactercasing} \unexpanded\def\WORD {\groupedcommand{\setcharactercasing[\plusone ]}{}} @@ -199,6 +199,8 @@ % % \definestartstop[randomized][\c!before=\dosetattribute{case}{8},\c!after=] -\def\randomizetext{\groupedcommand{\dosetattribute{case}{8}}{}} +\def\randomizetext{\groupedcommand{\attribute\caseattribute\pluseight}{}} + +\definestartstop[randomized][\c!before=\dosetattribute{case}{8},\c!after=] \protect \endinput diff --git a/tex/context/base/typo-krn.mkiv b/tex/context/base/typo-krn.mkiv index 43f65021b..88b66ae45 100644 --- a/tex/context/base/typo-krn.mkiv +++ b/tex/context/base/typo-krn.mkiv @@ -17,7 +17,7 @@ \registerctxluafile{typo-krn}{1.001} -\definesystemattribute[kern] +\definesystemattribute[kern] \chardef\kernattribute \dogetattributeid{kern} % more % @@ -47,7 +47,7 @@ \def\setcharacterkerning {\ctxlua{kerns.enable()}% - \gdef\setcharacterkerning[##1]{\dosetattribute{kern}{\csname\??ck:##1\endcsname}}% + \gdef\setcharacterkerning[##1]{\attribute\kernattribute\csname\??ck:##1\endcsname\relax}% \setcharacterkerning} \letvalue{\??ck:\s!reset}\attributeunsetvalue diff --git a/tex/context/base/typo-mir.mkiv b/tex/context/base/typo-mir.mkiv index 7edd207ae..708befbf3 100644 --- a/tex/context/base/typo-mir.mkiv +++ b/tex/context/base/typo-mir.mkiv @@ -17,17 +17,17 @@ \registerctxluafile{typo-mir}{1.001} -\definesystemattribute[mirroring] +\definesystemattribute[mirroring] \chardef\mirroringattribute \dogetattributeid{mirroring} % experimental mirroring \def\setcharactermirroring {\ctxlua{mirroring.enable()}% - \gdef\setcharactermirroring[##1]{\dosetattribute{mirroring}{\number##1}}% + \gdef\setcharactermirroring[##1]{\attribute\mirroringattribute##1\relax}% \setcharactermirroring} \def\resetcharactermirroring - {\doresetattribute{mirroring}} + {\attribute\mirroringattribute\attributeunsetvalue} \newtoks\everysetupdirections diff --git a/tex/context/base/typo-spa.mkiv b/tex/context/base/typo-spa.mkiv index 6bb126351..e73638af4 100644 --- a/tex/context/base/typo-spa.mkiv +++ b/tex/context/base/typo-spa.mkiv @@ -17,7 +17,7 @@ \registerctxluafile{typo-spa}{1.001} -\definesystemattribute[spacing] +\definesystemattribute[spacing] \chardef\spacingattribute \dogetattributeid{spacing} % experimental spacing % @@ -44,11 +44,11 @@ \def\setcharacterspacing {\ctxlua{spacings.enable()}% - \gdef\setcharacterspacing[##1]{\dosetattribute{spacing}{\csname\??ch:##1\endcsname}}% + \gdef\setcharacterspacing[##1]{\attribute\spacingattribute\csname\??ch:##1\endcsname\relax}% \setcharacterspacing} \def\resetcharacterspacing - {\doresetattribute{spacing}} + {\attribute\spacingattribute\attributeunsetvalue} \letvalue{\??ch:\s!reset}\attributeunsetvalue diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index a709be033..56c7c59d5 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua --- merge date : 01/05/10 16:51:52 +-- merge date : 01/09/10 00:02:29 do -- begin closure to overcome local limits and interference @@ -6518,13 +6518,15 @@ otf.enhancers["reorganize kerns"] = function(data,filename) local offset = offsets[baseoffset + sk] --~ local offset = offsets[sk] -- (fk-1) * maxseconds + sk] local splt = split[sv] - for i=1,#splt do - local second_unicode = splt[i] - if tonumber(second_unicode) then - lookupkerns[second_unicode] = offset - else - for s=1,#second_unicode do - lookupkerns[second_unicode[s]] = offset + if splt then + for i=1,#splt do + local second_unicode = splt[i] + if tonumber(second_unicode) then + lookupkerns[second_unicode] = offset + else + for s=1,#second_unicode do + lookupkerns[second_unicode[s]] = offset + end end end end @@ -6536,13 +6538,15 @@ otf.enhancers["reorganize kerns"] = function(data,filename) for fk=1,#firsts do local fv = firsts[fk] local splt = split[fv] - for i=1,#splt do - local first_unicode = splt[i] - if tonumber(first_unicode) then - do_it(fk,first_unicode) - else - for f=1,#first_unicode do - do_it(fk,first_unicode[f]) + if splt then + for i=1,#splt do + local first_unicode = splt[i] + if tonumber(first_unicode) then + do_it(fk,first_unicode) + else + for f=1,#first_unicode do + do_it(fk,first_unicode[f]) + end end end end diff --git a/tex/generic/context/luatex-mplib.lua b/tex/generic/context/luatex-mplib.lua index 259a5e646..0afad083a 100644 --- a/tex/generic/context/luatex-mplib.lua +++ b/tex/generic/context/luatex-mplib.lua @@ -320,7 +320,7 @@ else metapost.report("flushing figure %s",f) local figure = figures[f] local objects = getobjects(result,figure,f) - local fignum = match(tonumber((figure:filename())),"([%d]+)$") or figure:charcode() or 0) + local fignum = tonumber(match(figure:filename(),"([%d]+)$") or figure:charcode() or 0) local miterlimit, linecap, linejoin, dashed = -1, -1, -1, false local bbox = figure:boundingbox() local llx, lly, urx, ury = bbox[1], bbox[2], bbox[3], bbox[4] -- faster than unpack |