diff options
Diffstat (limited to 'tex/context/base')
136 files changed, 950 insertions, 972 deletions
diff --git a/tex/context/base/anch-bar.mkiv b/tex/context/base/anch-bar.mkiv index f914976b2..1013e7609 100644 --- a/tex/context/base/anch-bar.mkiv +++ b/tex/context/base/anch-bar.mkiv @@ -56,7 +56,7 @@ \newcount\currentsidebar \newdimen\sidebardistance -\def\setupsidebars +\unexpanded\def\setupsidebars {\dodoubleargument\dosetupsidebars} \def\dosetupsidebars[#1][#2]% @@ -77,7 +77,7 @@ \c!rulecolor=red, \c!distance=.5\bodyfontsize] -\def\definesidebar +\unexpanded\def\definesidebar {\dodoubleempty\dodefinesidebar} \def\dodefinesidebar[#1][#2]% @@ -87,7 +87,7 @@ \getparameters [\??br#1][#2]} -\def\startsidebar +\unexpanded\def\startsidebar {\dosingleempty\dostartsidebar} \def\dostartsidebar[#1]% @@ -115,7 +115,7 @@ % \def\dostopsidebar#1% % {\removelastspace\tpos{side:#1}\carryoverpar\egroup} -\def\stopsidebar +\unexpanded\def\stopsidebar {\removelastspace\tpos{side:\the\currentsidebar}\carryoverpar\egroup} \startMPpositionmethod{mpos:bar} diff --git a/tex/context/base/anch-pgr.mkiv b/tex/context/base/anch-pgr.mkiv index 19a44d687..248b9ca5e 100644 --- a/tex/context/base/anch-pgr.mkiv +++ b/tex/context/base/anch-pgr.mkiv @@ -76,7 +76,7 @@ \fi \fi\fi} -\def\placepositionanchors % todo : depth pagebox +\unexpanded\def\placepositionanchors % todo : depth pagebox {\ifpositioning \setbox\scratchbox\vbox to \textheight {\simpletopskipcorrection @@ -145,7 +145,7 @@ % obsolete and wrong anyway % -% \long\def\defineMPpositiongraphic#1% +% \long\unexpanded\def\defineMPpositiongraphic#1% % {\long\setvalue{\MPoverlayposprefix#1}} %D The rest of the definitions concerning such overlays may @@ -180,14 +180,14 @@ \vfill}% \fi} -\def\startpositionoverlay#1% +\unexpanded\def\startpositionoverlay#1% {\iftrialtypesetting % we don't want redundant entries in the list \@EA\gobbleuntil\@EA\stoppositionoverlay \else \def\currentpositionoverlay{#1}% \fi} -\def\stoppositionoverlay +\unexpanded\def\stoppositionoverlay {\let\currentpositionoverlay\empty} \def\resetpositionoverlay#1% @@ -741,15 +741,15 @@ lineradius=\textbackgroundparameter\c!radius}}% \stoppositionoverlay} -\def\stoptextbackground +\unexpanded\def\stoptextbackground {\dodostoptextbackground \carryoverpar\egroup} -\def\starttextbackgroundmanual +\unexpanded\def\starttextbackgroundmanual {\dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty \fpos\currentparbackground\ignorespaces} -\def\stoptextbackgroundmanual +\unexpanded\def\stoptextbackgroundmanual {\tpos\currentparbackground \dostopattributes} @@ -937,7 +937,7 @@ \fi \fi} -\def\definetextbackground +\unexpanded\def\definetextbackground {\dodoubleempty\dodefinetextbackground} \def\dodefinetextbackground[#1][#2]% parent and ..parameter @@ -956,7 +956,7 @@ \setvalue{\e!stop #1}{\stoptextbackground}% \fi} -\def\setuptextbackground +\unexpanded\def\setuptextbackground {\dodoubleargument\dosetuptextbackground} \def\dosetuptextbackground[#1][#2]% @@ -1636,7 +1636,7 @@ \copyposition{e:#1}{e:#2}% \dosetpositionaction{b:#2}{\dopositionaction{b:#1}}} -\def\definepositionframed +\unexpanded\def\definepositionframed {\dodoubleargument\dodefinepositionframed} \def\dodefinepositionframed[#1][#2]% diff --git a/tex/context/base/anch-snc.mkiv b/tex/context/base/anch-snc.mkiv index 1f3610111..f976047c9 100644 --- a/tex/context/base/anch-snc.mkiv +++ b/tex/context/base/anch-snc.mkiv @@ -22,7 +22,7 @@ \ifx\s!preset \undefined \def\s!preset {preset} \fi \ifx\s!syncpos\undefined \def\s!syncpos{syncpos} \fi -\def\definesyncpositions[#1]% +\unexpanded\def\definesyncpositions[#1]% {\global\let\flushsyncpositions\doflushsyncpositions % only when used \setcounter{\s!num:\s!syncpos:#1}{0}% \doglobal\appendtoksonce\csname\s!reset :\s!syncpos:#1\endcsname\to\resetsyncpositions diff --git a/tex/context/base/back-ini.mkiv b/tex/context/base/back-ini.mkiv index 07e9147f2..b7bbdb56f 100644 --- a/tex/context/base/back-ini.mkiv +++ b/tex/context/base/back-ini.mkiv @@ -163,6 +163,6 @@ \edef\jobsuffix{#1}% \setsystemmode\jobsuffix} -\def\setupoutput[#1]{} % will be command line switch +\unexpanded\def\setupoutput[#1]{} % will be command line switch \protect \endinput diff --git a/tex/context/base/bibl-bib.mkiv b/tex/context/base/bibl-bib.mkiv index eaa47efad..10abe5cb8 100644 --- a/tex/context/base/bibl-bib.mkiv +++ b/tex/context/base/bibl-bib.mkiv @@ -118,9 +118,9 @@ \newtoks \everysetupbibtexsession \setfalse \tracebibtexformat -\def\definebibtexsession {\dosingleargument\dodefinebibtexsession} +\unexpanded\def\definebibtexsession {\dosingleargument\dodefinebibtexsession} \def\preparebibtexsession {\dodoubleempty \dopreparebibtexsession} -\def\setupbibtexsession {\dodoubleargument\dosetupbibtexsession} +\unexpanded\def\setupbibtexsession {\dodoubleargument\dosetupbibtexsession} \def\dodefinebibtexsession [#1]{\edef\currentbibtexsession{#1}% \ctxlua{commands.definebibtexsession("#1")}% @@ -321,7 +321,7 @@ % [\c!sorttype=\v!cite, % \c!sort=no] -% \long\def\startpublication#1\stoppublication +% \long\unexpanded\def\startpublication#1\stoppublication % {\blank % todo % \blank} @@ -389,22 +389,22 @@ % setup commands -\def\setupbibtexpublications +\unexpanded\def\setupbibtexpublications {\let\currentpublicationclass\??pb \let\everysetupbibtexwhatever\everysetupbibtexpublications \dodoubleargument\dosetupbibtexwhatever} -\def\setupbibtexcitations +\unexpanded\def\setupbibtexcitations {\let\currentpublicationclass\??pv \let\everysetupbibtexwhatever\everysetupbibtexcitations \dodoubleargument\dosetupbibtexwhatever} -\def\setupbibtexpublicationvariants +\unexpanded\def\setupbibtexpublicationvariants {\let\currentpublicationclass\??pb \let\everysetupbibtexwhatever\everysetupbibtexpublications \dotripleargument\dosetupbibtexwhatevervariant} -\def\setupbibtexcitationvariants +\unexpanded\def\setupbibtexcitationvariants {\let\currentpublicationclass\??pv \let\everysetupbibtexwhatever\everysetupbibtexcitations \dotripleargument\dosetupbibtexwhatevervariant} @@ -515,7 +515,7 @@ \to \everysetupbibtexlistplacement \def\completebibtexpublications{\dodoubleempty\docompletebibtexpublications} -\def\placebibtexpublications {\dodoubleempty\doplacebibtexpublications} +\unexpanded\def\placebibtexpublications {\dodoubleempty\doplacebibtexpublications} \def\docompletebibtexpublications[#1][#2]% title might become obsolete, just headtext {\begingroup diff --git a/tex/context/base/bibl-tra.lua b/tex/context/base/bibl-tra.lua index baf99f28f..442231028 100644 --- a/tex/context/base/bibl-tra.lua +++ b/tex/context/base/bibl-tra.lua @@ -114,7 +114,7 @@ function hacks.resolve(prefix,block,reference) -- maybe already feed it split if subset then local result, done = { }, { } block = tonumber(block) - for rest in gmatch(reference,"([^,]+)") do + for rest in gmatch(reference,"([^,%s]+)") do local blk, tag, found = block, nil, nil if block then tag = blk .. ":" .. rest diff --git a/tex/context/base/bibl-tra.mkiv b/tex/context/base/bibl-tra.mkiv index 2d539da5f..519af0c6f 100644 --- a/tex/context/base/bibl-tra.mkiv +++ b/tex/context/base/bibl-tra.mkiv @@ -241,7 +241,7 @@ \newtoks\everysetupbibtex -\def\setupbibtex +\unexpanded\def\setupbibtex {\dosingleempty\dosetupbibtex} \def\dosetupbibtex[#1]% @@ -277,7 +277,7 @@ \newtoks\everysetuppublications -\def\setuppublications +\unexpanded\def\setuppublications {\dosingleargument\dosetuppublications} \def\dosetuppublications[#1]% @@ -382,14 +382,14 @@ \def\publicationlistparameter#1{\csname\??pv:l:#1\endcsname} -\def\setuppublicationlist +\unexpanded\def\setuppublicationlist {\dosingleempty\dosetuppublicationlist} \def\dosetuppublicationlist[#1]% {\getparameters[\??pv:l:][#1]% \setuplist[pubs][\c!samplesize={AA99},\c!alternative=a,\c!interaction=,\c!pagenumber=\v!no,#1,\c!command=]} -\def\setuppublicationlayout[#1]#2% +\unexpanded\def\setuppublicationlayout[#1]#2% {\setvalue{\??pv:l:#1}{#2}} \let\normalsetuppublicationlayout\setuppublicationlayout @@ -694,7 +694,7 @@ % \exitloop % \fi}} -\def\clearbibitemtwo#1% is this reset really needed? after all we reset the counter adn we are local +\def\clearbibitemtwo#1% is this reset really needed? after all we reset the counter and we are local {%\dofastrecurse\plusone{\csname#1@num\endcsname}\plusone{\expandafter\let\csname\??pb @#1\recurselevel\undefined}% \letvalue{#1@num}\!!zerocount} @@ -733,7 +733,7 @@ %D %D Now prohibits comments, so % can be used for urls -\def\startpublication +\unexpanded\def\startpublication {\begingroup \catcode`\%=\othercatcode \dosingleempty\dostartpublication} @@ -881,7 +881,7 @@ \def\bibrefprefix{\number\bibtexblock:} -\def\placepublications +\unexpanded\def\placepublications {\dosingleempty\doplacepublications} \def\doplacepublications[#1]% @@ -1038,7 +1038,7 @@ %D \macros{setupcite} -\def\setupcite{\dodoubleempty\dosetupcite} +\unexpanded\def\setupcite{\dodoubleempty\dosetupcite} \def\dosetupcite[#1][#2]% {\ifsecondargument diff --git a/tex/context/base/buff-ini.mkiv b/tex/context/base/buff-ini.mkiv index c27c77b18..86b0fa3c5 100644 --- a/tex/context/base/buff-ini.mkiv +++ b/tex/context/base/buff-ini.mkiv @@ -146,7 +146,7 @@ \ctxlua{buffers.set("\currentbuffer", \!!bs\detokenize{#2}\!!es)}% \endgroup} -\def\setupbuffer +\unexpanded\def\setupbuffer {\dodoubleempty\dosetupbuffer} \def\dosetupbuffer[#1][#2]% @@ -167,7 +167,7 @@ \getparameters[\??bu#1][#2]% \fi} -\def\definebuffer +\unexpanded\def\definebuffer {\dodoubleempty\dodefinebuffer} \def\thebuffernumber#1% @@ -275,20 +275,20 @@ \ifsecondargument \dosetbufferoffset{#1}% \doifelse{#2}\v!all - {\def\startbufferparagraph{\normalbufferparagraph{#1}}} - {\def\startbufferparagraph{\filterbufferparagraph{#1}{#2}}}% - \def\stopbufferparagraph{\dostopbufferparagraph{#1}}% + {\unexpanded\def\startbufferparagraph{\normalbufferparagraph{#1}}} + {\unexpanded\def\startbufferparagraph{\filterbufferparagraph{#1}{#2}}}% + \unexpanded\def\stopbufferparagraph{\dostopbufferparagraph{#1}}% \def\next{\getparagraphedbuffer[#1]}% \else \dosetbufferoffset\empty - \def\startbufferparagraph{\filterbufferparagraph{}{#1}}% - \def\stopbufferparagraph{\dostopbufferparagraph{}}% + \unexpanded\def\startbufferparagraph{\filterbufferparagraph{}{#1}}% + \unexpanded\def\stopbufferparagraph{\dostopbufferparagraph{}}% \def\next{\getparagraphedbuffer[]}% \fi \else \dosetbufferoffset\empty - \def\startbufferparagraph{\normalbufferparagraph{}}% - \def\stopbufferparagraph{\dostopbufferparagraph{}}% + \unexpanded\def\startbufferparagraph{\normalbufferparagraph{}}% + \unexpanded\def\stopbufferparagraph{\dostopbufferparagraph{}}% \def\next{\getparagraphedbuffer[]}% \fi \next} @@ -328,7 +328,7 @@ \def\fakebufferparagraph#1% {\bgroup - \def\stopbufferparagraph{\dostopbufferparagraph{#1}\egroup\egroup}% + \unexpanded\def\stopbufferparagraph{\dostopbufferparagraph{#1}\egroup\egroup}% \setbox\scratchbox\vbox\bgroup\dostartbufferparagraph{#1}} % definitions diff --git a/tex/context/base/buff-ver.mkiv b/tex/context/base/buff-ver.mkiv index e80d2e773..dacbdb7ac 100644 --- a/tex/context/base/buff-ver.mkiv +++ b/tex/context/base/buff-ver.mkiv @@ -19,7 +19,7 @@ \ifdefined\startlinenumbering\else \let\startlinenumbering \relax \fi \ifdefined\stoplinenumbering \else \let\stoplinenumbering \relax \fi -\ifdefined\setuplinenumbering\else \def\setuplinenumbering[#1]{} \fi +\ifdefined\setuplinenumbering\else \unexpanded\def\setuplinenumbering[#1]{} \fi % D \macros % D {iflinepar} @@ -66,7 +66,7 @@ \uppercasestring#2\to\asciib \setevalue{\??ty\??ty\asciia}{\asciib}} -\def\setupprettiesintype#1% +\unexpanded\def\setupprettiesintype#1% {\uppercasestring#1\to\ascii \edef\prettyidentifier{\executeifdefined{\??ty\??ty\ascii}{TEX}}% \begingroup @@ -76,7 +76,7 @@ \ctxlua{buffers.loadvisualizer("\ascii")}% \endgroup} -\def\setupprettytype +\unexpanded\def\setupprettytype {\processingverbatimtrue % will move \ctxlua{buffers.visualizers.reset()}} @@ -107,7 +107,7 @@ {\redoconvertfont\dosetfontattribute{\currenttypingclass\currenttyping}\c!style \normalnoligatures\font} -\def\setupcommonverbatim +\unexpanded\def\setupcommonverbatim {\let\prettyidentifier\s!default % \def\prettyidentifierfont{\typingparameter\c!icommand}% @@ -210,14 +210,14 @@ %D %D \typebuffer \start \getbuffer \stop -\def\setupcommandsintype +\unexpanded\def\setupcommandsintype {\ctxlua{buffers.set_escape("\currenttyping",\!!bs\typingparameter\c!escape\!!es)}} \appendtoks \setupcommandsintype \to \everyinitializeverbatim -\def\setupslantedtype +\unexpanded\def\setupslantedtype {\slantedtypepermittedtrue} \ifx\setupprettytype \undefined \let\setupprettytype \relax \fi @@ -408,7 +408,7 @@ %D %D Some characteristics of \type{\type} can be set up by: -\def\setuptype +\unexpanded\def\setuptype {\dodoubleempty\dosetuptype} \def\dosetuptype[#1][#2]% @@ -724,7 +724,7 @@ \getparameters[\??tp][#1]% \fi} -\def\setuptyping +\unexpanded\def\setuptyping {\dodoubleempty\dosetuptyping} %D \macros @@ -733,7 +733,7 @@ %D Specific inline verbatim commands can be defined with the %D following command. -\def\definetype +\unexpanded\def\definetype {\dodoubleempty\dodefinetype} \def\dodefinetype[#1][#2]% @@ -768,7 +768,7 @@ \setvalue{\e!stop #1}{\dostoptyping {#1}}% \presettyping[#1][#2]} -\def\definetyping +\unexpanded\def\definetyping {\dodoubleempty\dodefinetyping} %D We can use some core color commands. These are faster than @@ -776,7 +776,7 @@ %D line basis. %D %D \starttyping -%D \def\setupverbatimcolor% +%D \unexpanded\def\setupverbatimcolor% %D {\edef\prettypalet{\prettyidentifier\typingparameter\c!palet}% %D \def\beginofpretty[##1]{\startcolormode{\prettypalet:##1}}% %D \def\endofpretty {\stopcolormode}} @@ -791,7 +791,7 @@ \def\normalstopverbatimcolor {\stopcolor} \def\normalverbatimcolor {\getvalue{\typingparameter\c!color}}% command ! -\def\setupnormalprettyverbatim +\unexpanded\def\setupnormalprettyverbatim {\edef\prettypalet{\prettyidentifier\prettypalet}% \let\beginofpretty \normalbeginofpretty \let\endofpretty \normalendofpretty @@ -799,7 +799,7 @@ \let\stopverbatimcolor \normalstopverbatimcolor \let\verbatimcolor \normalverbatimcolor} -\def\setupignoreprettyverbatim +\unexpanded\def\setupignoreprettyverbatim {\let\prettypalet \empty \let\beginofpretty \ignorebeginofpretty \let\endofpretty \ignoreendofpretty @@ -807,7 +807,7 @@ \let\stopverbatimcolor \normalstopverbatimcolor \let\verbatimcolor \normalverbatimcolor} -\def\setupverbatimcolor +\unexpanded\def\setupverbatimcolor {\edef\prettypalet{\typingparameter\c!palet}% \ifx\prettypalet\empty \setupignoreprettyverbatim diff --git a/tex/context/base/catc-ini.mkiv b/tex/context/base/catc-ini.mkiv index d7ddfdc3d..269330a1b 100644 --- a/tex/context/base/catc-ini.mkiv +++ b/tex/context/base/catc-ini.mkiv @@ -70,7 +70,7 @@ \catcode`\% \othercatcode \catcode127 \othercatcode} -\long\def\startcatcodetable#1#2\stopcatcodetable +\long\normalprotected\def\startcatcodetable#1#2\stopcatcodetable {\bgroup \catcodetable\scratchcatcodes \the\setdefaultcatcodes @@ -80,7 +80,7 @@ \newcatcodetable\dummycatcodes -\long\def\startextendcatcodetable#1#2\stopextendcatcodetable +\long\normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable {\bgroup \catcodetable#1\relax \globaldefs\plusone @@ -90,7 +90,7 @@ % == % -% \long\def\startextendcatcodetable#1#2\stopextendcatcodetable +% \long\normalprotected\def\startextendcatcodetable#1#2\stopextendcatcodetable % {\bgroup % \scratchcounter\the\catcodetable % \catcodetable #1 #2 @@ -283,7 +283,7 @@ %D in the current vector): %D %D \starttyping -%D \def\startcrap +%D \normalprotected\def\startcrap %D {\bgroup %D \pushcatcodes %D \whitespace @@ -291,7 +291,7 @@ %D \activatespacehandler\v!yes %D \strut} %D -%D \def\stopcrap +%D \normalprotected\def\stopcrap %D {\popcatcodes %D \egroup} %D \stoptyping diff --git a/tex/context/base/char-utf.mkiv b/tex/context/base/char-utf.mkiv index d21cd842c..16b4029d8 100644 --- a/tex/context/base/char-utf.mkiv +++ b/tex/context/base/char-utf.mkiv @@ -41,7 +41,7 @@ %D \definecomposedutf 318 108 126 % lcaron %D \stoptyping -\def\definecomposedutf#1 #2 #3 % +\unexpanded\def\definecomposedutf#1 #2 #3 % {\ctxlua{characters.filters.utf.add_grapheme("#1","#2","#3")}} \protect diff --git a/tex/context/base/chem-str.mkiv b/tex/context/base/chem-str.mkiv index ea8c8827f..1e17218c8 100644 --- a/tex/context/base/chem-str.mkiv +++ b/tex/context/base/chem-str.mkiv @@ -49,7 +49,7 @@ \unprotect -\def\setupchemical +\unexpanded\def\setupchemical {\dosingleempty\dosetupchemical} \def\dosetupchemical @@ -57,7 +57,7 @@ \let\setupchemicals\setupchemical -\def\setupchemicalframed +\unexpanded\def\setupchemicalframed {\dosingleempty\dosetupchemicalframed} \def\dosetupchemicalframed @@ -65,7 +65,7 @@ \def\chemicalparameter#1{\csname\??cm#1\endcsname} -\def\definechemical +\unexpanded\def\definechemical {\dosingleargument\dodefinechemical} % global \def\dodefinechemical[#1]#2% @@ -76,7 +76,7 @@ #2% flush \stopnointerference} -\def\definechemicalsymbol +\unexpanded\def\definechemicalsymbol {\dodoubleempty\dodefinechemicalsymbol} \def\dodefinechemicalsymbol[#1][#2]% @@ -440,7 +440,7 @@ \newif\ifinchemicalformula -\def\startchemicalformula +\unexpanded\def\startchemicalformula {\mathortext\vcenter\vbox\bgroup \forgetall \inchemicalformulatrue @@ -453,7 +453,7 @@ \setfalse\formulachemicalhastop \setfalse\formulachemicalhasbot } -\def\stopchemicalformula +\unexpanded\def\stopchemicalformula {\tabskip1em\relax \nointerlineskip \ifconditional\formulachemicalhastop diff --git a/tex/context/base/colo-ext.mkiv b/tex/context/base/colo-ext.mkiv index 00a4b1bf4..b17608f59 100644 --- a/tex/context/base/colo-ext.mkiv +++ b/tex/context/base/colo-ext.mkiv @@ -86,7 +86,7 @@ % test {\mycolorb OEPS} test % \stoptext -\def\defineintermediatecolor +\unexpanded\def\defineintermediatecolor {\dotripleempty\dodefineintermediatecolor} \def\dodefineintermediatecolor[#1][#2][#3]% \dotripleempty adds {} inside [] diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua index 0e73761a3..342d6110d 100644 --- a/tex/context/base/colo-ini.lua +++ b/tex/context/base/colo-ini.lua @@ -190,43 +190,59 @@ end function colors.defineprocesscolor(name,str,global,freeze) -- still inconsistent color vs transparent local x = match(str,"^#(.+)$") -- for old times sake (if we need to feed from xml or so) - local t = (x and { x = x }) or settings_to_hash_strict(str) - if t then - if t.r or t.g or t.b then - definecolor(name, register_color(name,'rgb', tonumber(t.r) or 0, tonumber(t.g) or 0, tonumber(t.b) or 0), global) - elseif t.c or t.m or t.y or t.k then - definecolor(name, register_color(name,'cmyk',tonumber(t.c) or 0, tonumber(t.m) or 0, tonumber(t.y) or 0, tonumber(t.k) or 0), global) - elseif t.v then - local r, g, b = colors.hsvtorgb(tonumber(t.h) or 0, tonumber(t.s) or 1, tonumber(t.v) or 1) -- maybe later native - definecolor(name, register_color(name,'rgb',r,g,b), global) - elseif t.x or t.h then - local r, g, b = match((t.x or t.h) .. "000000","(..)(..)(..)") -- watch the 255 - definecolor(name, register_color(name,'rgb',(tonumber(r,16) or 0)/255,(tonumber(g,16) or 0)/255,(tonumber(b,16) or 0)/255), global) + if x then + local r, g, b = match(x .. "000000","(..)(..)(..)") -- watch the 255 + definecolor(name, register_color(name,'rgb',(tonumber(r,16) or 0)/255,(tonumber(g,16) or 0)/255,(tonumber(b,16) or 0)/255), global) + else + local settings = settings_to_hash_strict(str) + if settings then + local r, g, b = settings.r, settings.g, settings.b + if r or g or b then + definecolor(name, register_color(name,'rgb', tonumber(r) or 0, tonumber(g) or 0, tonumber(b) or 0), global) + else + local c, m, y, k = settings.c, settings.m, settings.y, settings.k + if c or m or y or b then + definecolor(name, register_color(name,'cmyk',tonumber(c) or 0, tonumber(m) or 0, tonumber(y) or 0, tonumber(k) or 0), global) + else + local h, s, v = settings.h, settings.s, settings.v + if v then + r, g, b = colors.hsvtorgb(tonumber(h) or 0, tonumber(s) or 1, tonumber(v) or 1) -- maybe later native + definecolor(name, register_color(name,'rgb',r,g,b), global) + else + local x = settings.x or h + if x then + r, g, b = match(x .. "000000","(..)(..)(..)") -- watch the 255 + definecolor(name, register_color(name,'rgb',(tonumber(r,16) or 0)/255,(tonumber(g,16) or 0)/255,(tonumber(b,16) or 0)/255), global) + else + definecolor(name, register_color(name,'gray',tonumber(s) or 0), global) + end + end + end + end + local a, t = settings.a, settings.t + if a and t then + definetransparent(name, transparencies.register(name,transparent[a] or tonumber(a) or 1,tonumber(t) or 1), global) + elseif colors.couple then + -- definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up + definetransparent(name, 0, global) -- can be sped up + end + elseif freeze then + local ca = attributes_list[a_color] [str] + local ta = attributes_list[a_transparency][str] + if ca then + definecolor(name, ca, global) + end + if ta then + definetransparent(name, ta, global) + end else - definecolor(name, register_color(name,'gray',tonumber(t.s) or 0), global) - end - if t.a and t.t then - definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global) - elseif colors.couple then - -- definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up - definetransparent(name, 0, global) -- can be sped up + inheritcolor(name, str, global) + inherittransparent(name, str, global) + -- if global and str ~= "" then -- For Peter Rolf who wants access to the numbers in Lua. (Currently only global is supported.) + -- attributes_list[a_color] [name] = attributes_list[a_color] [str] or attributes.unsetvalue -- reset + -- attributes_list[a_transparency][name] = attributes_list[a_transparency][str] or attributes.unsetvalue + -- end end - elseif freeze then - local ca = attributes_list[a_color] [str] - local ta = attributes_list[a_transparency][str] - if ca then - definecolor(name, ca, global) - end - if ta then - definetransparent(name, ta, global) - end - else - inheritcolor(name, str, global) - inherittransparent(name, str, global) - -- if global and str ~= "" then -- For Peter Rolf who wants access to the numbers in Lua. (Currently only global is supported.) - -- attributes_list[a_color] [name] = attributes_list[a_color] [str] or attributes.unsetvalue -- reset - -- attributes_list[a_transparency][name] = attributes_list[a_transparency][str] or attributes.unsetvalue - -- end end end diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv index 36de4afcb..1bceb5aa7 100644 --- a/tex/context/base/colo-ini.mkiv +++ b/tex/context/base/colo-ini.mkiv @@ -110,11 +110,11 @@ %D %D \getbuffer \typebuffer -\def\definecolor {\dodoubleargument\dodefinecolor} -\def\defineglobalcolor {\dodoubleargument\dodefineglobalcolor} -\def\definenamedcolor {\dodoubleargument\dodefinenamedcolor} -\def\definespotcolor {\dotripleargument\dodefinespotcolor} -\def\definemultitonecolor{\doquadrupleempty\dodefinemultitonecolor} +\unexpanded\def\definecolor {\dodoubleargument\dodefinecolor} +\unexpanded\def\defineglobalcolor {\dodoubleargument\dodefineglobalcolor} +\unexpanded\def\definenamedcolor {\dodoubleargument\dodefinenamedcolor} +\unexpanded\def\definespotcolor {\dotripleargument\dodefinespotcolor} +\unexpanded\def\definemultitonecolor{\doquadrupleempty\dodefinemultitonecolor} %D \macros %D {startcolor,stopcolor, @@ -149,10 +149,10 @@ \unexpanded\def\fastcolored [#1]#2{\begingroup\dodefinefastcolor[@colored@][#1]\doactivatecolor{@colored@}#2\endgroup} \def\predefinecolor [#1]{\flushatshipout{\hbox{\color[#1]{}}}} \def\predefineindexcolor[#1]{\flushatshipout{\hbox{\color[#1]{}}}} - \def\startcolorpage {\startcolor[\ifx\maintextcolor\empty\defaulttextcolor\else\maintextcolor\fi]} - \def\stopcolorpage {\stopcolor} - \def\startraster [#1]{\dosetrastercolor{#1}} - \def\stopraster {} + \unexpanded\def\startcolorpage {\startcolor[\ifx\maintextcolor\empty\defaulttextcolor\else\maintextcolor\fi]} + \unexpanded\def\stopcolorpage {\stopcolor} + \unexpanded\def\startraster [#1]{\dosetrastercolor{#1}} + \unexpanded\def\stopraster {} \def\raster [#1]{\groupedcommand{\dosetrastercolor{#1}}{}} \def\faststartcolor [#1]{\doactivatecolor{#1}} \def\faststopcolor {} @@ -182,8 +182,8 @@ %D \macros %D {startcurrentcolor,stopcurrentcolor} -\def\startcurrentcolor{\startcolor[\outercolorname]} -\def\stopcurrentcolor {\stopcolor} +\unexpanded\def\startcurrentcolor{\startcolor[\outercolorname]} +\unexpanded\def\stopcurrentcolor {\stopcolor} %D \macros %D {setupcolor} @@ -208,7 +208,7 @@ \let\colorstyle\empty -\def\setupcolor +\unexpanded\def\setupcolor {\dosingleargument\dosetupcolor} \def\dosetupcolor[#1]% @@ -233,7 +233,7 @@ %D %D This command numbers to names: -\def\definetransparency +\unexpanded\def\definetransparency {\dodoubleargument\dodefinetransparency} \unexpanded\def\setupcolors @@ -365,7 +365,7 @@ %D This saves us some typing in for instance the modules that %D deal with pretty verbatim typesetting. -\def\definepalet +\unexpanded\def\definepalet {\dodoubleargument\dodefinepalet} \def\dodefinepalet[#1][#2]% @@ -408,7 +408,7 @@ \let\currentpalet\empty -\def\setuppalet +\unexpanded\def\setuppalet {\dosingleempty\dosetuppalet} \def\dosetuppalet[#1]% @@ -472,7 +472,7 @@ %D defining each color separate, it also loads faster and takes %D less bytes. -\def\definecolorgroup +\unexpanded\def\definecolorgroup {\dotripleempty\dodefinecolorgroup} \def\dododefinecolorgroupgray [#1][#2:#3]{\definecolor [#1:\the\colorcount][s=#2]} @@ -917,7 +917,7 @@ \def\registermaintextcolor{\ctxlua{colors.main = \thecolorattribute\maintextcolor}} -\def\starttextcolor[#1]% +\unexpanded\def\starttextcolor[#1]% {\doifsomething{#1} {\definecolor[\@@themaintextcolor][#1]% \let\maintextcolor\@@themaintextcolor diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 8ef09e1a0..974ec917d 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.05.20 20:00} +\newcontextversion{2010.05.22 12:06} %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.mkiv b/tex/context/base/context.mkiv index ce3d7c684..7b5dfe613 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -30,6 +30,8 @@ \loadcorefile{norm-ctx} \loadcorefile{syst-pln} +\newif\ifCONTEXT \CONTEXTtrue % will disappear + \loadmarkfile{luat-cod} \loadmarkfile{luat-bas} \loadmarkfile{luat-lib} @@ -40,7 +42,8 @@ \loadcorefile{catc-ctx} \loadcorefile{catc-sym} -\newif\ifCONTEXT \CONTEXTtrue % will disappear +% From here on we have \unexpanded being \normalprotected, as we +% already had \unexpanded long before etex came around. \loadmarkfile{syst-aux} \loadmarkfile{syst-lua} diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index ec96c88cb..1d4891f20 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.05.20 20:00} +\edef\contextversion{2010.05.22 12:06} %D For those who want to use this: diff --git a/tex/context/base/core-con.mkiv b/tex/context/base/core-con.mkiv index b9dc0b449..2d2e5d5d7 100644 --- a/tex/context/base/core-con.mkiv +++ b/tex/context/base/core-con.mkiv @@ -596,10 +596,10 @@ % \setvalue{\??cv#1}##1{\csname\??cv#1##1\endcsname}} % {\setvalue{\??cv#1}{#2}}} % -% \def\defineconversion% +% \unexpanded\def\defineconversion% % {\dodoubleargument\dodefineconversion} -\def\defineconversion +\unexpanded\def\defineconversion {\dotripleempty\dodefineconversion} \def\dodefineconversion[#1][#2][#3]% diff --git a/tex/context/base/core-env.mkiv b/tex/context/base/core-env.mkiv index bad5823dd..d927ff3ad 100644 --- a/tex/context/base/core-env.mkiv +++ b/tex/context/base/core-env.mkiv @@ -174,8 +174,8 @@ \expanded {\long\def\@EA\noexpand\csname\e!start\v!setups\endcsname {\begingroup\noexpand\doifnextoptionalelse - {\noexpand\startsetupsA\@EA\noexpand\csname\e!stop\v!setups\endcsname} - {\noexpand\startsetupsB\@EA\noexpand\csname\e!stop\v!setups\endcsname}}} + {\noexpand\dostartsetupsA\@EA\noexpand\csname\e!stop\v!setups\endcsname} + {\noexpand\dostartsetupsB\@EA\noexpand\csname\e!stop\v!setups\endcsname}}} \letvalue{\e!stop\v!setups}\relax @@ -209,9 +209,6 @@ \def\dodoprocesslocalsetups {\@EA\processcommalist\@EA[\tobeprocessedsetups]\dosetups} -% \def\setupwithargument#1% -% {\csname\??su:\ifcsname\??su:#1\endcsname#1\else\letterpercent\fi\endcsname} - \edef\setupwithargument#1% saves a few expansions {\noexpand\csname\??su:\noexpand\ifcsname\??su:#1\endcsname#1\noexpand\else\letterpercent\noexpand\fi\endcsname} @@ -222,27 +219,27 @@ \chardef\setupseolmode\plusone -\def\startsetups {\xxstartsetups\plusone \stopsetups } \let\stopsetups \relax -\def\startlocalsetups{\xxstartsetups\plusone \stoplocalsetups} \let\stoplocalsetups\relax -\def\startrawsetups {\xxstartsetups\zerocount\stoprawsetups } \let\stoprawsetups \relax -\def\startxmlsetups {\xxstartsetups\plustwo \stopxmlsetups } \let\stopxmlsetups \relax +\unexpanded\def\startsetups {\xxstartsetups\plusone \stopsetups } \let\stopsetups \relax +\unexpanded\def\startlocalsetups{\xxstartsetups\plusone \stoplocalsetups} \let\stoplocalsetups\relax +\unexpanded\def\startrawsetups {\xxstartsetups\zerocount\stoprawsetups } \let\stoprawsetups \relax +\unexpanded\def\startxmlsetups {\xxstartsetups\plustwo \stopxmlsetups } \let\stopxmlsetups \relax \def\xxstartsetups#1#2% - {\begingroup\let\setupseolmode#1\doifnextoptionalelse{\startsetupsA#2}{\startsetupsB#2}} + {\begingroup\let\setupseolmode#1\doifnextoptionalelse{\dostartsetupsA#2}{\dostartsetupsB#2}} -\def\startsetupsA#1% [ ] delimited +\def\dostartsetupsA#1% [ ] delimited {\ifcase\setupseolmode\or\catcode`\^^M\@@ignore\or\catcode`\^^M\@@ignore\catcode`\|\@@other\fi \dotripleempty\dostartsetups[#1]} -\def\startsetupsB#1#2 % space delimited +\def\dostartsetupsB#1#2 % space delimited {\ifcase\setupseolmode\or\catcode`\^^M\@@ignore\or\catcode`\^^M\@@ignore\catcode`\|\@@other\fi \dodostartsetups#1\empty{#2}} -\def\startsetupsC[#1][#2][#3]{\dodostartsetups#1{#2}{#3}} % [..] [..] -\def\startsetupsD[#1][#2][#3]{\dodostartsetups#1\empty{#2}} % [..] +\def\dostartsetupsC[#1][#2][#3]{\dodostartsetups#1{#2}{#3}} % [..] [..] +\def\dostartsetupsD[#1][#2][#3]{\dodostartsetups#1\empty{#2}} % [..] \def\dostartsetups - {\ifthirdargument\@EA\startsetupsC\else\@EA\startsetupsD\fi} + {\ifthirdargument\@EA\dostartsetupsC\else\@EA\dostartsetupsD\fi} \long\def\dodostartsetups#1#2#3% {\long\def\dododostartsetups##1#1% @@ -361,7 +358,7 @@ \def\getvariabledefault#1#2% #3% can be command, so no ifcsname here {\executeifdefined{\??vars:#1:#2}}% {#3} -% \def\setupenv{\dodoubleargument\rawgetparameters[\??en]} +% \unexpanded\def\setupenv{\dodoubleargument\rawgetparameters[\??en]} % % \def\doifenvelse#1{\doifdefinedelse{\??en#1}} % speed up % \def\doifenv #1{\doifdefined {\??en#1}} % speed up @@ -381,7 +378,7 @@ \def\s!environment{environment} -\def\setupenv {\dotripleargument\dosetvariables[\getrawparameters][\s!environment]} +\unexpanded\def\setupenv {\dotripleargument\dosetvariables[\getrawparameters][\s!environment]} \def\doifenvelse{\doifelsevariable \s!environment} \def\doifenv {\doifvariable \s!environment} \def\doifnotenv {\doifnotvariable \s!environment} diff --git a/tex/context/base/core-fil.mkiv b/tex/context/base/core-fil.mkiv index 9aaa68c3f..daef176d2 100644 --- a/tex/context/base/core-fil.mkiv +++ b/tex/context/base/core-fil.mkiv @@ -43,7 +43,7 @@ % will be redone in mkiv -\def\definefilesynonym +\unexpanded\def\definefilesynonym {\dodoubleempty\dodefinefilesynonym} \def\dodefinefilesynonym[#1][#2]% @@ -55,7 +55,7 @@ %D \macros %D {definefilefallback} -\def\definefilefallback +\unexpanded\def\definefilefallback {\dodoubleargument\dodefinefilefallback} \def\dodefinefilefallback[#1][#2]% @@ -146,7 +146,7 @@ \let\currentmoduleparameters\empty \let\currentmodule \s!unknown -\def\startmodule +\unexpanded\def\startmodule {\doifnextoptionalelse\dostartmodule\nostartmodule} \def\nostartmodule #1 % @@ -157,11 +157,11 @@ \pushmacro\currentmoduleparameters \def\currentmodule{#1}} -\def\stopmodule +\unexpanded\def\stopmodule {\popmacro\currentmoduleparameters \popmacro\currentmodule} -\def\setupmodule +\unexpanded\def\setupmodule {\dodoubleempty\dosetupmodule} \def\dosetupmodule[#1][#2]% @@ -202,7 +202,7 @@ \let\stopmoduletestsection\donothing -\def\startmoduletestsection +\unexpanded\def\startmoduletestsection {\bgroup \setupmodule % we need to make sure that the vars are set \doifelse{\currentmoduleparameter\v!test}\v!yes @@ -273,7 +273,7 @@ \def\documentresources{\@@erurl} -\def\setupexternalresources +\unexpanded\def\setupexternalresources {\dodoubleargument\getparameters[\??er]} \setupexternalresources diff --git a/tex/context/base/core-fnt.mkiv b/tex/context/base/core-fnt.mkiv index e266b341c..a7c84a5a0 100644 --- a/tex/context/base/core-fnt.mkiv +++ b/tex/context/base/core-fnt.mkiv @@ -268,7 +268,7 @@ % to do: more fine tuning -\def\setupinitial +\unexpanded\def\setupinitial {\dodoubleempty\getparameters[\??dc]} \definefontsynonym[Initial][Regular] % prefered initial identifier @@ -284,7 +284,7 @@ \def\AutoDroppedCapsCommand{\NiceDroppedCaps\@@dccommand\@@dcfont\@@dcdistance\@@dcn}% -\def\placeinitial +\unexpanded\def\placeinitial {\doifelse\@@dclocation\v!margin{\chardef\DropMode\plusone}{\chardef\DropMode\zerocount}% \doif \@@dcstate\v!start{\ifcase\@@dcn\else\AutoDroppedCaps\fi}} diff --git a/tex/context/base/core-job.mkiv b/tex/context/base/core-job.mkiv index acf96c7a8..de328c92b 100644 --- a/tex/context/base/core-job.mkiv +++ b/tex/context/base/core-job.mkiv @@ -114,14 +114,14 @@ {\the\everystarttext \global\everystarttext\emptytoks} -\def\starttext +\unexpanded\def\starttext {\doateverystarttext \ifcase\textlevel \registerfileinfo[begin]\jobfilename \fi \global\advance\textlevel\plusone} -\def\stoptext +\unexpanded\def\stoptext {\global\advance\textlevel\minusone \ifnum\textlevel>\zerocount \else \flushfinallayoutpage % optional @@ -191,7 +191,7 @@ \def\environment #1 % at outermost level only (load only once) {\pushmacro\startenvironment \pushmacro\stopenvironment - \def\startenvironment ##1 {}% + \unexpanded\def\startenvironment ##1 {}% \let\stopenvironment\relax \startreadingfile \doexecutefileonce{#1} @@ -242,24 +242,24 @@ \expandafter\endinput \fi} -\def\startproject #1 % +\unexpanded\def\startproject #1 % {\donextlevel\v!project\currentproject \donotexecutefile\doexecutefileonce \doexecutefileonce\doexecutefile#1\\} -\def\startproduct #1 % +\unexpanded\def\startproduct #1 % {\doateverystarttext \donextlevel\v!product\currentproduct \doexecutefileonce\doexecutefileonce \donotexecutefile\doexecutefile#1\\} -\def\startcomponent #1 % +\unexpanded\def\startcomponent #1 % {\doateverystarttext \donextlevel\v!component\currentcomponent \doexecutefileonce\doexecutefileonce \donotexecutefile\doexecutefile#1\\} -\def\startenvironment #1 % +\unexpanded\def\startenvironment #1 % {\donextlevel\v!environment\currentenvironment \donotexecutefile\doexecutefileonce \donotexecutefile\donotexecutefile#1\\} @@ -269,10 +269,10 @@ % 2: \startmode[*product] product \stopmode \endgraf % \stopproject -\def\stopproject {\doprevlevel} -\def\stopproduct {\doprevlevel} -\def\stopcomponent {\doprevlevel} -\def\stopenvironment{\doprevlevel} +\unexpanded\def\stopproject {\doprevlevel} +\unexpanded\def\stopproduct {\doprevlevel} +\unexpanded\def\stopcomponent {\doprevlevel} +\unexpanded\def\stopenvironment{\doprevlevel} % more or less replaced by modes diff --git a/tex/context/base/core-mis.mkiv b/tex/context/base/core-mis.mkiv index 28ce8406b..e2bd28bd5 100644 --- a/tex/context/base/core-mis.mkiv +++ b/tex/context/base/core-mis.mkiv @@ -169,7 +169,7 @@ \noindent\hbox{\box0\hskip-\wd2\box2}% \dostopitems} -\def\setupitems +\unexpanded\def\setupitems {\dosingleargument\dosetupitems} \def\complexitems[#1]% @@ -217,10 +217,10 @@ #2]% \setvalue{\e!place#1}{\doplacement[\??pl#1]}} -\def\defineplacement +\unexpanded\def\defineplacement {\dodoubleempty\dodefineplacement} -\def\setupplacement +\unexpanded\def\setupplacement {\dodoubleempty\dosetupplacement} \def\dosetupplacement[#1]% @@ -334,7 +334,7 @@ \c!color=\paragraphparameter\c!color]}% \setupparagraphs[\currentparagraph][1][\c!distance=\zeropoint]} -\def\defineparagraphs +\unexpanded\def\defineparagraphs {\dodoubleargument\dodefineparagraphs} \def\dosetupparagraphs[#1][#2][#3]% @@ -352,7 +352,7 @@ \getparameters[\??al][#1]% \fi} -\def\setupparagraphs +\unexpanded\def\setupparagraphs {\dotripleempty\dosetupparagraphs} \setupparagraphs @@ -502,7 +502,7 @@ \c!before=\@@tabefore, \c!after=\@@taafter]} -\def\setuptab +\unexpanded\def\setuptab {\dosingleargument\dosetuptab} \setuptab @@ -618,10 +618,10 @@ % % obsolete: -\def\setuphyphenmark +\unexpanded\def\setuphyphenmark {\dodoubleargument\getparameters[\??kp]} -\def\setuphyphenmark[#1]% sign=normal|wide +\unexpanded\def\setuphyphenmark[#1]% sign=normal|wide {\dodoubleargument\getparameters[\??kp][#1]% \doifelse\@@kpsign {\v!normal}% was inset? {\let\textmodehyphen\normalhyphen \let\textmodehyphendiscretionary\normalhyphendiscretionary} @@ -739,8 +739,8 @@ %D \typebuffer %D \getbuffer -\def\startsubsentence{\beginofsubsentence \prewordbreak\beginofsubsentencespacing} -\def\stopsubsentence {\endofsubsentencespacing\prewordbreak\endofsubsentence} +\unexpanded\def\startsubsentence{\beginofsubsentence \prewordbreak\beginofsubsentencespacing} +\unexpanded\def\stopsubsentence {\endofsubsentencespacing\prewordbreak\endofsubsentence} %D \defineXMLenvironment [subsentence] %D {|<|} @@ -829,7 +829,7 @@ {\executeifdefined{\??ci\currentdelimitedtext#1}% {\executeifdefined{\??ci#1}\empty}}} -\def\definedelimitedtext +\unexpanded\def\definedelimitedtext {\dodoubleempty\dodefinedelimitedtext} \def\dodefinedelimitedtext[#1][#2]% @@ -863,7 +863,7 @@ \setvalue{\e!start#1}{\startdelimitedtext[#1]}% \setvalue{\e!stop #1}{\stopdelimitedtext}}} -\def\setupdelimitedtext +\unexpanded\def\setupdelimitedtext {\dotripleargument\dosetupdelimitedtext} \def\dosetupdelimitedtext[#1][#2][#3]% #2 = optional level @@ -882,7 +882,7 @@ \let\dohandlerepeatdelimitedtext\relax -\def\startdelimitedtext[#1]% +\unexpanded\def\startdelimitedtext[#1]% {\bgroup \pushdelimitedtext{#1}% \doifelse{\delimitedtextparameter\c!method}\s!font @@ -976,7 +976,7 @@ \dohandlerightdelimitedtext\c!right \dostopattributes} -\def\stopdelimitedtext +\unexpanded\def\stopdelimitedtext {\dostopdelimitedtext \popdelimitedtext \egroup} @@ -1000,8 +1000,8 @@ % shortcuts -\def\startdelimited{\startdelimitedtext} -\def\stopdelimited {\stopdelimitedtext} % no let, dynamically assigned +\unexpanded\def\startdelimited{\startdelimitedtext} +\unexpanded\def\stopdelimited {\stopdelimitedtext} % no let, dynamically assigned \def\delimited {\delimitedtext} \def\leftdelimitedtextmark @@ -1197,8 +1197,8 @@ % [\c!indentnext=\v!no, % \c!spacebefore=\v!nowhite] -\def\setupquotation{\setupdelimitedtext[\v!quotation]} -\def\setupquote {\setupdelimitedtext[\v!quote]} +\unexpanded\def\setupquotation{\setupdelimitedtext[\v!quotation]} +\unexpanded\def\setupquote {\setupdelimitedtext[\v!quote]} % seldom used, move from kernel to run time module @@ -1357,7 +1357,7 @@ % % \definesystemvariable{ri} % -% \def\setuprows +% \unexpanded\def\setuprows % {\dodoubleargument\getparameters[\??ri]} % % \definecomplexorsimpleempty\startrows @@ -1380,7 +1380,7 @@ % \bgroup % \row} % -% \def\stoprows +% \unexpanded\def\stoprows % {\do@@ribottom % \egroup % \egroup} @@ -1593,7 +1593,7 @@ \newbox\firstpairedbox \newbox\secondpairedbox -\def\definepairedbox +\unexpanded\def\definepairedbox {\dodoubleempty\dodefinepairedbox} \def\dodefinepairedbox[#1][#2]% @@ -1617,13 +1617,13 @@ \setvalue{\e!setup#1\e!endsetup}{\setuppairedbox[#1]}% \setvalue{\e!place#1}{\placepairedbox[#1]}} -\def\setuppairedbox +\unexpanded\def\setuppairedbox {\dodoubleempty\dosetuppairedbox} \def\dosetuppairedbox[#1]% {\getparameters[\??ld#1]} -\def\placepairedbox +\unexpanded\def\placepairedbox {\bgroup\dodoubleempty\doplacepairedbox} \def\doplacepairedbox[#1][#2]% watch the hsize/vsize tricks @@ -1778,7 +1778,7 @@ \newcount\horcombination % counter \newcount\totcombination -\def\definecombination +\unexpanded\def\definecombination {\dodoubleempty\dodefinecombination} \def\dodefinecombination[#1][#2]% @@ -1790,7 +1790,7 @@ \getparameters [\??co#1][#2]} -\def\setupcombinations +\unexpanded\def\setupcombinations {\dodoubleempty\dosetupcombinations} \def\dosetupcombinations[#1][#2]% @@ -1803,7 +1803,7 @@ \def\combinationparameter#1% {\csname\??co\currentcombination#1\endcsname}% -\def\startcombination +\unexpanded\def\startcombination {\bgroup % so we can grab a group \dodoubleempty\dostartcombination} @@ -1921,20 +1921,20 @@ % formally ok: % -% \def\stopcombination +% \unexpanded\def\stopcombination % {\egroup % \egroup} % % more robust: % -% \def\stopcombination +% \unexpanded\def\stopcombination % {{}{}{}{}{}{}{}{}% catches (at most 4) missing entries % \egroup % \egroup} % % even better: -\def\stopcombination +\unexpanded\def\stopcombination {{\scratchtoks{{}{}{}}\dorecurse\totcombination{\appendtoks{}{}{}{}\to\scratchtoks}\expandafter}\the\scratchtoks \egroup \egroup} @@ -2005,7 +2005,7 @@ %D %D \typebuffer \getbuffer -\def\startfloatcombination +\unexpanded\def\startfloatcombination {\dodoubleempty\dostartfloatcombination} \def\dostartfloatcombination[#1][#2]% @@ -2013,7 +2013,7 @@ %\insidecolumnstrue % trick, forces no centering, todo: proper switch/feature \chardef\postcenterfloatmethod\zerocount \forcelocalfloats - \def\stopfloatcombination + \unexpanded\def\stopfloatcombination {\scratchtoks\emptytoks \dorecurse\noflocalfloats {\appendetoks{\noexpand\getlocalfloat{\recurselevel}}{}\to\scratchtoks}% @@ -2021,7 +2021,7 @@ \resetlocalfloats \egroup}} -\def\placerelativetoeachother#1#2% +\unexpanded\def\placerelativetoeachother#1#2% {\bgroup \dowithnextbox {\bgroup @@ -2034,8 +2034,8 @@ \hbox} \hbox} -\def\placeontopofeachother{\placerelativetoeachother\halign\hss} -\def\placesidebyside {\placerelativetoeachother\valign\vss} +\unexpanded\def\placeontopofeachother{\placerelativetoeachother\halign\hss} +\unexpanded\def\placesidebyside {\placerelativetoeachother\valign\vss} %D A couple of examples, demonstrating how the depth is %D taken care of: @@ -2256,7 +2256,7 @@ \presetlocalframed[\??ro] -\def\setuprotate +\unexpanded\def\setuprotate {\dodoubleargument\getparameters[\??ro]} \setuprotate @@ -2294,7 +2294,7 @@ \def\??fr{@@fr} -\def\setuphorizontaldivision +\unexpanded\def\setuphorizontaldivision {\dodoubleargument\getparameters[\??fr]} \def\horizontaldivision diff --git a/tex/context/base/core-sys.mkiv b/tex/context/base/core-sys.mkiv index 932d387ec..649e5e65c 100644 --- a/tex/context/base/core-sys.mkiv +++ b/tex/context/base/core-sys.mkiv @@ -52,7 +52,7 @@ \newtoks \everysetupsystem -\def\setupsystem +\unexpanded\def\setupsystem {\dosingleargument\dosetupsystem} \def\dosetupsystem[#1]% @@ -136,7 +136,7 @@ %D \stoptext %D \stoptyping -\def\setuprandomize[#1]% +\unexpanded\def\setuprandomize[#1]% {\doifsomething{#1} {\bgroup % tex's time is in minutes @@ -180,10 +180,10 @@ {\globaldefs\getvalue{@gd@\the\globaldefs}\relax} {\globaldefs\zerocount}} -\def\startlocal {\dostartglobaldefs>-} -\def\stoplocal {\dostopglobaldefs} -\def\startglobal {\dostartglobaldefs<+} -\def\stopglobal {\dostopglobaldefs} +\unexpanded\def\startlocal {\dostartglobaldefs>-} +\unexpanded\def\stoplocal {\dostopglobaldefs} +\unexpanded\def\startglobal {\dostartglobaldefs<+} +\unexpanded\def\stopglobal {\dostopglobaldefs} \def\complexstart[#1]{\bgroup\getvalue{\e!start#1}} \def\complexstop [#1]{\getvalue{\e!stop #1}\egroup} @@ -223,14 +223,14 @@ {\def\docommand##1{\dododefinestartstop[##1][#2]}% \processcommalist[#1]\docommand} -\def\definestartstop +\unexpanded\def\definestartstop {\dodoubleargument\dodefinestartstop} \def\dosetupstartstop[#1][#2]% {\def\docommand##1{\getparameters[\??be##1][#2]}% \processcommalist[#1]\docommand} -\def\setupstartstop +\unexpanded\def\setupstartstop {\dodoubleargument\dosetupstartstop} % \docommand kan niet worden gebruikt omdat deze macro @@ -243,10 +243,10 @@ % \def\executeprotected#1% % {\csname\??pc\string#1\endcsname} % -% \def\defineprotected#1#2% +% \unexpanded\def\defineprotected#1#2% % {\expandafter\def\csname\??pc\string#2\endcsname} % -% \def\defineunprotected#1% +% \unexpanded\def\defineunprotected#1% % {\def#1} % % \def\doprotected% @@ -350,7 +350,7 @@ % end % \stopluacode % -% \def\define#1#{\ctxlua{commands.define([[\detokenize{#1}]])}} +% \unexpanded\def\define#1#{\ctxlua{commands.define([[\detokenize{#1}]])}} % % \starttext % \define[2]\whatevera{#1+#2} diff --git a/tex/context/base/core-two.mkiv b/tex/context/base/core-two.mkiv index 98d396d08..2cc9412af 100644 --- a/tex/context/base/core-two.mkiv +++ b/tex/context/base/core-two.mkiv @@ -91,7 +91,7 @@ % todo: move the edef to lua -\def\definetwopasslist #1{\ctxlua{jobpasses.define('#1')}} +\unexpanded\def\definetwopasslist #1{\ctxlua{jobpasses.define('#1')}} \def\gettwopassdata #1{\edef\twopassdata{\ctxlua{jobpasses.get("#1")}}\testtwopassdata} \def\checktwopassdata #1{\edef\twopassdata{\ctxlua{jobpasses.check("#1")}}\testtwopassdata} \def\findtwopassdata #1#2{\edef\twopassdata{\ctxlua{jobpasses.find("#1","#2")}}\testtwopassdata} diff --git a/tex/context/base/core-var.mkiv b/tex/context/base/core-var.mkiv index 8e2b5cff7..62cc9fc50 100644 --- a/tex/context/base/core-var.mkiv +++ b/tex/context/base/core-var.mkiv @@ -135,8 +135,8 @@ \newtoks\everystarttextproperties \newtoks\everystoptextproperties -\def\starttextproperties{\the\everystarttextproperties} -\def\stoptextproperties {\the\everystoptextproperties} +\unexpanded\def\starttextproperties{\the\everystarttextproperties} +\unexpanded\def\stoptextproperties {\the\everystoptextproperties} %D \macros %D {defineinputmode,setinputmode} @@ -145,7 +145,7 @@ % not in mkiv -\def\defineinputmode[#1]{\@EA\newtoks\csname every#1inputmode\endcsname} +\unexpanded\def\defineinputmode[#1]{\@EA\newtoks\csname every#1inputmode\endcsname} \def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks} \defineinputmode [TEX] @@ -201,7 +201,7 @@ \appendtoks \boxedcontenttrue \to \everyboxedcontent -\def\startboxedcontent{\bgroup\the\everyboxedcontent} +\unexpanded\def\startboxedcontent{\bgroup\the\everyboxedcontent} \let\stopboxedcontent \egroup %D \macros @@ -230,8 +230,8 @@ %D \stoptext %D \stoptyping -\def\defineselector{\dodoubleargument\dodefineselector} -\def\setupselector {\dodoubleargument\dosetupselector} +\unexpanded\def\defineselector{\dodoubleargument\dodefineselector} +\unexpanded\def\setupselector {\dodoubleargument\dosetupselector} \def\dodefineselector[#1][#2]{\getparameters[\??sx#1][\c!max=2,\c!n=1,#2]} \def\dosetupselector [#1][#2]{\getparameters[\??sx#1][#2]} diff --git a/tex/context/base/enco-ini.mkiv b/tex/context/base/enco-ini.mkiv index 2cb647726..da1892faf 100644 --- a/tex/context/base/enco-ini.mkiv +++ b/tex/context/base/enco-ini.mkiv @@ -40,9 +40,9 @@ %D around, just in case they are used in styles (and in for instance %D symb and xtag files). -\def\startencoding [#1]{} % used in symb +\unexpanded\def\startencoding [#1]{} % used in symb \let\stopencoding \relax -\def\setupencoding [#1]{} +\unexpanded\def\setupencoding [#1]{} \def\enablemapping [#1]{} \def\enableencoding[#1]{} @@ -61,19 +61,19 @@ %D \macros %D {defineaccent, definecharacter, definecommand} -\def\defineaccent#1 #2 #3 % +\unexpanded\def\defineaccent#1 #2 #3 % {\setevalue{\string#1}{\noexpand\dohandleaccent{\string#1}}% \setvalue{\??ac\string#1\string#2}{#3}} \def\dohandleaccent#1#2% {\csname\??ac\string#1\string#2\empty\endcsname} -\def\definecharacter#1 #2 % +\unexpanded\def\definecharacter#1 #2 % {\doifnumberelse{\string#2} {\setevalue{\string#1}{\utfchar{#2}}} % or {\expandafter\chardef\csname#1\endcsname#2\relax} {\setuvalue {\string#1}{#2}}} -\def\definecommand#1 #2 % +\unexpanded\def\definecommand#1 #2 % {\setuvalue{\string#1}{#2}} %D \macros @@ -123,11 +123,13 @@ \vbox to .2ex{\box0\vss}\hidewidth \crcr}}} -\def\buildtextmacron {\bottomaccent{.25ex}{0}{15}{\textmacron}} -\def\buildtextbottomdot {\bottomaccent{.25ex}{0}{5}{\textbottomdot}} -\def\buildtextcedilla {\bottomaccent{0ex}{0}{5}{\textcedilla}} -\def\buildtextogonek {\bottomaccent{-.1ex}{.5}{0}{\textogonek}} -\def\buildtextbottomcomma{\bottomaccent{.15ex}{0}{5}{\tx,}} +\unexpanded\def\buildtextmacron {\bottomaccent{.25ex}{0}{15}{\textmacron}} +\unexpanded\def\buildtextbottomdot {\bottomaccent{.25ex}{0}{5}{\textbottomdot}} +\unexpanded\def\buildtextcedilla {\bottomaccent{0ex}{0}{5}{\textcedilla}} +\unexpanded\def\buildtextogonek {\bottomaccent{-.1ex}{.5}{0}{\textogonek}} +\unexpanded\def\buildtextbottomcomma{\bottomaccent{.15ex}{0}{5}{\tx,}} + +\let\d\buildtextbottomdot \unexpanded\def\topaccent#1#2#3#4#5% down right slantcorrection accent char {\dontleavehmode @@ -143,7 +145,7 @@ \def\buildtextgrave{\topaccent{0pt}{0}{15}{\textgrave}} % e.g. -\def\definemathaccent#1 #2% +\unexpanded\def\definemathaccent#1 #2% {\setvalue{#1}{\mathaccent#2 }} %D Math (will move): diff --git a/tex/context/base/font-afm.lua b/tex/context/base/font-afm.lua index 83feafea7..a6891826d 100644 --- a/tex/context/base/font-afm.lua +++ b/tex/context/base/font-afm.lua @@ -476,12 +476,14 @@ function afm.copy_to_tfm(data) characters[u] = { } descriptions[u] = d end - tfm.encodingbytes = metadata.encodingbytes or 2 - tfm.fullname = metadata.fullname - tfm.filename = metadata.filename -- = tfm.checked_filename(metadata) -- to be tested first - tfm.name = tfm.fullname - tfm.psname = tfm.fullname - tfm.type = "real" + tfm.encodingbytes = 2 -- was metadata.encodingbytes or 2 + tfm.filename = fonts.tfm.checked_filename(luatex) -- was metadata.filename + tfm.fontname = metadata.fontname or metadata.fullname + tfm.fullname = metadata.fullname or metadata.fontname + tfm.psname = tfm.fullname -- in otf: tfm.fontname or tfm.fullname + tfm.name = tfm.filename or tfm.fullname or tfm.fontname + tfm.format = 'type1' + tfm.type = 'real' tfm.units = 1000 tfm.direction = 0 tfm.boundarychar_label = 0 @@ -714,20 +716,17 @@ function tfm.read_from_afm(specification) tfmtable.name = specification.name tfmtable = tfm.scale(tfmtable, specification.size, specification.relativeid) local afmdata = tfmtable.shared.afmdata - local filename = afmdata and afmdata.luatex and afmdata.luatex.filename - if not filename then - -- try to locate anyway and set afmdata.luatex.filename - end - if filename then - tfmtable.encodingbytes = 2 - tfmtable.filename = resolvers.findbinfile(filename,"") or filename - tfmtable.fontname = afmdata.metadata.fontname or afmdata.metadata.fullname - tfmtable.fullname = afmdata.metadata.fullname or afmdata.metadata.fontname - tfmtable.format = 'type1' - tfmtable.name = afmdata.luatex.filename or tfmtable.fullname - end +--~ local filename = afmdata and afmdata.luatex and afmdata.luatex.filename +--~ if filename then +--~ tfmtable.encodingbytes = 2 +--~ tfmtable.filename = resolvers.findbinfile(filename,"") or filename +--~ tfmtable.fontname = afmdata.metadata.fontname or afmdata.metadata.fullname +--~ tfmtable.fullname = afmdata.metadata.fullname or afmdata.metadata.fontname +--~ tfmtable.format = 'type1' +--~ tfmtable.name = afmdata.luatex.filename or tfmtable.fullname +--~ end if fonts.dontembed[filename] then - tfmtable.file = nil + tfmtable.file = nil -- or filename ? end fonts.logger.save(tfmtable,'afm',specification) end diff --git a/tex/context/base/font-col.mkiv b/tex/context/base/font-col.mkiv index 952dd9974..181b985f6 100644 --- a/tex/context/base/font-col.mkiv +++ b/tex/context/base/font-col.mkiv @@ -29,7 +29,7 @@ \unprotect -\def\definefontfallback +\unexpanded\def\definefontfallback {\doquadrupleempty\dodefinefontfallback} \def\dodefinefontfallback[#1][#2][#3][#4]% diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv index 8e9b0ea51..b5cae7b8b 100644 --- a/tex/context/base/font-ini.mkiv +++ b/tex/context/base/font-ini.mkiv @@ -171,7 +171,7 @@ \unexpanded\def\startfont {\bgroup\definedfont} -\def\stopfont +\unexpanded\def\stopfont {\egroup} \def\doiffontcharelse#1#2% @@ -916,7 +916,7 @@ % We could use an indirect method ... store in 'array' and refer to % slot. -\def\definefontsynonym[#1]#2[#3]% +\unexpanded\def\definefontsynonym[#1]#2[#3]% {\edef\@@fontname{#1}% \edef\@@fontfile{#3}% \ifx\fontclass\empty @@ -983,7 +983,7 @@ \let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater -\def\setupfontsynonym +\unexpanded\def\setupfontsynonym {\dodoubleempty\dosetupfontsynonym} \def\dosetupfontsynonym[#1][#2]% not yet supported, will do when needed @@ -1056,7 +1056,7 @@ % % \setupbodyfont[palatino] -\def\startfontclass +\unexpanded\def\startfontclass {\dosingleempty\dostartfontclass} \def\dostartfontclass[#1]% @@ -1065,7 +1065,7 @@ {\let\fontclass\empty} {\doifsomething{#1}{\def\fontclass{#1}}}} -\def\stopfontclass +\unexpanded\def\stopfontclass {\popmacro\fontclass} %D \macros @@ -1095,7 +1095,7 @@ %D %D The implementation looks as follows: -\def\definefont +\unexpanded\def\definefont {\dotripleempty\dodefinefont} \def\dodefinefont[#1][#2][#3]% [name][spec][1.6 | line=10pt | setup_id] @@ -1112,7 +1112,7 @@ {\setuplocalinterlinespace[#3]% \setupspacing}} % needed ? -\def\definefrozenfont +\unexpanded\def\definefrozenfont {\dotripleempty\dodefinefrozenfont} \def\dodefinefrozenfont[#1][#2][#3]% @@ -1226,11 +1226,11 @@ \processcommacommand[\fontalternativelist]\dodocommand}% \processcommacommand[\fontsizelist]\docommand} -\def\definefontsize[#1]% sneller met toks +\unexpanded\def\definefontsize[#1]% sneller met toks {\addtocommalist{#1}\fontsizelist \checkfontnamecombinations} -\def\definefontalternative[#1]% +\unexpanded\def\definefontalternative[#1]% {\addtocommalist{#1}\fontalternativelist \checkfontnamecombinations} @@ -1348,7 +1348,7 @@ \let\k!text \k!savedtext \fi} -\def\definebodyfontenvironment +\unexpanded\def\definebodyfontenvironment {\dotripleempty\dodefinebodyfontenvironment} \def\dodefinebodyfontenvironment[#1][#2][#3]% class size settings @@ -1434,7 +1434,7 @@ % this one already catches both define/setup -\def\setupbodyfontenvironment{\definebodyfontenvironment} +\unexpanded\def\setupbodyfontenvironment{\definebodyfontenvironment} %D Just a couple of interface macros: @@ -1527,7 +1527,7 @@ %D user definitions like \type{\tfw} or \type{\bfq} for real %D large alternatives. -\def\definebodyfont +\unexpanded\def\definebodyfont {\doquadrupleempty\redefinebodyfont} \def\redefinebodyfont[#1][#2][#3][#4]% @@ -1608,30 +1608,30 @@ \def\dodefinebodyfontnopxx#1#2[#3#4#5=#6]% style body def {\ifcsname#1#3#4#5\endcsname\else\checkbodyfont{#1}{#3#4}{#5}\fi% not \definefontsize[#5] \@EA\let\csname*#2#1#3#4#5*\endcsname\undefined - \normalprotected\@EA\edef\csname#2#1#3#4#5\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#5}{\normalunexpanded{#6}}}} + \unexpanded\@EA\edef\csname#2#1#3#4#5\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#5}{\normalunexpanded{#6}}}} \def\dodefinebodyfontyesxx#1#2[#3#4#5=#6]% style body def {\ifcsname#1#3#4#5\endcsname\else\checkbodyfont{#1}{#3#4}{#5}\fi% not \definefontsize[#5] \fcglobal\@EA\let\csname*\fontclass#2#1#3#4#5*\endcsname\undefined - \normalprotected\@EA\fcxdef\csname\fontclass#2#1#3#4#5\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#5}{\normalunexpanded{#6}}}} + \unexpanded\@EA\fcxdef\csname\fontclass#2#1#3#4#5\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#5}{\normalunexpanded{#6}}}} \def\dodefinebodyfontnopmm#1#2[#3#4#5=#6]% style body def {\ifcsname#1#3#4#5\endcsname\else\checkbodyfont{#1}{#3#4}{#5}\fi% not \definefontsize[#5] \@EA\let\csname*#2#1#3#4#51*\endcsname\undefined \@EA\let\csname*#2#1#3#4#52*\endcsname\undefined \@EA\let\csname*#2#1#3#4#53*\endcsname\undefined - \normalprotected\@EA\edef\csname#2#1#3#4#51\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#51}{\normalunexpanded{#6}}}% - \normalprotected\@EA\edef\csname#2#1#3#4#52\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#52}{\normalunexpanded{#6}}}% - \normalprotected\@EA\edef\csname#2#1#3#4#53\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#53}{\normalunexpanded{#6}}}} + \unexpanded\@EA\edef\csname#2#1#3#4#51\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#51}{\normalunexpanded{#6}}}% + \unexpanded\@EA\edef\csname#2#1#3#4#52\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#52}{\normalunexpanded{#6}}}% + \unexpanded\@EA\edef\csname#2#1#3#4#53\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#53}{\normalunexpanded{#6}}}} \def\dodefinebodyfontyesmm#1#2[#3#4#5=#6]% style body def {\ifcsname#1#3#4#5\endcsname\else\checkbodyfont{#1}{#3#4}{#5}\fi% not \definefontsize[#5] \fcglobal\@EA\let\csname*\fontclass#2#1#3#4#51*\endcsname\undefined \fcglobal\@EA\let\csname*\fontclass#2#1#3#4#52*\endcsname\undefined \fcglobal\@EA\let\csname*\fontclass#2#1#3#4#53*\endcsname\undefined - \normalprotected\@EA\fcxdef\csname\fontclass#2#1#3#4#51\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#51}{\normalunexpanded{#6}}}% - \normalprotected\@EA\fcxdef\csname\fontclass#2#1#3#4#52\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#52}{\normalunexpanded{#6}}}% - \normalprotected\@EA\fcxdef\csname\fontclass#2#1#3#4#53\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#53}{\normalunexpanded{#6}}}} + \unexpanded\@EA\fcxdef\csname\fontclass#2#1#3#4#51\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#51}{\normalunexpanded{#6}}}% + \unexpanded\@EA\fcxdef\csname\fontclass#2#1#3#4#52\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#52}{\normalunexpanded{#6}}}% + \unexpanded\@EA\fcxdef\csname\fontclass#2#1#3#4#53\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#53}{\normalunexpanded{#6}}}} \def\checkbodyfont#1% tests for ttsl mmbf {\edef\c!!mm{#1}% @@ -1701,7 +1701,7 @@ \defineunknownfont{\csname\??ft#1#2\endcsname}% \fi} -\def\defineunknownfont#1% +\unexpanded\def\defineunknownfont#1% {\let\c!savedtext\c!text \let\c!text\s!text \donefalse @@ -1730,23 +1730,6 @@ %D Fonts are not loaded yet! This means that at format %D generation time, no font files are preloaded. -%D A previous implementation used: -%D -%D \starttyping -%D \type {\setvalue{name}{\donottest...}} -%D \stoptyping -%D -%D instead of the more memory hungry: -%D -%D \starttyping -%D \setuvalue{name}{...} -%D \stoptyping -%D -%D The first alternative saves about 500 hash entries (about -%D 2.5\% of the total number of entries used. The second -%D alternative is currently used, because that one can more -%D easily be made \ETEX\ aware. - %D \macros %D {everybodyfont,Everybodyfont,everyglobalbodyfont} %D @@ -2473,7 +2456,7 @@ \setvalue{\@style@##1}{\csname#2\endcsname}}% \processcommalist[#1]\docommand} -\def\definefontstyle +\unexpanded\def\definefontstyle {\dodoubleargument\dodefinefontstyle} \def\setfontstyle#1#2% #1:name (roman, romaan) #2:style (rm) @@ -2602,7 +2585,7 @@ %D Experimental: -\def\definefontfeature +\unexpanded\def\definefontfeature {\dotripleargument\dodefinefontfeature} \def\dodefinefontfeature[#1][#2][#3]% @@ -2790,7 +2773,7 @@ {\def\docommand##1{\setvalue{##1}{\switchtobodyfont[#2]}}% \processcommalist[#1]\docommand} -\def\definebodyfontswitch +\unexpanded\def\definebodyfontswitch {\dodoubleargument\dodefinebodyfontswitch} %D \macros @@ -2936,10 +2919,10 @@ \setvalue{\@noletter@##1}{#3}}% \processcommalist[#1]\docommand} -\def\definealternativestyle +\unexpanded\def\definealternativestyle {\dotripleempty\dodefinealternativestyle} -\def\definestyle{\definealternativestyle} +\unexpanded\def\definestyle{\definealternativestyle} %D Maybe too geneneric, but probably ok is the following. (Maybe one %D day we will use a dedicated grouped command for styles.) @@ -3736,7 +3719,7 @@ %D This command is obsolete in \MKIV\ as we have features. It might %D come back using the local features handlers. -\def\definefontvariant{\dotripleargument\dodefinefontvariant} +\unexpanded\def\definefontvariant{\dotripleargument\dodefinefontvariant} \def\dodefinefontvariant[#1][#2][#3]{} \def\variant [#1]{} @@ -3767,11 +3750,11 @@ \def\style[#1]% for inline usage, like \color {\groupedcommand{\ifcsname#1\endcsname\csname#1\endcsname\else\definedfont[#1]\fi}{}} -\def\startstyle[#1]% +\unexpanded\def\startstyle[#1]% {\begingroup \ifcsname#1\endcsname\csname#1\endcsname\else\definedfont[#1]\fi} -\def\stopstyle +\unexpanded\def\stopstyle {\endgroup} %D Still experimental (might even go away). @@ -3786,7 +3769,7 @@ % {\bf test \mine test \sl test \mine test \bs oeps \mine oeps {\tt test \mine \bf test}} -\def\definestylecollection +\unexpanded\def\definestylecollection {\dosingleargument\dodefinestylecollection} \def\dodefinestylecollection[#1]% @@ -3798,7 +3781,7 @@ \processcommacommand[\fontstylelist,\s!default]\docommand \fi} -\def\definestyleinstance +\unexpanded\def\definestyleinstance {\doquadrupleargument\dodefinestyleinstance} \def\dodefinestyleinstance[#1][#2][#3][#4]% [name] [rm|ss|tt|..] [sl|bf|...] [whatever] diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index bad09cb40..2ccdc4598 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -1564,11 +1564,13 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th local spaceunits = 500 -- we need a runtime lookup because of running from cdrom or zip, brrr (shouldn't we use the basename then?) tfm.filename = fonts.tfm.checked_filename(luatex) - tfm.fullname = metadata.fullname tfm.fontname = metadata.fontname + tfm.fullname = metadata.fullname or tfm.fontname tfm.psname = tfm.fontname or tfm.fullname + tfm.name = tfm.filename or tfm.fullname or tfm.fontname tfm.units = metadata.units_per_em or 1000 tfm.encodingbytes = 2 + tfm.format = (metadata.order2 == 1 and 'truetype') or 'opentype' tfm.cidinfo = data.cidinfo tfm.cidinfo.registry = tfm.cidinfo.registry or "" tfm.type = "real" @@ -1653,6 +1655,7 @@ function tfm.read_from_open_type(specification) local s = specification.size local m = otfdata.metadata.math if m then + -- this will move to a function local f = specification.features if f then local f = f.normal @@ -1681,33 +1684,13 @@ function tfm.read_from_open_type(specification) end end tfmtable = tfm.scale(tfmtable,s,specification.relativeid) - -- here we resolve the name; file can be relocated, so this info is not in the cache - local filename = (otfdata and otfdata.luatex and otfdata.luatex.filename) or specification.filename - if not filename then - -- try to locate anyway and set otfdata.luatex.filename - end - if filename then - tfmtable.encodingbytes = 2 - tfmtable.filename = resolvers.findbinfile(filename,"") or filename - tfmtable.fontname = tfmtable.fontname or otfdata.metadata.fontname - tfmtable.fullname = tfmtable.fullname or otfdata.metadata.fullname or tfmtable.fontname - local order = otfdata and otfdata.metadata.order2 - if order == 0 then - tfmtable.format = 'opentype' - elseif order == 1 then - tfmtable.format = 'truetype' - else - tfmtable.format = specification.format - end - tfmtable.name = tfmtable.filename or tfmtable.fullname or tfmtable.fontname - if tfm.fontname_mode == "specification" then - -- not to be used in context ! - local specname = specification.specification - if specname then - tfmtable.name = specname - if trace_defining then - logs.report("define font","overloaded fontname: '%s'",specname) - end + if tfm.fontname_mode == "specification" then + -- not to be used in context ! + local specname = specification.specification + if specname then + tfmtable.name = specname + if trace_defining then + logs.report("define font","overloaded fontname: '%s'",specname) end end end diff --git a/tex/context/base/font-tra.mkiv b/tex/context/base/font-tra.mkiv index c45e1394d..e47c8c49d 100644 --- a/tex/context/base/font-tra.mkiv +++ b/tex/context/base/font-tra.mkiv @@ -27,8 +27,8 @@ \newbox\otfcollector -\def\startotfcollecting{\ctxlua{nodes.tracers.steppers.start()}} -\def\stopotfcollecting {\ctxlua{nodes.tracers.steppers.stop()}} +\unexpanded\def\startotfcollecting{\ctxlua{nodes.tracers.steppers.start()}} +\unexpanded\def\stopotfcollecting {\ctxlua{nodes.tracers.steppers.stop()}} \def\resetotfcollecting{\ctxlua{nodes.tracers.steppers.reset()}} % Rather experimental: @@ -88,12 +88,12 @@ \stoplinecorrection \blank}} -\def\startotfsample +\unexpanded\def\startotfsample {\enabletrackers[*otf.sample]% beware, kind of global \startotfcollecting \begingroup} -\def\stopotfsample +\unexpanded\def\stopotfsample {\endgroup \stopotfcollecting \disabletrackers[*otf.sample]% beware, kind of global: otf.sample diff --git a/tex/context/base/grph-fig.mkiv b/tex/context/base/grph-fig.mkiv index 5761f6081..e10dc0a32 100644 --- a/tex/context/base/grph-fig.mkiv +++ b/tex/context/base/grph-fig.mkiv @@ -15,7 +15,7 @@ \unprotect -\def\setupexternalfigures +\unexpanded\def\setupexternalfigures {\dosingleempty\dosetupexternalfigures} \def\dosetupexternalfigures[#1]% @@ -87,7 +87,7 @@ % % \defineexternalfigure[name][settings] -\def\defineexternalfigure +\unexpanded\def\defineexternalfigure {\dodoubleargument\dodefineexternalfigure} \def\dodefineexternalfigure[#1][#2]% @@ -181,7 +181,7 @@ \ifdim\scratchdimen<\xexternalfigurecollectionminheight \xexternalfigurecollectionminheight\scratchdimen \fi \fi} -\def\startexternalfigurecollection[#1]% +\unexpanded\def\startexternalfigurecollection[#1]% {\begingroup \def\currentexternalfigurecollection{#1}% \settrue\inexternalfigurecollection @@ -190,7 +190,7 @@ \xexternalfigurecollectionminheight\maxdimen \xexternalfigurecollectionmaxheight\zeropoint} -\def\stopexternalfigurecollection +\unexpanded\def\stopexternalfigurecollection {\setxvalue{\??ef:c:\currentexternalfigurecollection:\c!minwidth }{\the\xexternalfigurecollectionminwidth }% \setxvalue{\??ef:c:\currentexternalfigurecollection:\c!maxwidth }{\the\xexternalfigurecollectionmaxwidth }% \setxvalue{\??ef:c:\currentexternalfigurecollection:\c!minheight}{\the\xexternalfigurecollectionminheight}% @@ -253,7 +253,7 @@ \long\def\resourcecomment#1% {\long\gdef\currentresourcecomment{#1}} -\long\def\startresourcecomment#1\stopresourcecomment +\long\unexpanded\def\startresourcecomment#1\stopresourcecomment {\long\gdef\currentresourcecomment{#1}} \let\currentresourcecomment\empty @@ -370,7 +370,7 @@ {\hskip2em\box\colorbarbox}% \global\wd\colorbarbox\zeropoint} -\def\placestartfigure[#1][#2][#3]#4\placestopfigure[#5]% +\unexpanded\def\placestartfigure[#1][#2][#3]#4\placestopfigure[#5]% {\hbox {\setbox0\hbox {\useexternalfigure[\s!dummy][#2][#3,#5]% @@ -482,7 +482,7 @@ \long\def\dostartfigure#1% {\dotripleargument\dodostartfigure#1\stopfigure} -\def\startfigure +\unexpanded\def\startfigure {\grabuntil{\e!stop\v!figure}\dostartfigure} %D NEW: used in styledesign manual @@ -550,10 +550,10 @@ \definesystemvariable{tz} -\def\definetypesetting{\dotripleempty\dodefinetypesetting} +\unexpanded\def\definetypesetting{\dotripleempty\dodefinetypesetting} \def\typesetfile {\dotripleempty\dotypesetfile} -\def\definetypesetting{\dotripleempty\dodefinetypesetting} +\unexpanded\def\definetypesetting{\dotripleempty\dodefinetypesetting} \def\typesetfile {\dotripleempty\dotypesetfile} \def\dodefinetypesetting[#1][#2][#3]% <name> options settings-a diff --git a/tex/context/base/grph-inc.mkiv b/tex/context/base/grph-inc.mkiv index 079015a47..16ee1097a 100644 --- a/tex/context/base/grph-inc.mkiv +++ b/tex/context/base/grph-inc.mkiv @@ -54,7 +54,7 @@ %D \definegraphictypesynonym[jbg] [jb2] %D \stoptyping -\def\definegraphictypesynonym +\unexpanded\def\definegraphictypesynonym {\dodoubleargument\dodefinegraphictypesynonym} \def\dodefinegraphictypesynonym[#1][#2]% @@ -286,10 +286,10 @@ \global\setsystemmode \v!figure % todo, also: \v!resource \fi} -\def\startfoundexternalfigure#1#2% ht wd +\unexpanded\def\startfoundexternalfigure#1#2% ht wd {\global\setbox\foundexternalfigure\vbox to #2\bgroup\vss\hbox to #1\bgroup} -\def\stopfoundexternalfigure +\unexpanded\def\stopfoundexternalfigure {\hss\egroup\egroup} \def\emptyfoundexternalfigure diff --git a/tex/context/base/grph-trf.mkiv b/tex/context/base/grph-trf.mkiv index 2066f7b2f..9924a68e8 100644 --- a/tex/context/base/grph-trf.mkiv +++ b/tex/context/base/grph-trf.mkiv @@ -458,7 +458,7 @@ %D %D \showsetup{setupclipping} -\def\setupclipping +\unexpanded\def\setupclipping {\dodoubleargument\getparameters[\??cp]} \def\clip diff --git a/tex/context/base/hand-ini.mkiv b/tex/context/base/hand-ini.mkiv index 9473fecc6..0285b10cb 100644 --- a/tex/context/base/hand-ini.mkiv +++ b/tex/context/base/hand-ini.mkiv @@ -39,8 +39,8 @@ %D New stuff. -\def\setupfontexpansion {\dodoubleargument\dosetupfontexpansion } -\def\setupfontprotrusion{\dodoubleargument\dosetupfontprotrusion} +\unexpanded\def\setupfontexpansion {\dodoubleargument\dosetupfontexpansion } +\unexpanded\def\setupfontprotrusion{\dodoubleargument\dosetupfontprotrusion} \def\dosetupfontexpansion [#1][#2]{\ctxlua{commands.setupfontexpansion ("#1","#2")}} \def\dosetupfontprotrusion[#1][#2]{\ctxlua{commands.setupfontprotrusion("#1","#2")}} @@ -60,9 +60,9 @@ \appendtoks \disableadjusting \to \everyforgetall % Here or not here? \appendtoks \disableprotruding \to \everyforgetall % Here or not here? -\def\startfonthandling #1{\fonthandlingerror\fonthandlingerror\gobbleuntil\stopfonthandling} % can't happen -\def\definefonthandling {\dotripleempty\dodefinefonthandling} -\def\setupfonthandling {\dodoubleempty\dosetupfonthandling } +\unexpanded\def\startfonthandling #1{\fonthandlingerror\fonthandlingerror\gobbleuntil\stopfonthandling} % can't happen +\unexpanded\def\definefonthandling {\dotripleempty\dodefinefonthandling} +\unexpanded\def\setupfonthandling {\dodoubleempty\dosetupfonthandling } \def\dodefinefonthandling[#1][#2][#3]{\fonthandlingerror} \def\dosetupfonthandling [#1][#2]{\fonthandlingerror} \def\usehandling [#1]{\fonthandlingerror} diff --git a/tex/context/base/l-aux.lua b/tex/context/base/l-aux.lua index 7950a03a7..97063e3bc 100644 --- a/tex/context/base/l-aux.lua +++ b/tex/context/base/l-aux.lua @@ -238,6 +238,10 @@ function aux.accesstable(target) return t end +--~ function string.commaseparated(str) +--~ return gmatch(str,"([^,%s]+)") +--~ end + -- as we use this a lot ... --~ function aux.cachefunction(action,weak) diff --git a/tex/context/base/lang-ini.mkiv b/tex/context/base/lang-ini.mkiv index 920044640..45bb71b85 100644 --- a/tex/context/base/lang-ini.mkiv +++ b/tex/context/base/lang-ini.mkiv @@ -73,7 +73,7 @@ \let\currentlanguage \empty \let\currentmainlanguage\empty -\def\setupcurrentlanguage[#1]{\setcurrentlanguage\currentmainlanguage{#1}} +\unexpanded\def\setupcurrentlanguage[#1]{\setcurrentlanguage\currentmainlanguage{#1}} \def\setcurrentlanguage#1#2% sets modes: **id (currentmain) *id (current) {\edef\xaskedlanguage{#1}% otherwise clash with \askedlanguage @@ -199,7 +199,7 @@ %D %D Beware, this command can only be used when a language is installed. -\unprotected \def\setuplanguage +\unexpanded\def\setuplanguage {\dodoubleempty\dosetuplanguage} \def\dosetuplanguage[#1][#2]% handy patch for testing diff --git a/tex/context/base/lang-lab.mkiv b/tex/context/base/lang-lab.mkiv index 8df167ac8..42f2db8ff 100644 --- a/tex/context/base/lang-lab.mkiv +++ b/tex/context/base/lang-lab.mkiv @@ -46,9 +46,9 @@ \let\currenttextprefixtag \s!unknown \let\currenttextprefixclass\s!unknown -\def\setupheadtext {\setfalse\protecttextprefixes\let\currenttextprefixclass\??mh\dodoubleempty\dosetupsometextprefix} -\def\setuplabeltext {\setfalse\protecttextprefixes\let\currenttextprefixclass\??ml\dodoubleempty\dosetupsometextprefix} -\def\setupmathlabeltext{\setfalse\protecttextprefixes\let\currenttextprefixclass\??mm\dodoubleempty\dosetupsometextprefix} +\unexpanded\def\setupheadtext {\setfalse\protecttextprefixes\let\currenttextprefixclass\??mh\dodoubleempty\dosetupsometextprefix} +\unexpanded\def\setuplabeltext {\setfalse\protecttextprefixes\let\currenttextprefixclass\??ml\dodoubleempty\dosetupsometextprefix} +\unexpanded\def\setupmathlabeltext{\setfalse\protecttextprefixes\let\currenttextprefixclass\??mm\dodoubleempty\dosetupsometextprefix} \def\dosetupsometextprefix[#1][#2]% {\ifsecondargument diff --git a/tex/context/base/lang-mis.mkiv b/tex/context/base/lang-mis.mkiv index 0a9d386da..0df45877b 100644 --- a/tex/context/base/lang-mis.mkiv +++ b/tex/context/base/lang-mis.mkiv @@ -363,7 +363,7 @@ \unexpanded\def\doindirectdiscretionary#1% {\prewordbreak\discretionary{\hbox{#1}}{}{\hbox{#1}}\allowbreak\postwordbreak} -\def\definetextmodediscretionary #1 +\unexpanded\def\definetextmodediscretionary #1 {\setvalue{\@tmd@action@\detokenize{#1}}} % \start \hsize 1mm diff --git a/tex/context/base/lang-wrd.mkiv b/tex/context/base/lang-wrd.mkiv index 774c2d335..b6fc6a9d3 100644 --- a/tex/context/base/lang-wrd.mkiv +++ b/tex/context/base/lang-wrd.mkiv @@ -34,10 +34,10 @@ \def\doloadspellchecklist[#1][#2]% {\ctxlua{languages.words.load("#1","#2")}} -\def\setupspellchecking +\unexpanded\def\setupspellchecking {\dosingleargument\dosetupspellchecking} -\def\setupspellchecking[#1]% todo colors +\unexpanded\def\setupspellchecking[#1]% todo colors {\getparameters[\??wl][#1]% \doifelse\@@wlstate\v!start {\ctxlua{languages.words.enable(\@@wlmethod)}} diff --git a/tex/context/base/luat-ini.mkiv b/tex/context/base/luat-ini.mkiv index 833a3e66a..c9d88bf4f 100644 --- a/tex/context/base/luat-ini.mkiv +++ b/tex/context/base/luat-ini.mkiv @@ -44,8 +44,8 @@ \long\def\dodostartluacode#1\stopluacode {\normalexpanded{\endgroup\noexpand\directlua\zerocount{#1}}} -\def\startlua {\dostartlua } % tex catcodes -\def\startluacode{\dostartluacode} % lua catcodes +\unexpanded\def\startlua {\dostartlua } % tex catcodes +\unexpanded\def\startluacode{\dostartluacode} % lua catcodes %D Some delayed definitions: @@ -134,7 +134,7 @@ \obeyluatokens \csname dodostartnamed#1\v!code\endcsname} -\def\definenamedlua[#1]#2[#3]% no optional arg handling here yet +\unexpanded\def\definenamedlua[#1]#2[#3]% no optional arg handling here yet {\scratchcounter\ctxlua{lua.registername("#1","#3")}% \normalexpanded{\long\edef\csname dodostartnamed#1\v!code\endcsname##1\csname\e!stop#1\v!code\endcsname}% {\endgroup\noexpand\directlua\the\scratchcounter{protect("#1\s!data")##1}}% @@ -209,7 +209,7 @@ %D Experimental: -\def\startluaparameterset[#1]% +\unexpanded\def\startluaparameterset[#1]% {\begingroup \obeylualines \obeyluatokens diff --git a/tex/context/base/lxml-ctx.mkiv b/tex/context/base/lxml-ctx.mkiv index 44d95ba96..73d082d0d 100644 --- a/tex/context/base/lxml-ctx.mkiv +++ b/tex/context/base/lxml-ctx.mkiv @@ -29,7 +29,7 @@ \definehead[lshowtitle][subsubsubsubsubject] \setuphead[lshowtitle][style=\tta] -% \def\setuplxmlshow[#1]% +% \unexpanded\def\setuplxmlshow[#1]% % {\dodoubleargument\getparameters[\??xl]} \def\xmllshow#1% diff --git a/tex/context/base/lxml-ini.mkiv b/tex/context/base/lxml-ini.mkiv index b0fc39680..0f04d0488 100644 --- a/tex/context/base/lxml-ini.mkiv +++ b/tex/context/base/lxml-ini.mkiv @@ -222,10 +222,10 @@ % \xmlsetfunction{main}{verbatim}{lxml.displayverbatim} % \xmlsetfunction{main}{verb} {lxml.inlineverbatim} -% \def\startxmldisplayverbatim[#1]{} -% \def\stopxmldisplayverbatim {} -% \def\startxmlinlineverbatim [#1]{} -% \def\stopxmlinlineverbatim {} +% \unexpanded\def\startxmldisplayverbatim[#1]{} +% \unexpanded\def\stopxmldisplayverbatim {} +% \unexpanded\def\startxmlinlineverbatim [#1]{} +% \unexpanded\def\stopxmlinlineverbatim {} % we use an xml: namespace so one has to define a suitable verbatim, say % @@ -233,17 +233,17 @@ % % this is experimental! -\def\startxmldisplayverbatim[#1]% +\unexpanded\def\startxmldisplayverbatim[#1]% {\startpacked % \begingroup \let\currenttypingclass\??tp \edef\currenttyping{xml:#1}% - \def\stopxmldisplayverbatim + \unexpanded\def\stopxmldisplayverbatim {\endofverbatimlines \stoppacked} % \endgroup \doinitializeverbatim \beginofverbatimlines} -\def\startxmlinlineverbatim[#1]% +\unexpanded\def\startxmlinlineverbatim[#1]% {\begingroup \let\currenttypingclass\??ty \edef\currenttyping{xml:#1}% @@ -254,14 +254,14 @@ \newtoks \collectingtoks -\def\startcollect#1\stopcollect +\unexpanded\def\startcollect#1\stopcollect {\collectingtoks\@EA{\the\collectingtoks#1}} -\def\startexpandedcollect#1\stopexpandedcollect +\unexpanded\def\startexpandedcollect#1\stopexpandedcollect {\normalexpanded{\collectingtoks{\the\collectingtoks#1}}} -\def\startcollecting{\collectingtoks\emptytoks} -\def\stopcollecting {\the\collectingtoks} +\unexpanded\def\startcollecting{\collectingtoks\emptytoks} +\unexpanded\def\stopcollecting {\the\collectingtoks} \def\inlinemessage #1{\dontleavehmode{\tttf#1}} \def\displaymessage#1{\blank\inlinemessage{#1}\blank} @@ -287,7 +287,7 @@ \newtoks\everysetupxml -\def\setupxml[#1]{\getparameters[\??xm][#1]\the\everysetupxml} +\unexpanded\def\setupxml[#1]{\getparameters[\??xm][#1]\the\everysetupxml} \letvalue{\??xm:\s!default:\v!normal}\zerocount diff --git a/tex/context/base/math-ali.mkiv b/tex/context/base/math-ali.mkiv index fcf5b4cc5..31f71219a 100644 --- a/tex/context/base/math-ali.mkiv +++ b/tex/context/base/math-ali.mkiv @@ -153,7 +153,7 @@ %D Here we implement the user interface part. -\def\setupmathalignment +\unexpanded\def\setupmathalignment {\dodoubleempty\dosetupmathalignment} \def\dosetupmathalignment[#1][#2]% @@ -240,7 +240,7 @@ {\finishalignno \popmacro\doalignNC} -\def\definemathalignment +\unexpanded\def\definemathalignment {\dodoubleempty\dodefinemathalignment} \def\dodefinemathalignment[#1]% [#2]% @@ -440,7 +440,7 @@ %D %D Another wish \unknown -\def\setupmathcases +\unexpanded\def\setupmathcases {\dodoubleempty\dosetupmathcases} \def\dosetupmathcases[#1][#2]% @@ -500,7 +500,7 @@ \mathcasesparameter\c!right \endgroup} -\def\definemathcases +\unexpanded\def\definemathcases {\dodoubleempty\dodefinemathcases} \def\dodefinemathcases[#1]% [#2]% @@ -556,7 +556,7 @@ %D %D Yet another one \unknown -\def\setupmathmatrix +\unexpanded\def\setupmathmatrix {\dodoubleempty\dosetupmathmatrix} \def\dosetupmathmatrix[#1][#2]% @@ -606,7 +606,7 @@ \buildmathmatrix \halign \@EA \bgroup\the\scratchtoks \crcr} -\def\definemathmatrix +\unexpanded\def\definemathmatrix {\dodoubleempty\dodefinemathmatrix} \def\dodefinemathmatrix[#1]% [#2]% @@ -806,11 +806,11 @@ %D %D Just a handy keystroke safer: -\def\startmatrices +\unexpanded\def\startmatrices {\begingroup \setupmathmatrix} -\def\stopmatrices +\unexpanded\def\stopmatrices {\endgroup} %D \startbuffer @@ -858,7 +858,7 @@ %D %D {\em example code} -\def\startintertext#1\stopintertext +\unexpanded\def\startintertext#1\stopintertext {\noalign{\dointertext{#1}}} \def\intertext#1% @@ -888,7 +888,7 @@ % %D \stopformula % %D \stoptyping -% \def\startsubstack +% \unexpanded\def\startsubstack % {\begingroup % \null % \vcenter\bgroup @@ -905,7 +905,7 @@ % \everycr\emptytoks % \halign\bgroup\hfil$\scriptstyle\mathstrut##$\hfil\crcr} -% \def\stopsubstack +% \unexpanded\def\stopsubstack % {\crcr % \egroup % \popmacro\domatrixNC @@ -944,7 +944,7 @@ %D %D \typebuffer which gives \getbuffer -\def\startsubstack +\unexpanded\def\startsubstack {\begingroup \vcenter\bgroup \baselineskip\mathstacktotal @@ -962,7 +962,7 @@ \everycr\emptytoks \halign\bgroup\hfil$\scriptstyle##$\hfil\crcr} -\def\stopsubstack +\unexpanded\def\stopsubstack {\crcr \egroup \egroup @@ -1051,16 +1051,16 @@ %D \type {\stopinnermath} can be overloaded in specialized %D modules. -\def\startinnermath +\unexpanded\def\startinnermath {\getvalue{\e!start\??fm\formulaparameter\c!align}} -\def\stopinnermath +\unexpanded\def\stopinnermath {\getvalue{\e!stop \??fm\formulaparameter\c!align}} \def\mathinnerstrut {\doif{\formulaparameter\c!strut}\v!yes\strut} -\long\def\defineinnermathhandler#1#2#3% +\long\unexpanded\def\defineinnermathhandler#1#2#3% {\setvalue{\e!start\??fm#1}{#2}% \setvalue{\e!stop \??fm#1}{#3}} @@ -1073,7 +1073,7 @@ \chardef\mathnumberstatus=0 % nothing normal shift_right \let\mathnumbercorrection\!!zeropoint -\def\startmathbox#1% +\unexpanded\def\startmathbox#1% {\hsize\displaywidth \global\chardef\mathnumberstatus\plusone \chardef\mathraggedstatus#1\relax @@ -1109,7 +1109,7 @@ \@leqno \fi} -\def\stopmathbox +\unexpanded\def\stopmathbox {$% \ifcase\mathraggedstatus\or\or\hfill\or\hfill\fi \egroup diff --git a/tex/context/base/math-arr.mkiv b/tex/context/base/math-arr.mkiv index 6019de4bc..389112b16 100644 --- a/tex/context/base/math-arr.mkiv +++ b/tex/context/base/math-arr.mkiv @@ -202,7 +202,7 @@ %D \NC \tex{xrightleftharpoons } \NC \xrightleftharpoons [big] \NC \NR %D \stoptable} -\def\definematharrow +\unexpanded\def\definematharrow {\doquadrupleargument\dodefinematharrow} \def\dodefinematharrow[#1][#2][#3][#4]% name type[none|both] template command @@ -358,7 +358,7 @@ %D These macros for define math-overarrows are adapted from %D \filename{amsmath.sty} -\def\definemathoverarrow +\unexpanded\def\definemathoverarrow {\dotripleargument\dodefinemathoverarrow} \def\dodefinemathoverarrow[#1][#2][#3]% @@ -383,7 +383,7 @@ %D Now the under arrows -\def\definemathunderarrow +\unexpanded\def\definemathunderarrow {\dotripleargument\dodefinemathunderarrow} %D For underarrows the default kern is 0.3ex diff --git a/tex/context/base/math-def.mkiv b/tex/context/base/math-def.mkiv index a61023eae..50c9902dd 100644 --- a/tex/context/base/math-def.mkiv +++ b/tex/context/base/math-def.mkiv @@ -356,6 +356,10 @@ \unexpanded\def\underrightarrow{\mathopwithlimits\normalunderrightarrow} \unexpanded\def\overrightarrow {\mathopwithlimits\normaloverrightarrow } +\let\normalsurd\surd + +\unexpanded\def\surd{\normalsurd{}} + % todo mathclass=punctuation ord % \Umathcode"02C="6 "0 "02C diff --git a/tex/context/base/math-for.mkiv b/tex/context/base/math-for.mkiv index ae398fcab..e33276d53 100644 --- a/tex/context/base/math-for.mkiv +++ b/tex/context/base/math-for.mkiv @@ -44,7 +44,7 @@ \newtoks \everysetupformulas -\def\setupformulas +\unexpanded\def\setupformulas {\dodoubleempty\dosetupformulas} \def\dosetupformulas[#1][#2]% @@ -69,7 +69,7 @@ \newtoks \everysetuptextformulas -\def\setuptextformulas +\unexpanded\def\setuptextformulas {\dosingleempty\dosetuptextformulas} \def\dosetuptextformulas[#1]% diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv index bda849ed6..828a6eccb 100644 --- a/tex/context/base/math-ini.mkiv +++ b/tex/context/base/math-ini.mkiv @@ -206,14 +206,14 @@ \let\mathcharacter \getvalue \let\textcharacter \getvalue -\def\definefamilysynonym {\dotripleempty\dodefinefamilysynonym} +\unexpanded\def\definefamilysynonym {\dotripleempty\dodefinefamilysynonym} \def\dodefinefamilysynonym [#1][#2][#3]{} -\def\definemathsymbol {\dosixtupleempty\dodefinemathsymbol} +\unexpanded\def\definemathsymbol {\dosixtupleempty\dodefinemathsymbol} \def\dodefinemathsymbol [#1][#2][#3][#4][#5][#6]{} -\def\definemathcharacter {\dosixtupleempty\dodefinemathcharacter} +\unexpanded\def\definemathcharacter {\dosixtupleempty\dodefinemathcharacter} \def\dodefinemathcharacter [#1][#2][#3][#4][#5][#6]{} -\def\definemathcommand +\unexpanded\def\definemathcommand {\dotripleempty\dodefinemathcommand} \def\dodefinemathcommand[#1][#2][#3]#4% command class args meaning @@ -415,7 +415,7 @@ \newtoks\everysetupmathematics -\def\setupmathematics +\unexpanded\def\setupmathematics {\dosingleargument\dosetupmathematics} \def\dosetupmathematics[#1]% @@ -464,7 +464,7 @@ \setupmathematics [lcgreek=\v!italic, - ucgreek=\v!none] + ucgreek=\v!normal] % was: none %D \macros %D {enablemathpunctuation,disablemathpunctuation} diff --git a/tex/context/base/meta-fig.mkiv b/tex/context/base/meta-fig.mkiv index b3abc9d9e..4738316da 100644 --- a/tex/context/base/meta-fig.mkiv +++ b/tex/context/base/meta-fig.mkiv @@ -43,7 +43,7 @@ \presetlocalframed[\??mg] -\def\setupMPpage +\unexpanded\def\setupMPpage {\dodoubleargument\getparameters[\??mg]} \def\startMPpage diff --git a/tex/context/base/meta-ini.mkiv b/tex/context/base/meta-ini.mkiv index 8467b960b..61acbca32 100644 --- a/tex/context/base/meta-ini.mkiv +++ b/tex/context/base/meta-ini.mkiv @@ -87,7 +87,7 @@ \def\MPinstancetoks{\csname\@@MPF::\currentMPgraphicinstance\endcsname} -\def\defineMPinstance +\unexpanded\def\defineMPinstance {\dodoubleargument\dodefineMPinstance} \def\dodefineMPinstance[#1][#2]% @@ -352,7 +352,7 @@ \def\@@meta{meta:} -\def\setupMPvariables +\unexpanded\def\setupMPvariables {\dodoubleempty\dosetupMPvariables} \def\dosetupMPvariables[#1][#2]% @@ -448,7 +448,7 @@ \let\MPshiftdrawingtrue \ignoreMPboxdepth \let\MPshiftdrawingfalse\normalMPboxdepth -\def\placeMPgraphic +\unexpanded\def\placeMPgraphic {\ifcase\MPboxmode \or % 1 \doobeyMPboxdepth @@ -477,7 +477,7 @@ \getvalue{\@@MPG\overlaystamp:#1}% \endgroup} -\long\def\startuniqueMPgraphic +\long\unexpanded\def\startuniqueMPgraphic {\dodoublegroupempty\dostartuniqueMPgraphic} \long\def\dostartuniqueMPgraphic#1#2#3\stopuniqueMPgraphic% @@ -502,13 +502,13 @@ \processMPgraphic{#3}% \endgroup} -\long\def\startuseMPgraphic +\long\unexpanded\def\startuseMPgraphic {\dodoublegroupempty\dostartuseMPgraphic} \long\def\dostartuseMPgraphic#1#2#3\stopuseMPgraphic {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}} -\long\def\startusableMPgraphic % redundant but handy +\long\unexpanded\def\startusableMPgraphic % redundant but handy {\dodoublegroupempty\dostartusableMPgraphic} \long\def\dostartusableMPgraphic#1#2#3\stopusableMPgraphic @@ -528,7 +528,7 @@ \getvalue{\@@MPG#1}% \endgroup} -\long\def\startreusableMPgraphic +\long\unexpanded\def\startreusableMPgraphic {\dodoublegroupempty\dostartreusableMPgraphic} \long\def\dostartreusableMPgraphic#1#2#3\stopreusableMPgraphic @@ -567,7 +567,7 @@ \def\overlaypagestamp {\MPpageprefix\overlaywidth:\overlayheight:\overlaydepth:\MPcolor\overlaycolor:\MPcolor\overlaylinecolor} -\long\def\startuniqueMPpagegraphic +\long\unexpanded\def\startuniqueMPpagegraphic {\dodoublegroupempty\dostartuniqueMPpagegraphic} \long\def\dostartuniqueMPpagegraphic#1#2#3\stopuniqueMPpagegraphic @@ -1172,10 +1172,10 @@ \reuseMPgraphic{\@@MPG#1@S@}% \fi} -\def\startstaticMPfigure#1#2\stopstaticMPfigure +\unexpanded\def\startstaticMPfigure#1#2\stopstaticMPfigure {\startreusableMPgraphic{\@@MPG#1@S@}#2\stopreusableMPgraphic} -\long\def\startstaticMPgraphic +\long\unexpanded\def\startstaticMPgraphic {\dodoublegroupempty\dostartstaticMPgraphic} \long\def\dostartstaticMPgraphic#1#2#3\stopstaticMPgraphic @@ -1254,7 +1254,7 @@ \newtoks \everysetupMPgraphics -\def\setupMPgraphics[#1]% +\unexpanded\def\setupMPgraphics[#1]% {\getparameters[\??mp][#1]% \the\everysetupMPgraphics} diff --git a/tex/context/base/meta-pdh.mkiv b/tex/context/base/meta-pdh.mkiv index 0736598cf..7cdd1471f 100644 --- a/tex/context/base/meta-pdh.mkiv +++ b/tex/context/base/meta-pdh.mkiv @@ -277,7 +277,7 @@ % % \def\MPspecial{\@@MPSK\@@MPSK\gMPs\nofMParguments} % -% \def\defineMPspecial#1#2% +% \unexpanded\def\defineMPspecial#1#2% % {\setvalue{\@@MPSK\@@MPSK#1}{#2}} %D Special number~1 is dedicated to \CMYK\ support. If you diff --git a/tex/context/base/meta-tex.mkiv b/tex/context/base/meta-tex.mkiv index ab4f93dae..e35f95385 100644 --- a/tex/context/base/meta-tex.mkiv +++ b/tex/context/base/meta-tex.mkiv @@ -47,7 +47,7 @@ % draw \sometxt[framed]{black} rotated 45 ; % \stopMPcode -\def\definetextext[#1]#2{\setvalue{@@st@@[#1]}{#2}\setvalue{@@st@@[#1] }{#2}} % we don't grab spaces after [#1] +\unexpanded\def\definetextext[#1]#2{\setvalue{@@st@@[#1]}{#2}\setvalue{@@st@@[#1] }{#2}} % we don't grab spaces after [#1] \long\def\sometxt#1#{\dosometxt{#1}} % grab optional [args] diff --git a/tex/context/base/mult-cld.mkiv b/tex/context/base/mult-cld.mkiv index 83fd7b484..1c5ebd34a 100644 --- a/tex/context/base/mult-cld.mkiv +++ b/tex/context/base/mult-cld.mkiv @@ -20,9 +20,9 @@ \unprotect -\def\defmkivstart#1{\normalprotected\expandafter\def\csname\e!start#1\endcsname} -\def\defmkivstop #1{\normalprotected\expandafter\def\csname\e!stop #1\endcsname} -\def\defmkiv #1{\normalprotected\expandafter\def\csname #1\endcsname} +\def\defmkivstart#1{\unexpanded\expandafter\def\csname\e!start#1\endcsname} +\def\defmkivstop #1{\unexpanded\def\csname\e!stop #1\endcsname} +\def\defmkiv #1{\unexpanded\def\csname #1\endcsname} \def\mkivflush #1{\ctxlua{context._flush_(#1)}} diff --git a/tex/context/base/mult-ini.mkiv b/tex/context/base/mult-ini.mkiv index 107597a6d..c6a1ed2ae 100644 --- a/tex/context/base/mult-ini.mkiv +++ b/tex/context/base/mult-ini.mkiv @@ -162,9 +162,9 @@ %D \def\e!name{meaning} %D \stoptyping -\def\defineinterfaceconstant #1#2{\setvalue{\c!prefix!#1}{#2}} -\def\defineinterfacevariable #1#2{\setvalue{\v!prefix!#1}{#2}} -\def\defineinterfaceelement #1#2{\setvalue{\e!prefix!#1}{#2}} +\unexpanded\def\defineinterfaceconstant #1#2{\setvalue{\c!prefix!#1}{#2}} +\unexpanded\def\defineinterfacevariable #1#2{\setvalue{\v!prefix!#1}{#2}} +\unexpanded\def\defineinterfaceelement #1#2{\setvalue{\e!prefix!#1}{#2}} %D Next come some interface independant constants: %D @@ -173,12 +173,12 @@ %D \definefileconstant {name} {meaning} %D \stoptyping -\def\definereferenceconstant #1#2{\setvalue{\r!prefix!#1}{#2}} -\def\definefileconstant #1#2{\setvalue{\f!prefix!#1}{#2}} +\unexpanded\def\definereferenceconstant #1#2{\setvalue{\r!prefix!#1}{#2}} +\unexpanded\def\definefileconstant #1#2{\setvalue{\f!prefix!#1}{#2}} %D A new one: -\def\definetypescriptconstant#1#2{\setvalue{\t!prefix!#1}{#2}} +\unexpanded\def\definetypescriptconstant#1#2{\setvalue{\t!prefix!#1}{#2}} %D And finaly we have the one argument, space saving constants %D @@ -187,8 +187,8 @@ %D \definemessageconstant {name} %D \stoptyping -\def\definesystemconstant #1{\setvalue{\s!prefix!#1}{#1}} -\def\definemessageconstant #1{\setvalue{\m!prefix!#1}{#1}} +\unexpanded\def\definesystemconstant #1{\setvalue{\s!prefix!#1}{#1}} +\unexpanded\def\definemessageconstant #1{\setvalue{\m!prefix!#1}{#1}} %D In a parameter driven system, some parameters are shared %D by more system components. In \CONTEXT\ we can distinguish @@ -199,7 +199,7 @@ %D \definesystemvariable {name} %D \stoptyping -\def\definesystemvariable#1{\setevalue{\??prefix#1}{\@@prefix#1}} +\unexpanded\def\definesystemvariable#1{\setevalue{\??prefix#1}{\@@prefix#1}} \definesystemvariable{ms} @@ -267,7 +267,7 @@ %D \stopinterface %D \stoptyping -\def\startinterface #1 +\unexpanded\def\startinterface #1 {\doifnot{#1}{all}{\doifnotinset\currentinterface{#1}{\gobbleuntil\stopinterface}}} \let\stopinterface\relax @@ -358,7 +358,7 @@ %D which puts the message text asked for in \type %D {\currentmessagetext}. -\def\startmessages #1 library: #2 % +\unexpanded\def\startmessages #1 library: #2 % {\bgroup \ifcsname\m!prefix!#2\endcsname\else\setgvalue{\m!prefix!#2}{#2}\fi \catcode13=\active @@ -671,7 +671,7 @@ %D system module. Let us define some simple setup command: %D %D \starttyping -%D \def\setupbox[#1]% +%D \unexpanded\def\setupbox[#1]% %D {\getparameters[\??bx][#1]} %D \stoptyping %D @@ -764,7 +764,7 @@ %D in these situations we could use the c||version, but for %D documentation purposes the x||alternative comes in handy. -\def\defineinterfaceconstant#1#2% +\unexpanded\def\defineinterfaceconstant#1#2% {\setvalue{\c!prefix!#1}{#2}} %D \macros @@ -793,10 +793,10 @@ %D We just ignore these: -\def\startvariables{\gobbleuntil\stopvariables} -\def\startconstants{\gobbleuntil\stopconstants} -\def\startelements {\gobbleuntil\stopelements} -\def\startcommands {\gobbleuntil\stopcommands} +\unexpanded\def\startvariables{\gobbleuntil\stopvariables} +\unexpanded\def\startconstants{\gobbleuntil\stopconstants} +\unexpanded\def\startelements {\gobbleuntil\stopelements} +\unexpanded\def\startcommands {\gobbleuntil\stopcommands} %D \macros %D {interfaced} diff --git a/tex/context/base/node-ini.mkiv b/tex/context/base/node-ini.mkiv index eea9ed16a..787259316 100644 --- a/tex/context/base/node-ini.mkiv +++ b/tex/context/base/node-ini.mkiv @@ -18,7 +18,7 @@ \newcount\filterstate \filterstate\plusone \registerctxluafile{node-ini}{1.001} -\registerctxluafile{node-mir}{1.001} +\registerctxluafile{node-dir}{1.001} \registerctxluafile{node-aux}{1.001} \registerctxluafile{node-tst}{1.001} \registerctxluafile{node-tra}{1.001} % we might split it off (module) @@ -37,7 +37,7 @@ \ifdefined \v!global \else \def\v!global{global} \fi % for metatex -\def\defineattribute +\unexpanded\def\defineattribute {\dodoubleempty\dodefineattribute} \def\dodefineattribute[#1][#2]% alternatively we can let lua do the housekeeping @@ -47,7 +47,7 @@ %\writestatus\m!systems{defining attribute #1 with number \number\lastallocatedattribute}% \doifnotinset\v!global{#2}{\appendetoks\csname @attr@#1\endcsname\attributeunsetvalue\to\attributesresetlist}} -\def\definesystemattribute +\unexpanded\def\definesystemattribute {\dodoubleempty\dodefinesystemattribute} \def\dodefinesystemattribute[#1][#2]% alternatively we can let lua do the housekeeping @@ -77,8 +77,8 @@ \def\visualizenextnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\number\nextbox,false,true)}}} \def\visualizeflatnodes{\dowithnextbox{\ctxlua{nodes.visualizebox(\number\nextbox,true,true)}}} -\def\starttracingnodes[#1]{\ctxlua{nodes.tracers.characters.start("#1")}} -\def\stoptracingnodes {\ctxlua{nodes.tracers.characters.stop()}} +\unexpanded\def\starttracingnodes[#1]{\ctxlua{nodes.tracers.characters.start("#1")}} +\unexpanded\def\stoptracingnodes {\ctxlua{nodes.tracers.characters.stop()}} % \starttext % \starttracingnodes[characters] diff --git a/tex/context/base/node-par.mkiv b/tex/context/base/node-par.mkiv index 0b58e3730..cb53e643d 100644 --- a/tex/context/base/node-par.mkiv +++ b/tex/context/base/node-par.mkiv @@ -38,18 +38,18 @@ \newcount\nofparbuilders -\def\defineparbuilder[#1]% +\unexpanded\def\defineparbuilder[#1]% {\global\advance\nofparbuilders\plusone \ctxlua{parbuilders.register("#1",\number\nofparbuilders)}% \setxvalue{\??ng:#1}{\attribute\parbuilderattribute\nofparbuilders}} -\def\startparbuilder[#1]% +\unexpanded\def\startparbuilder[#1]% {\edef\@@currentparbuilder{\number\attribute\parbuilderattribute}% \globalpushmacro\@@currentparbuilder \getvalue{\??ng:#1}% \checkparbuilders} -\def\stopparbuilder +\unexpanded\def\stopparbuilder {\ifhmode\par\fi \globalpopmacro\@@currentparbuilder \attribute\parbuilderattribute\@@currentparbuilder\relax diff --git a/tex/context/base/node-rul.mkiv b/tex/context/base/node-rul.mkiv index a14f56955..1270eb81d 100644 --- a/tex/context/base/node-rul.mkiv +++ b/tex/context/base/node-rul.mkiv @@ -68,7 +68,7 @@ \def\dobarparameter #1#2{\ifcsname\??on#1#2\endcsname\??on#1#2\else\expandafter\dobarparentparameter\csname\??on#1\s!parent\endcsname#2\fi} \def\dobarparentparameter#1#2{\ifx#1\relax\s!empty\else\dobarparameter#1#2\fi} -\def\definebar +\unexpanded\def\definebar {\dotripleempty\dodefinebar} \def\dodefinebar[#1][#2][#3]% @@ -149,7 +149,7 @@ {\csname\??on:s:\number\currentbarnesting\endcsname \global\advance\currentbarnesting\minusone} -\def\setupbars +\unexpanded\def\setupbars {\dodoubleempty\dosetupbars} \def\dosetupbars[#1][#2]% not that efficient @@ -192,7 +192,7 @@ \expandafter\let\expandafter\underbars \csname\v!underbars \endcsname \expandafter\let\expandafter\overbars \csname\v!overbars \endcsname -\def\setupunderbar[#1]% too incompatible for the moment +\unexpanded\def\setupunderbar[#1]% too incompatible for the moment {} %D This will move: (a bit duplicated) @@ -214,7 +214,7 @@ \ifx\fontattributehash \empty\else\dosetfontattribute \fontattributehash #1\fi \ifx\colorattributehash\empty\else\dosetcolorattribute\colorattributehash#2\fi} -\def\defineshift +\unexpanded\def\defineshift {\dotripleempty\dodefineshift} \def\dodefineshift[#1][#2][#3]% @@ -299,7 +299,7 @@ \unexpanded\def\stopshift {\endgroup} -\def\setupshifts +\unexpanded\def\setupshifts {\dodoubleempty\dosetupshifts} \def\dosetupshifts[#1][#2]% not that efficient diff --git a/tex/context/base/pack-box.mkiv b/tex/context/base/pack-box.mkiv index 94af540e2..6cb492aa6 100644 --- a/tex/context/base/pack-box.mkiv +++ b/tex/context/base/pack-box.mkiv @@ -103,7 +103,7 @@ \egroup}% \vbox} -\def\defineanchor +\unexpanded\def\defineanchor {\doquadrupleempty\dodefineanchor} \def\dodefineanchor[#1][#2][#3][#4]% @@ -123,7 +123,7 @@ \def\@@collectorbox{@@collectorbox} -\def\definecollector +\unexpanded\def\definecollector {\dodoubleargument\dodefinecollector} \def\dodefinecollector[#1][#2]% @@ -139,7 +139,7 @@ \c!hoffset=\!!zeropoint,\c!voffset=\!!zeropoint, \c!location=rb,\c!corner=,#2]} -\def\setupcollector +\unexpanded\def\setupcollector {\dodoubleargument\dosetupcollector} \def\dosetupcollector[#1][#2]% @@ -388,7 +388,7 @@ [#1][#2]}% {\egroup\getvalue{#1}}} -\def\defineornament +\unexpanded\def\defineornament {\dotripleempty\dodefineornament} \def\dodefineornament[#1][#2][#3]% @@ -430,7 +430,7 @@ \newcount\nofbleeds % per pag -\def\setupbleeding +\unexpanded\def\setupbleeding {\dodoubleempty\getparameters[\??bg]} \setupbleeding diff --git a/tex/context/base/pack-lyr.mkiv b/tex/context/base/pack-lyr.mkiv index 1312948b2..0cb3ee244 100644 --- a/tex/context/base/pack-lyr.mkiv +++ b/tex/context/base/pack-lyr.mkiv @@ -36,7 +36,7 @@ \ifx\undefined\defineoverlay \message{loaded to early} \wait \fi -\def\defineoverlay +\unexpanded\def\defineoverlay {\dotripleempty\dodefineoverlay} \def\dodefineoverlay[#1][#2][#3]% overlay [layer] content @@ -67,7 +67,7 @@ % todo : links/rechts -\def\definelayer +\unexpanded\def\definelayer {\dodoubleargument\dodefinelayer} \def\dodefinelayer[#1][#2]% \zeropoint ipv \!!zeropoint @@ -103,7 +103,7 @@ %D After a layer is defined, you can change its %D characteristics. -\def\setuplayer +\unexpanded\def\setuplayer {\dodoubleargument\dosetuplayer} \def\dosetuplayer[#1][#2]% @@ -214,7 +214,7 @@ \xdef\lastlayerxpos{\the\dimexpr-\MPx{lyr:#1:\layerpage}+\MPx{lyr:\the\currentlayerdata}\relax}% \xdef\lastlayerypos{\the\dimexpr \MPy{lyr:#1:\layerpage}-\MPy{lyr:\the\currentlayerdata}\relax}} -\def\definelayerpreset +\unexpanded\def\definelayerpreset {\dodoubleargument\dodefinelayerpreset} % \def\dodefinelayerpreset[#1][#2]% @@ -694,7 +694,7 @@ \c!xoffset=\!!zeropoint,% \c!yoffset=\!!zeropoint]} -\def\setuppositioning +\unexpanded\def\setuppositioning {\resetpositioning \dodoubleargument\getparameters[\??ps]} diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv index d1098d4e0..afacc2901 100644 --- a/tex/context/base/pack-rul.mkiv +++ b/tex/context/base/pack-rul.mkiv @@ -53,7 +53,7 @@ \def\dosetuplinewidth[#1]% {\assigndimension{#1}\linewidth{.2\points}{.4\points}{.6\points}} -\def\setuplinewidth +\unexpanded\def\setuplinewidth {\dosingleargument\dosetuplinewidth} %D \macros @@ -73,7 +73,7 @@ %D %D \showsetup{setupscreens} -\def\setupscreens +\unexpanded\def\setupscreens {\dodoubleargument\getparameters[\??rs]} %D We will communicate through module specific variables, current @@ -295,7 +295,7 @@ \appendtoks \oninterlineskip \to \everyoverlay -\def\defineoverlay +\unexpanded\def\defineoverlay {\dodoubleargument\dodefineoverlay} \def\dodefineoverlay[#1][#2]% @@ -624,7 +624,7 @@ \expandafter\let\csname\??ol:\the\framednesting\s!parent\endcsname\??ol \dodoubleempty\startlocalframed[\??ol:\the\framednesting]} -\def\setupframed +\unexpanded\def\setupframed {\dodoubleempty\dosetupframed} \def\dosetupframed @@ -884,7 +884,7 @@ % todo: protect local \framednames -\def\startlocalframed[#1][#2]% +\unexpanded\def\startlocalframed[#1][#2]% {\bgroup \inframedtrue \edef\@@framed{#1}% @@ -1153,7 +1153,7 @@ %D ...,bottom=\kern0pt,... %D \stoptyping -\def\stoplocalframed +\unexpanded\def\stoplocalframed {\dontshowcomposition \@@stopframedorientation % hm, wrong place ! should rotate the result (after reshape) \handleframedlocator\c!before\@@locallocation @@ -2069,7 +2069,7 @@ %D %D \showsetup{setupblackrules} -\def\setupblackrules +\unexpanded\def\setupblackrules {\dodoubleargument\getparameters[\??bj]} %D \macros @@ -2206,7 +2206,7 @@ %D %D \showsetup{setupmarginrules} -\def\setupmarginrules +\unexpanded\def\setupmarginrules {\dodoubleargument\getparameters[\??ka]} %D \macros @@ -2436,7 +2436,7 @@ \def\dosetupthinrules[#1]% {\getparameters[\??dl][#1]} -\def\setupthinrules +\unexpanded\def\setupthinrules {\dosingleargument\dosetupthinrules} \def\dothinrules[#1]% @@ -2661,7 +2661,7 @@ \setuvalue{\e!stop #1}{\dostopframedtext }% \setuvalue {#1}{\doframedtext [#1]}} -\def\defineframedtext +\unexpanded\def\defineframedtext {\dodoubleempty\dodefineframedtext} %D We define the general (and original) case by just saying: @@ -2683,7 +2683,7 @@ \getparameters[\??kd\v!framedtext][#1]% \fi} -\def\setupframedtexts +\unexpanded\def\setupframedtexts {\dodoubleempty\dosetupframedtexts} \def\dostartframedtext @@ -2830,7 +2830,7 @@ %D %D \showsetup{defineframed} -\def\defineframed +\unexpanded\def\defineframed {\dodoubleempty\dodefineframed} \def\dodefineframed[#1][#2]% @@ -2889,7 +2889,7 @@ %D The implementation looks a bit complicated due to the %D optional arguments. -\def\setuptextrules +\unexpanded\def\setuptextrules {\dodoubleargument\getparameters[\??tl]} \def\complextextrule[#1]% if needed we can make it installable @@ -2983,14 +2983,14 @@ %D The grouped commands also supports bodyfont switching: -\def\starttextrule#1% +\unexpanded\def\starttextrule#1% {\bgroup \def\dounknowntextrule{\domiddletextrule} \dotoptextrule{#1} \bgroup \doifsomething\@@tlbodyfont{\switchtobodyfont[\@@tlbodyfont]}} -\def\stoptextrule +\unexpanded\def\stoptextrule {\par \egroup \dobottomtextrule\empty @@ -3019,7 +3019,7 @@ %D \showsetup{fillinrules} %D \showsetup{setupfillinrules} -\def\setupfillinrules +\unexpanded\def\setupfillinrules {\dodoubleargument\getparameters[\??il]} \definecomplexorsimpleempty\fillinrules @@ -3102,7 +3102,7 @@ %D \showsetup{fillinline} %D \showsetup{setupfillinlines} -\def\setupfillinlines +\unexpanded\def\setupfillinlines {\dodoubleargument\getparameters[\??iv]} \definecomplexorsimpleempty\fillinline @@ -3182,7 +3182,7 @@ \let\stopbackground \relax \let\background \relax}} -\def\setupbackground +\unexpanded\def\setupbackground {\dosingleargument\dosetupbackground} %D Actually typesetting the background is implemented rather @@ -3334,7 +3334,7 @@ %D %D \typebuffer -% \def\defineframedcontent +% \unexpanded\def\defineframedcontent % {\dodoubleempty\dodefineframedcontent} % % \def\dodefineframedcontent[#1][#2]% @@ -3351,14 +3351,14 @@ % \c!right=, % #2]} % -% \def\setupframedcontent +% \unexpanded\def\setupframedcontent % {\dodoubleempty\dosetupframedcontent} % % \def\dosetupframedcontent[#1][#2]% % {\def\docommand##1{\getparameters[\??fc##1][#2]}% % \processcommacommand[#1]\docommand} % -% \def\startframedcontent[#1]% +% \unexpanded\def\startframedcontent[#1]% % {\bgroup % \doifelse{#1}\v!off % {\let\stopframedcontent\egroup} @@ -3367,7 +3367,7 @@ % \fi}} % % \def\dostartframedcontent#1% -% {\def\stopframedcontent{\dostopframedcontent{#1}}% +% {\unexpanded\def\stopframedcontent{\dostopframedcontent{#1}}% % \setbox\framebox\hbox\bgroup % \setlocalhsize % \hsize\localhsize @@ -3424,20 +3424,20 @@ \def\letframedcontentparameter#1% {\letvalue{\??fc\@@framedcontent#1}} -\def\defineframedcontent +\unexpanded\def\defineframedcontent {\dodoubleempty\dodefineframedcontent} \def\dodefineframedcontent[#1][#2]% {\getparameters[\??fc#1][\s!parent=\??fc,#2]} -\def\setupframedcontent +\unexpanded\def\setupframedcontent {\dodoubleempty\dosetupframedcontent} \def\dosetupframedcontent[#1][#2]% {\def\docommand##1{\getparameters[\??fc##1][#2]}% \processcommacommand[#1]\docommand} -\def\startframedcontent +\unexpanded\def\startframedcontent {\dosingleempty\dostartframedcontent} \def\dostartframedcontent[#1]% @@ -3447,7 +3447,7 @@ \doifnot{#1}\v!off{\dodostartframedcontent{#1}}} \def\dodostartframedcontent#1% - {\def\stopframedcontent{\dostopframedcontent{#1}}% + {\unexpanded\def\stopframedcontent{\dostopframedcontent{#1}}% \setbox\framebox\hbox\bgroup \setlocalhsize \hsize\localhsize diff --git a/tex/context/base/page-app.mkiv b/tex/context/base/page-app.mkiv index 90abf0898..7dd71cf2a 100644 --- a/tex/context/base/page-app.mkiv +++ b/tex/context/base/page-app.mkiv @@ -203,7 +203,7 @@ %D \starttext \pagefigure[two.1] \stoptext %D \stoptyping -\def\startpagefigure +\unexpanded\def\startpagefigure {\dodoubleempty\dostartpagefigure} \def\dostartpagefigure[#1][#2]% @@ -212,7 +212,7 @@ \startTEXpage[\c!offset=\@@exoffset]% \externalfigure[#1][#2]\ignorespaces} % so we can put some text below the graphic -\def\stoppagefigure +\unexpanded\def\stoppagefigure {\stopTEXpage \egroup} diff --git a/tex/context/base/page-bck.mkiv b/tex/context/base/page-bck.mkiv index de3cc1490..93400943d 100644 --- a/tex/context/base/page-bck.mkiv +++ b/tex/context/base/page-bck.mkiv @@ -407,7 +407,7 @@ %D Because the number of arguments runs from one to three, %D we need to check for it. -\def\setupbackgrounds +\unexpanded\def\setupbackgrounds {\dotripleempty\dosetupbackgrounds} \def\dosetupbackgrounds[#1][#2][#3]% diff --git a/tex/context/base/page-flw.mkiv b/tex/context/base/page-flw.mkiv index 3eb867a78..81b4fedcb 100644 --- a/tex/context/base/page-flw.mkiv +++ b/tex/context/base/page-flw.mkiv @@ -18,7 +18,7 @@ \unprotect -\def\definetextflow +\unexpanded\def\definetextflow {\dodoubleempty\dodefinetextflow} \def\dodefinetextflow[#1][#2]% flow settings @@ -47,7 +47,7 @@ \def\doiftextflow#1% {\doiftextflowelse{#1}\firstofoneargument\gobbleoneargument} -\def\starttextflow[#1]% +\unexpanded\def\starttextflow[#1]% {\doiftextflowcollectorelse{#1} {\global\setbox\textflowcollector{#1}\vbox \bgroup @@ -55,7 +55,7 @@ \hsize\textflowparameter{#1}\c!width \doifsomething{\textflowparameter{#1}\c!style}% {\doconvertfont{\textflowparameter{#1}\c!style}}% - \def\stoptextflow{\endgraf\egroup}} + \unexpanded\def\stoptextflow{\endgraf\egroup}} {\let\stoptextflow\relax}} \def\flushtextflow#1% diff --git a/tex/context/base/page-imp.mkiv b/tex/context/base/page-imp.mkiv index 684e3ba6b..a0f32ef86 100644 --- a/tex/context/base/page-imp.mkiv +++ b/tex/context/base/page-imp.mkiv @@ -108,7 +108,7 @@ \newtoks \collectedtextdata -\long\def\starttextdata#1\stoptextdata +\long\unexpanded\def\starttextdata#1\stoptextdata {\doglobal\appendtoks#1\to\collectedtextdata} \def\flushtextdata @@ -248,7 +248,7 @@ \newconditional\arrangedbackgroundokay % more ifs -> conditionals -\def\setuparranging[#1]% +\unexpanded\def\setuparranging[#1]% {\ifarrangingdisabled \else \doifelse{#1}\v!disable {\global\arrangingdisabledtrue} @@ -807,7 +807,7 @@ % #1=name #2=horizontal|vertical #3=shiftlist -\def\definepageshift +\unexpanded\def\definepageshift {\dotripleargument\dodefinepageshift} \def\dodefinepageshift[#1][#2][#3]% @@ -848,7 +848,7 @@ \next \fi} -\def\setuppageshift +\unexpanded\def\setuppageshift {\dotripleempty\dosetuppageshift} \def\dosetuppageshift[#1][#2][#3]% page|paper horizontal vertical @@ -1146,7 +1146,7 @@ %D \stoppagecomment %D \stoptyping -\def\setuppagecomment +\unexpanded\def\setuppagecomment {\dosingleempty\dosetuppagecomment} \def\dosetuppagecomment[#1]% @@ -1181,7 +1181,7 @@ \def\@@pcprintpapersize{\printpapersize} -\def\placepagecommentTB +\unexpanded\def\placepagecommentTB {\vbox to \printpaperheight {%\forgetall \hsize\printpaperwidth @@ -1199,7 +1199,7 @@ \doifelse\@@pclocation\v!bottom\vss{\vskip\dimexpr\paperheight+\@@pcdistance\relax}% \vskip\@@pcoffset}} -\def\placepagecommentLR +\unexpanded\def\placepagecommentLR {\hbox to \printpaperwidth {\hskip\@@pcoffset \doifelse\@@pclocation\v!right{\hskip\paperwidth\hskip\@@pcdistance}\hss diff --git a/tex/context/base/page-ini.mkiv b/tex/context/base/page-ini.mkiv index a02781bdf..9f80fdcc5 100644 --- a/tex/context/base/page-ini.mkiv +++ b/tex/context/base/page-ini.mkiv @@ -128,7 +128,7 @@ \ifx\dosetuplayout\undefined % overloaded in page-lay ! - \def\setuplayout{\dodoubleempty\getparameters[\??ly]} + \unexpanded\def\setuplayout{\dodoubleempty\getparameters[\??ly]} \fi @@ -586,7 +586,7 @@ \space#1:\space\ascii\space \!!doneatrue}} -\def\placeversioninfo % nog engels maken +\unexpanded\def\placeversioninfo % nog engels maken {\ifcase\conceptmode % 0 : nothing \or @@ -1240,7 +1240,7 @@ % \definepagebreak[instance][forsure] % \definepagebreak[forsure][yes,+4] -\def\definepagebreak +\unexpanded\def\definepagebreak {\dodoubleargument\dodefinepagebreak} \def\dodefinepagebreak[#1][#2]% non recursive, meant for simple mappings @@ -1257,7 +1257,7 @@ \long\def\installcolumnbreakhandler#1#2#3% #1=otr-id #2=tag {\long\setvalue{\??cn:#1:#2}{#3}} -\def\definecolumnbreak +\unexpanded\def\definecolumnbreak {\dodoubleargument\dodefinecolumnbreak} \def\dodefinecolumnbreak[#1][#2]% non recursive, meant for simple mappings @@ -1458,10 +1458,10 @@ \newbox\facingpage -\def\setupoppositeplacing +\unexpanded\def\setupoppositeplacing {\dodoubleargument\getparameters[\??np]} -\def\startopposite +\unexpanded\def\startopposite {\dowithnextboxcontent {\hsize\makeupwidth}% {\global\setbox\facingpage\vbox @@ -1474,7 +1474,7 @@ \box\nextbox}}% \vbox\bgroup} -\def\stopopposite +\unexpanded\def\stopopposite {\egroup} \def\finishfacingpage diff --git a/tex/context/base/page-lay.mkiv b/tex/context/base/page-lay.mkiv index dd118b5dc..28f9be594 100644 --- a/tex/context/base/page-lay.mkiv +++ b/tex/context/base/page-lay.mkiv @@ -202,10 +202,10 @@ %D %D \showsetup{definepapersize} -\def\definepapersize +\unexpanded\def\definepapersize {\dodoubleempty\dodefinepapersize} -\def\definepapersize +\unexpanded\def\definepapersize {\dotripleempty\dodefinepapersize} \def\dodefinepapersize[#1][#2][#3]% @@ -275,7 +275,7 @@ \def\paperscale{1} \newif\ifnegateprintbox -\def\setuppaper[#1]% +\unexpanded\def\setuppaper[#1]% {\getparameters[\??pp][\c!paper=,\c!page=,#1]% \edef\@@ppxy{\the\numexpr\@@ppnx*\@@ppny\relax}% \doifelsenothing\@@pppage @@ -286,7 +286,7 @@ {\dodosetuppapersize[\@@pppage][\printpapersize]} {\dodosetuppapersize[\@@pppage][\@@pppaper]}}} -\def\setuppapersize +\unexpanded\def\setuppapersize {\dodoubleempty\dosetuppapersize} \def\dosetuppapersize[#1][#2]% @@ -424,7 +424,7 @@ % \def\checkforems[#1]% % {\processcommalist[#1]\docheckforems} -\ifx\setups\undefined \def\setups[#1]{\setdefaultpenalties} \fi +\ifx\setups\undefined \unexpanded\def\setups[#1]{\setdefaultpenalties} \fi % \newtoks \everybeforelayout \relax % \newtoks \everyafterlayout \relax @@ -653,7 +653,7 @@ \v!doublesided=>\doublesidedprinttrue, \v!singlesided=>\doublesidedprintfalse]} -\def\definelayout +\unexpanded\def\definelayout {\dodoubleargument\dodefinelayout} \def\dodefinelayout[#1][#2]% @@ -682,7 +682,7 @@ \checkcurrentlayout % here ? \presetcenterpagebox} -\def\setuplayout +\unexpanded\def\setuplayout {\dodoubleempty\dosetuplayout} \let\@@zaheight\!!zeropoint @@ -1125,11 +1125,11 @@ %D {\definelayout}, so this hack will disappear in future %D versions. -\def\startlocallayout +\unexpanded\def\startlocallayout {\globalpushmacro\restorepapersize \globalpushmacro\currentlayout} -\def\stoplocallayout +\unexpanded\def\stoplocallayout {\globalpopmacro\currentlayout \globalpopmacro\restorepapersize \restorepapersize diff --git a/tex/context/base/page-lin.mkiv b/tex/context/base/page-lin.mkiv index d0b0825c8..51f027639 100644 --- a/tex/context/base/page-lin.mkiv +++ b/tex/context/base/page-lin.mkiv @@ -128,14 +128,14 @@ \newdimen\linenumberwidth \newdimen\linenumberdistance -\def\definelinenumbering +\unexpanded\def\definelinenumbering {\dosingleempty\dodefinelinenumbering} \def\dodefinelinenumbering[#1]% {\edef\currentlinenumbering{#1}% \mkdefinetextlinenumbering} -\def\setuplinenumbering +\unexpanded\def\setuplinenumbering {\dodoubleempty\dosetuplinenumbering} \def\dosetuplinenumbering[#1][#2]% @@ -172,7 +172,7 @@ \definelinenumbering -\def\startlinenumbering +\unexpanded\def\startlinenumbering {\dodoubleempty\dostartlinenumbering} % no intermediate changes in values, define a class, otherwise each range @@ -228,7 +228,7 @@ \the\beforeeverylinenumbering \mkstarttextlinenumbering\currentlinenumbering\linenumbermode} -\def\stoplinenumbering +\unexpanded\def\stoplinenumbering {\mkstoptextlinenumbering \the\aftereverylinenumbering \endgroup} @@ -448,8 +448,8 @@ % referencing \def\someline [#1]{\mkstartlinereference{#1}\mkstoplinereference{#1}} -\def\startline[#1]{\mkstartlinereference{#1}} -\def\stopline [#1]{\mkstoplinereference {#1}} +\unexpanded\def\startline[#1]{\mkstartlinereference{#1}} +\unexpanded\def\stopline [#1]{\mkstoplinereference {#1}} \def\mkshowstartlinereference#1% {\ifconditional\tracelinenumbering diff --git a/tex/context/base/page-mak.mkiv b/tex/context/base/page-mak.mkiv index fbacea844..fd89a45ff 100644 --- a/tex/context/base/page-mak.mkiv +++ b/tex/context/base/page-mak.mkiv @@ -34,7 +34,7 @@ %D \showsetup{setupmakeup} %D \showsetup{startmakeup} -\def\definemakeup +\unexpanded\def\definemakeup {\dodoubleargument\dodefinemakeup} \def\dodefinemakeup[#1][#2]% @@ -64,7 +64,7 @@ \setvalue{\e!start#1\e!makeup}{\startmakeup[#1]}% \setvalue{\e!stop #1\e!makeup}{\stopmakeup}} -\def\setupmakeup +\unexpanded\def\setupmakeup {\dodoubleargument\dosetupmakeup} \def\dosetupmakeup[#1]% @@ -84,7 +84,7 @@ \let\currentmakeup\empty -\def\startmakeup +\unexpanded\def\startmakeup {\dodoubleempty\dostartmakeup} \def\dostartmakeup[#1][#2]% @@ -198,7 +198,7 @@ %D by setting their associated status variables. The %D connection between them is made by the following macro -\def\setupmakeuplayout +\unexpanded\def\setupmakeuplayout {\setupfooter[\c!state=\makeupparameter\c!footerstate]% \setupheader[\c!state=\makeupparameter\c!headerstate]% \setuptext [\c!state=\makeupparameter\c!textstate]% diff --git a/tex/context/base/page-mar.mkiv b/tex/context/base/page-mar.mkiv index 09f0d7e6b..464b4f9bb 100644 --- a/tex/context/base/page-mar.mkiv +++ b/tex/context/base/page-mar.mkiv @@ -46,7 +46,7 @@ %D therefore embed them in some macro's that (force and) %D remove the indentation and restore it afterwards. -\def\definemarginline +\unexpanded\def\definemarginline {\dodoubleargument\dodefinemarginline} \def\dodefinemarginline[#1][#2]% @@ -193,7 +193,7 @@ \newcount\margincontentlevel \newdimen\margincontentheight -\def\setupinmargin +\unexpanded\def\setupinmargin {\dodoubleempty\dosetupinmargin} \def\dosetupinmargin[#1][#2]% @@ -436,7 +436,7 @@ \makemargintextblock\v!right\v!left{#2}% \rlap{\placemargincontentseparator}}} -\def\placemargincontentseparator +\unexpanded\def\placemargincontentseparator {\ifnum\margincontentlevel>\zerocount \ifx\margincontentseparator\empty\else \bgroup @@ -499,7 +499,7 @@ {\dodoinmargin[#1][#2][#3][#4][#5]} {\dodoinmargin[#1][#2][#3][][#4]}} -\def\defineinmargin +\unexpanded\def\defineinmargin {\doquadrupleempty\dodefineinmargin} \def\dodefineinmargin[#1][#2][#3][#4]% @@ -761,7 +761,7 @@ \global\chardef\margintextcollected\zerocount \global\collectedmargintexts\emptytoks} -\def\placemargincontent +\unexpanded\def\placemargincontent {\ifcase\margintextcollected\else % was level check \bgroup \redoconvertfont % !! @@ -772,7 +772,7 @@ % For old times sake (i use it in project styles) we provide -\def\placemargintexts {\placemargincontent} +\unexpanded\def\placemargintexts {\placemargincontent} \def\resetmargetitels {\resetmargincontent} \def\margewoordpositie{\margewoord} % obsolete, now no longer range diff --git a/tex/context/base/page-mis.mkiv b/tex/context/base/page-mis.mkiv index bb61ad96f..f7c3d529d 100644 --- a/tex/context/base/page-mis.mkiv +++ b/tex/context/base/page-mis.mkiv @@ -32,7 +32,7 @@ \let\startmarginblock\dontstartmargeblok \let\stopmarginblock\dontstopmargeblok}} -\def\setupmarginblocks +\unexpanded\def\setupmarginblocks {\dosingleargument\dosetupmarginblocks} \newbox\marginbox @@ -64,10 +64,10 @@ \@@mbbottom}% \fi} -\def\placerightmarginblock +\unexpanded\def\placerightmarginblock {\hskip\rightmarginwidth} -\def\placeleftmarginblock +\unexpanded\def\placeleftmarginblock {\hskip\leftmarginwidth} \def\checkmarginblocks @@ -88,13 +88,13 @@ \setbox\preparedmarginbox\vbox {\@@mbbefore\box\preparedmarginbox\@@mbafter}% \def\rightmarginbox - {\def\placerightmarginblock + {\unexpanded\def\placerightmarginblock {\setbox\preparedmarginbox\hbox to \rightmarginwidth {\@@mbleft\box\preparedmarginbox\@@mbright}% \vsmashbox\preparedmarginbox \box\preparedmarginbox}}% \def\leftmarginbox - {\def\placeleftmarginblock + {\unexpanded\def\placeleftmarginblock {\setbox\preparedmarginbox\hbox to \leftmarginwidth {\@@mbright\box\preparedmarginbox\@@mbleft}% \vsmashbox\preparedmarginbox diff --git a/tex/context/base/page-mul.mkiv b/tex/context/base/page-mul.mkiv index 4cce67c3a..88ec7a5e7 100644 --- a/tex/context/base/page-mul.mkiv +++ b/tex/context/base/page-mul.mkiv @@ -1527,7 +1527,7 @@ % % \stopcolumns -\def\setupcolumns +\unexpanded\def\setupcolumns {\dosingleempty\dosetupcolumns} \def\dosetupcolumns[#1]% @@ -1620,7 +1620,7 @@ \ifdim\ctxparskip>\zeropoint\relax \setupwhitespace[\@@klblank]% \fi - \def\stopcolumns + \unexpanded\def\stopcolumns {\endmulticolumns \global\insidecolumnsfalse \endgroup @@ -1644,7 +1644,7 @@ %D interwoven and therefore to be integrated when the multi %D column modules are merged. (moved from cont-new.tex) -\def\setupcolumnspan[#1]% +\unexpanded\def\setupcolumnspan[#1]% {\getparameters[\??ks][#1]} \presetlocalframed @@ -1704,10 +1704,10 @@ %\topskipcorrection % becomes an option ! \EveryPar{\begstrut\EveryPar{}}} % also ! -\def\startcolumnspan +\unexpanded\def\startcolumnspan {\dosingleempty\dostartcolumnspan} -\def\stopcolumnspan +\unexpanded\def\stopcolumnspan {\egroup} \setupcolumns @@ -1728,7 +1728,7 @@ %D Undocumented and still under development. -\def\startsimplecolumns +\unexpanded\def\startsimplecolumns {\dosingleempty\dostartsimplecolumns} \def\dostartsimplecolumns[#1]% @@ -1742,7 +1742,7 @@ \setbox\scratchbox\vbox\bgroup \forgetall} % \blank[\v!disable] -\def\stopsimplecolumns +\unexpanded\def\stopsimplecolumns {\removebottomthings \egroup \rigidcolumnbalance\scratchbox diff --git a/tex/context/base/page-par.mkiv b/tex/context/base/page-par.mkiv index a5dea2e63..fb8631eec 100644 --- a/tex/context/base/page-par.mkiv +++ b/tex/context/base/page-par.mkiv @@ -17,7 +17,7 @@ \newcount\internalparagraphnumber -\def\setupparagraphnumbering +\unexpanded\def\setupparagraphnumbering {\dosingleempty\dosetupparagraphnumbering} \def\dosetupparagraphnumbering[#1]% diff --git a/tex/context/base/page-plg.mkiv b/tex/context/base/page-plg.mkiv index bbee2eb57..7d7612153 100644 --- a/tex/context/base/page-plg.mkiv +++ b/tex/context/base/page-plg.mkiv @@ -186,10 +186,10 @@ \setvalue{\??ly\c!method:\v!leftpage }{\getvalue{\??ly\c!method:\v!page}} \setvalue{\??ly\c!method:\v!rightpage}{\getvalue{\??ly\c!method:\v!page}} -% \long\def\startpagelayout[#1]#2\stoppagelayout +% \long\unexpanded\def\startpagelayout[#1]#2\stoppagelayout % {\long\setvalue{\??ly\c!method:#1}{#2}} -\long\def\startpagelayout +\long\unexpanded\def\startpagelayout {\bgroup\catcode`\^^M=\@@ignore\dostartpagelayout} \long\def\dostartpagelayout[#1]#2\stoppagelayout diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv index e75f7528b..cc6fbb5e6 100644 --- a/tex/context/base/page-set.mkiv +++ b/tex/context/base/page-set.mkiv @@ -268,8 +268,8 @@ \def\OTRSETerasegridcells#1#2#3#4% {\doOTRSETsetgridcells{\emptybox}{#1}{#2}{#3}{#4}{\emptybox}} -\def\setupcolumnsetlines{\doquintupleempty\dosetupcolumnsettrick[l]} -\def\setupcolumnsetstart{\doquintupleempty\dosetupcolumnsettrick[s]} +\unexpanded\def\setupcolumnsetlines{\doquintupleempty\dosetupcolumnsettrick[l]} +\unexpanded\def\setupcolumnsetstart{\doquintupleempty\dosetupcolumnsettrick[s]} \def\dosetupcolumnsettrick[#1][#2][#3][#4][#5]% tag id page col value {% not needed, is already relative @@ -1463,7 +1463,7 @@ % vanaf hier: -\def\definecolumnset +\unexpanded\def\definecolumnset {\dodoubleargument\dodefinecolumnset} \def\dodefinecolumnset[#1][#2]% @@ -1497,7 +1497,7 @@ \c!width=\getvalue{\??mc#1\c!width}, \c!distance=\getvalue{\??mc#1\c!distance}]} -\def\setupcolumnset +\unexpanded\def\setupcolumnset {\dotripleargument\dosetupcolumnset} \def\dosetupcolumnset[#1][#2][#3]% @@ -1626,7 +1626,7 @@ \let\currentcolumnset\empty \chardef\OTRSETfinish\zerocount -\def\startcolumnset +\unexpanded\def\startcolumnset {\dodoubleempty\dostartcolumnset} \def\dostartcolumnset[#1][#2]% @@ -1675,7 +1675,7 @@ \egroup} {}} -\def\stopcolumnset +\unexpanded\def\stopcolumnset {\relax \ifnum\columnsetlevel=\plusone \endgraf % needed, else wrong vsize in one par case @@ -1733,9 +1733,9 @@ % better: -\def\definecolumnsetarea {\definecolumntextarea} -\def\setupcolumnsetarea {\setupcolumntextarea} -\def\setupcolumnsetareatext{\setupcolumntextareatext} +\unexpanded\def\definecolumnsetarea {\definecolumntextarea} +\unexpanded\def\setupcolumnsetarea {\setupcolumntextarea} +\unexpanded\def\setupcolumnsetareatext{\setupcolumntextareatext} % so this will be changed @@ -2167,7 +2167,7 @@ % links rechts => odd, even, n, named -\def\definecolumntextarea +\unexpanded\def\definecolumntextarea {\dotripleempty\dodefinecolumntextarea} \def\dodefinecolumntextarea[#1][#2][#3]% y=0 is mogelijke en handig ! @@ -2193,7 +2193,7 @@ \definecolumntextarea[#1][\v!next][#2]% \fi} -\def\setupcolumntextarea +\unexpanded\def\setupcolumntextarea {\dotripleempty\dosetupcolumntextarea} \def\dosetupcolumntextarea[#1][#2][#3]% @@ -2251,7 +2251,7 @@ {\getvalue{\??mt#1#2\c!nx}}{\getvalue{\??mt#1#2\c!ny}} {\copy\placeholderboxd}} -\def\placecolumntextareas +\unexpanded\def\placecolumntextareas {\ifodd\realpageno \doplacecolumntextareas\columnrightareas\v!right \else @@ -2363,7 +2363,7 @@ \OTRSETsetgridcell\!!counta\!!countb\box0% \fi} -\def\setupcolumntextareatext +\unexpanded\def\setupcolumntextareatext {\dotripleempty\dosetupcolumntextareatext} \long\def\dosetupcolumntextareatext[#1][#2][#3]% @@ -2418,7 +2418,7 @@ {\!!counta#1\!!countb#2\docalculatecolumnsetspan \edef\columnsetspanhsize{\the\!!widtha}} -\def\definecolumnsetspan +\unexpanded\def\definecolumnsetspan {\dodoubleempty\dodefinecolumnsetspan} \def\dodefinecolumnsetspan[#1][#2]% @@ -2445,7 +2445,7 @@ \definecolumnsetspan[\s!default] -\def\setupcolumnsetspan +\unexpanded\def\setupcolumnsetspan {\dodoubleempty\dosetupcolumnsetspan} \def\dosetupcolumnsetspan[#1][#2]% @@ -2455,7 +2455,7 @@ \setupcolumnsetspan[\s!default][#1]% \fi} -\def\startcolumnsetspan +\unexpanded\def\startcolumnsetspan {\dotripleempty\dostartcolumnsetspan} %%%%%%%%%%%%%%%% TODO @@ -2496,7 +2496,7 @@ \ifnum\columnsetlevel>\zerocount \framedtextparameter{cs:#1}\c!before \fi - \def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}} + \unexpanded\def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}} \def\dostopcolumnsetspan#1% {\par diff --git a/tex/context/base/page-spr.mkiv b/tex/context/base/page-spr.mkiv index 4436ddcc2..75b91dff7 100644 --- a/tex/context/base/page-spr.mkiv +++ b/tex/context/base/page-spr.mkiv @@ -59,14 +59,14 @@ \null \page \fi \fi } -\def\startspread +\unexpanded\def\startspread {\bgroup \ifdoublesided \page[\v!left]% %\setsystemmode{spread}% \inspreadtrue \expanded{\setuplayout[\c!textwidth=\the\dimexpr2\textwidth+2\backspace\relax]}% - \def\startspread{\bgroup\let\stopspread\egroup}% + \unexpanded\def\startspread{\bgroup\let\stopspread\egroup}% \let\stopspread\dostopspread \else \let\stopspread\egroup diff --git a/tex/context/base/page-str.mkiv b/tex/context/base/page-str.mkiv index 4610c7f71..d73643cbe 100644 --- a/tex/context/base/page-str.mkiv +++ b/tex/context/base/page-str.mkiv @@ -59,7 +59,7 @@ \global\let\currentoutputstream\s!default \ctxlua{streams.disable()}} -\def\startoutputstream[#1]% +\unexpanded\def\startoutputstream[#1]% {\begingroup \initializeoutputstreams \the\everyenableoutputstream @@ -67,7 +67,7 @@ \xdef\currentoutputstream{#1}% \ctxlua{streams.start("#1")}} -\def\stopoutputstream +\unexpanded\def\stopoutputstream {\ctxlua{streams.stop()}% \endgroup} @@ -81,7 +81,7 @@ \def\pushoutputstream {\dosingleempty\dopushoutputstream} -% \def\defineoutputstream[#1]% +% \unexpanded\def\defineoutputstream[#1]% % {\doifundefined{otrs:#1}{\expandafter\newbox\csname otrs:#1\endcsname}} % % \def\useoutputstream[#1]% @@ -95,7 +95,7 @@ %D Obsolete in \MKIV: -\def\definemarknote {\dodoubleempty\dodefinemarknote} +\unexpanded\def\definemarknote {\dodoubleempty\dodefinemarknote} \def\dodefinemarknote[#1][#2]{} \def\setmarknote [#1]{\gobbleoneargument} \def\flushmarknotes [#1]{} diff --git a/tex/context/base/page-txt.mkiv b/tex/context/base/page-txt.mkiv index 156bcfd9c..bdc7c1bb6 100644 --- a/tex/context/base/page-txt.mkiv +++ b/tex/context/base/page-txt.mkiv @@ -64,7 +64,7 @@ %D \showsetup{setupfooter} %D \showsetup{setupbottom} -\def\setuplayouttext +\unexpanded\def\setuplayouttext {\dotripleempty\dosetuplayouttext} \def\dosetuplayouttext[#1][#2][#3]% beware, non global @@ -86,11 +86,11 @@ \fi \fi} -\def\setuptop {\dotripleempty\dosetuplayouttext[\v!top]} -\def\setupheader {\dotripleempty\dosetuplayouttext[\v!header]} -\def\setuptext {\dotripleempty\dosetuplayouttext[\v!text]} -\def\setupfooter {\dotripleempty\dosetuplayouttext[\v!footer]} -\def\setupbottom {\dotripleempty\dosetuplayouttext[\v!bottom]} +\unexpanded\def\setuptop {\dotripleempty\dosetuplayouttext[\v!top]} +\unexpanded\def\setupheader {\dotripleempty\dosetuplayouttext[\v!header]} +\unexpanded\def\setuptext {\dotripleempty\dosetuplayouttext[\v!text]} +\unexpanded\def\setupfooter {\dotripleempty\dosetuplayouttext[\v!footer]} +\unexpanded\def\setupbottom {\dotripleempty\dosetuplayouttext[\v!bottom]} %D \macros %D {noheaderandfooterlines,notopandbottomlines} @@ -125,11 +125,11 @@ %D \showsetup{setupfootertexts} %D \showsetup{setupbottomtexts} -\def\setuptoptexts {\dosixtupleempty\dosetuptexts[\v!top ]} -\def\setupheadertexts {\dosixtupleempty\dosetuptexts[\v!header ]} -\def\setuptexttexts {\dosixtupleempty\dosetuptexts[\v!text ]} -\def\setupfootertexts {\dosixtupleempty\dosetuptexts[\v!footer ]} -\def\setupbottomtexts {\dosixtupleempty\dosetuptexts[\v!bottom ]} +\unexpanded\def\setuptoptexts {\dosixtupleempty\dosetuptexts[\v!top ]} +\unexpanded\def\setupheadertexts {\dosixtupleempty\dosetuptexts[\v!header ]} +\unexpanded\def\setuptexttexts {\dosixtupleempty\dosetuptexts[\v!text ]} +\unexpanded\def\setupfootertexts {\dosixtupleempty\dosetuptexts[\v!footer ]} +\unexpanded\def\setupbottomtexts {\dosixtupleempty\dosetuptexts[\v!bottom ]} %D The left, right and center variables can also be set %D directly using the previously discussed macros. @@ -192,7 +192,7 @@ %D The next macro will be cleaned up and made less messy and %D dependent. -\def\placetextlinestrut#1% +\unexpanded\def\placetextlinestrut#1% {\doifvalue{#1\c!strut}\v!yes{\setstrut\strut}} \def\dosingletexts#1#2#3#4#5#6% @@ -255,7 +255,7 @@ \def\resettextlinestatus#1% postpone {\expandafter\gdef\csname\??tk#1\s!reset\endcsname{\global\expandafter\let\csname\??tk#1\c!state\endcsname\v!normal}} -\def\placelayouttextline#1% #2 +\unexpanded\def\placelayouttextline#1% #2 {\settextlinestatus#1% \csname\??tk::\ifcsname\??tk::\textlinestatus\endcsname\textlinestatus\else\s!unknown\fi\endcsname#1} % {#2} @@ -710,7 +710,7 @@ %D dependent) reference point. \ifx\undefined\placepositionanchors - \def\placepositionanchors{\vskip\textheight} + \unexpanded\def\placepositionanchors{\vskip\textheight} \fi %D \macros @@ -734,7 +734,7 @@ %D \chapter{tweede} \dorecurse{20}{\input tufte \relax} %D \stoptyping -\def\definetext +\unexpanded\def\definetext {\doseventupleempty\dodefinetext} \def\dodefinetext[#1][#2][#3][#4][#5][#6][#7]% diff --git a/tex/context/base/ppchtex.mkiv b/tex/context/base/ppchtex.mkiv index 8ea089627..e81551eea 100644 --- a/tex/context/base/ppchtex.mkiv +++ b/tex/context/base/ppchtex.mkiv @@ -414,7 +414,7 @@ \let\@@localchemicalstyle\empty -\def\setupchemicalformat[#1]% +\unexpanded\def\setupchemicalformat[#1]% {\processaction [\getvalue{#1\c!size}] [ \v!small=>\def\@@localchemicalformat{\scriptscriptstyle}, @@ -449,7 +449,7 @@ \setupchemicalformat[\??chemical\s!chemical]% \ignorespaces} -\def\setupchemical +\unexpanded\def\setupchemical {\dosingleargument\dosetupchemical} \def\@@dochemicalstyle% % default mapping @@ -729,11 +729,11 @@ \def\@@chemicalpostponed{}% \complexorsimpleempty\startchemical} -\def\startchemical +\unexpanded\def\startchemical {\bgroup % t.b.v. ungrouped floats \dostartchemical} -\def\stopchemical +\unexpanded\def\stopchemical {\checkchemicalpicture \@@endchemicalpicture \egroup @@ -2273,7 +2273,7 @@ {\writestatus{ppchtex}{chemical definition #1 is redefined}}% \setvalue{\??chemical#1}{#2}} -\def\definechemical% +\unexpanded\def\definechemical% {\dosingleargument\dodefinechemical} \def\getpredefinedchemical#1% diff --git a/tex/context/base/prop-ini.mkiv b/tex/context/base/prop-ini.mkiv index 10b313506..97d72582e 100644 --- a/tex/context/base/prop-ini.mkiv +++ b/tex/context/base/prop-ini.mkiv @@ -70,7 +70,7 @@ \global\advance\previouspropertylevel\minusone \global\advance\propertylevel\minusone} -\def\defineproperty +\unexpanded\def\defineproperty {\dotripleempty\dodefineproperty} \def\dodefineproperty[#1]% @@ -113,7 +113,7 @@ \def\doifelseproperty#1{\doifdefinedelse{\??py#1\c!global}} -\def\setupproperty +\unexpanded\def\setupproperty {\dodoubleempty\dosetupproperty} \def\dosetupproperty[#1][#2]% local @@ -144,7 +144,7 @@ \def\checkedpropertyparameter#1% only self {\ifcsname\??py\currentproperty#1\endcsname\csname\??py\currentproperty#1\endcsname\fi} -\def\definepropertyhandler#1{\setvalue{\??py*#1}} +\unexpanded\def\definepropertyhandler#1{\setvalue{\??py*#1}} \def\propertyhandler #1{\getvalue{\??py*#1}} \protect \endinput diff --git a/tex/context/base/prop-lay.mkiv b/tex/context/base/prop-lay.mkiv index a2d7dd265..7711dae52 100644 --- a/tex/context/base/prop-lay.mkiv +++ b/tex/context/base/prop-lay.mkiv @@ -33,12 +33,12 @@ \let\currentviewerlayer\empty \to \everypagebody -\def\startlayerproperty +\unexpanded\def\startlayerproperty {\pushmacro\currentviewerlayer % grouped (used in interaction) \let\currentlayerproperty\currentproperty % can be cross group \dotriggerviewerlayer\currentlayerproperty} -\def\stoplayerproperty +\unexpanded\def\stoplayerproperty {\popmacro\currentviewerlayer % grouped (used in interaction) \let\currentlayerproperty\previousproperty % can be cross group \dotriggerviewerlayer\currentlayerproperty} diff --git a/tex/context/base/prop-mis.mkiv b/tex/context/base/prop-mis.mkiv index 4bc9ab4c0..37c1d7973 100644 --- a/tex/context/base/prop-mis.mkiv +++ b/tex/context/base/prop-mis.mkiv @@ -29,8 +29,8 @@ % \definepropertyhandler \v!overprint {\dotriggeroverprint\v!overprint} % \definepropertyhandler \v!knockout {\dotriggeroverprint\v!knockout } % -% \def\startoverprintproperty{\dotriggeroverprint\v!overprint} -% \def\stopoverprintproperty {\dotriggeroverprint\v!knockout } +% \unexpanded\def\startoverprintproperty{\dotriggeroverprint\v!overprint} +% \unexpanded\def\stopoverprintproperty {\dotriggeroverprint\v!knockout } %D Negative cum suis. @@ -40,8 +40,8 @@ \definepropertyhandler \v!negative {\dotriggernegative\v!negative} \definepropertyhandler \v!positive {\dotriggernegative\v!positive} -\def\startnegativeproperty{\dotriggernegative\v!negative} -\def\stopnegativeproperty {\dotriggernegative\v!positive} +\unexpanded\def\startnegativeproperty{\dotriggernegative\v!negative} +\unexpanded\def\stopnegativeproperty {\dotriggernegative\v!positive} %D Special font effects. @@ -68,7 +68,7 @@ \definepropertyhandler \v!hidden {\mktriggereffect\v!hidden} \definepropertyhandler \v!stretch{\mktriggereffect\v!normal} -\def\starteffectproperty{\mktriggereffect\currentproperty} -\def\stopeffectproperty {\mktriggereffect\v!normal } +\unexpanded\def\starteffectproperty{\mktriggereffect\currentproperty} +\unexpanded\def\stopeffectproperty {\mktriggereffect\v!normal } \protect \endinput diff --git a/tex/context/base/regi-ini.mkiv b/tex/context/base/regi-ini.mkiv index 5a3be77a2..db7a224ac 100644 --- a/tex/context/base/regi-ini.mkiv +++ b/tex/context/base/regi-ini.mkiv @@ -25,7 +25,7 @@ %D \macros %D {defineregimesynonym,trueregimename} -\def\defineregimesynonym +\unexpanded\def\defineregimesynonym {\dodoubleargument\dodefineregimesynonym} \def\dodefineregimesynonym[#1][#2]% diff --git a/tex/context/base/scrn-bar.mkiv b/tex/context/base/scrn-bar.mkiv index fd274419d..dbeaf6d7f 100644 --- a/tex/context/base/scrn-bar.mkiv +++ b/tex/context/base/scrn-bar.mkiv @@ -61,8 +61,8 @@ \def\dointeractionbarparentparameter #1#2{\ifx#1\relax\s!empty\else\dointeractionbarparameter #1#2\fi} \def\dointeractionbarparentparameterhash#1#2{\ifx#1\relax \else\dointeractionbarparameterhash#1#2\fi} -\def\defineinteractionbar{\dodoubleargument\dodefineinteractionbar} -\def\setupinteractionbar {\dodoubleempty \dosetupinteractionbar} +\unexpanded\def\defineinteractionbar{\dodoubleargument\dodefineinteractionbar} +\unexpanded\def\setupinteractionbar {\dodoubleempty \dosetupinteractionbar} \def\interactionbar {\dodoubleempty \dointeractionbar} \def\dosetupinteractionbar[#1][#2]% diff --git a/tex/context/base/scrn-but.mkiv b/tex/context/base/scrn-but.mkiv index 895603c07..9a72a756b 100644 --- a/tex/context/base/scrn-but.mkiv +++ b/tex/context/base/scrn-but.mkiv @@ -39,7 +39,7 @@ %D %D \showsetup{setupbuttons} -\def\setupbuttons +\unexpanded\def\setupbuttons {\dodoubleargument\getparameters[\??bt]} \definecomplexorsimpleempty\button diff --git a/tex/context/base/scrn-fld.mkiv b/tex/context/base/scrn-fld.mkiv index 19a5ede91..f895089e8 100644 --- a/tex/context/base/scrn-fld.mkiv +++ b/tex/context/base/scrn-fld.mkiv @@ -67,7 +67,7 @@ {\def\dopresetfieldsymbols##1{\processcommalist[##1]\dopresetfieldsymbol}% \@EA\processcommalist\@EA[#1]\dopresetfieldsymbols} -\def\definedefaultsymbols +\unexpanded\def\definedefaultsymbols {\definesymbol[defaultyes][\mathematics{\times}]% \definesymbol[defaultno ][\mathematics{\cdot }]} @@ -452,7 +452,7 @@ %D And one more: -\def\definefieldstack +\unexpanded\def\definefieldstack {\dotripleargument\dodefinefieldstack} \def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings @@ -505,7 +505,7 @@ \newtoks\everysetupforms -\def\setupforms{\dosingleempty\dosetupforms} +\unexpanded\def\setupforms{\dosingleempty\dosetupforms} \def\dosetupforms[#1] {\getparameters[\??fr][#1]% @@ -520,7 +520,7 @@ %D Goodie: (unchecked in \MKIV) -\def\definepushbutton % name optional setup +\unexpanded\def\definepushbutton % name optional setup {\dodoubleempty\dodefinepushbutton} \def\dodefinepushbutton[#1][#2]% name setup @@ -533,7 +533,7 @@ {\doifsymboldefinedelse{psym:#1:#2}% \donothing{\definesymbol[psym:#1:#2][{#3}]}} -\def\definepushsymbol +\unexpanded\def\definepushsymbol {\dotripleargument\dodefinepushsymbol} \def\dodefinepushsymbol[#1][#2]% [#3] diff --git a/tex/context/base/scrn-int.mkiv b/tex/context/base/scrn-int.mkiv index e9510b6c5..11734e0d7 100644 --- a/tex/context/base/scrn-int.mkiv +++ b/tex/context/base/scrn-int.mkiv @@ -25,7 +25,7 @@ \newtoks\everysetupinteractionscreen -\def\setupinteractionscreen +\unexpanded\def\setupinteractionscreen {\dosingleempty\dosetupinteractionscreen} \def\dosetupinteractionscreen[#1]% @@ -132,9 +132,9 @@ \def\dolinkedlistparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dolinkedlistparentparameter\csname#1\s!parent\endcsname#2\fi} \def\dolinkedlistparentparameter#1#2{\ifx#1\relax\s!empty\else\dolinkedlistparameter#1#2\fi} -\def\definelinkedlist{\dodoubleargument\dodefinelinkedlist} -\def\setuplinkedlist {\dodoubleargument\dosetuplinkedlist } -\def\setuplinkedlists{\dosingleargument\dosetuplinkedlists} +\unexpanded\def\definelinkedlist{\dodoubleargument\dodefinelinkedlist} +\unexpanded\def\setuplinkedlist {\dodoubleargument\dosetuplinkedlist } +\unexpanded\def\setuplinkedlists{\dosingleargument\dosetuplinkedlists} \def\dodefinelinkedlist[#1][#2]% {\ctxlua{interactions.definelinkedlist("#1")}% @@ -200,7 +200,7 @@ \let\askedpagetransitions\empty -\def\setuppagetransitions +\unexpanded\def\setuppagetransitions {\dosingleempty\dosetuppagetransitions} \def\dosetuppagetransitions[#1]% @@ -240,10 +240,10 @@ \def\dodoflushcommentanchors {\executeifdefined{\??cc:\c!location:\@@cclocation}\hbox{\box\commentbox}} -\def\setupcomment +\unexpanded\def\setupcomment {\dodoubleargument\getparameters[\??cc]} -\def\placecomments{\box\commentcollection} % when option=buffer +\unexpanded\def\placecomments{\box\commentcollection} % when option=buffer \def\doinsertcomment#1% {\begingroup @@ -277,7 +277,7 @@ \setcurrentbuffer{\v!comment\v!buffer}% \dostartbuffer[\v!comment\v!buffer][\v!comment\v!buffer][\e!start\v!comment][\e!stop\v!comment]} -\def\stopcomment +\unexpanded\def\stopcomment {\doif\@@ccstate\v!start {\global\let\flushcommentanchors\doflushcommentanchors \global\setbox\commentbox\frozenhbox @@ -455,7 +455,7 @@ \setvalue{\??at:\v!high}#1{\struttedbox{\tbox{#1}}} -\def\setupattachments +\unexpanded\def\setupattachments {\dodoubleempty\getparameters[\??at]} \setupattachments @@ -493,7 +493,7 @@ }}% \fi} -\def\setupexternalsoundtracks +\unexpanded\def\setupexternalsoundtracks {\dodoubleargument\getparameters[\??sd]} \setupexternalsoundtracks @@ -545,7 +545,7 @@ \def\renderingwidth {8cm} \def\renderingheight {6cm} -\def\definerenderingwindow +\unexpanded\def\definerenderingwindow {\dodoubleempty\dodefinerenderingwindow} \def\dodefinerenderingwindow[#1][#2]% @@ -556,13 +556,13 @@ \c!width=\renderingwidth,\c!height=\renderingheight,% #2]} -\def\setuprenderingwindow +\unexpanded\def\setuprenderingwindow {\dodoubleargument\dosetuprenderingwindow} \def\dosetuprenderingwindow[#1]% {\getparameters[\??rw#1]} -\def\placerenderingwindow +\unexpanded\def\placerenderingwindow {\dodoubleempty\doplacerenderingwindow} \def\doplacerenderingwindow[#1][#2]% diff --git a/tex/context/base/scrn-men.mkiv b/tex/context/base/scrn-men.mkiv index 9fed11291..246d31bfd 100644 --- a/tex/context/base/scrn-men.mkiv +++ b/tex/context/base/scrn-men.mkiv @@ -87,7 +87,7 @@ \def\domenuparentparameter #1#2{\ifx#1\relax\s!empty\else\domenuparameter #1#2\fi} \def\domenuparentparameterhash#1#2{\ifx#1\relax \else\domenuparameterhash#1#2\fi} -\def\defineinteractionmenu +\unexpanded\def\defineinteractionmenu {\dotripleempty\dodefineinteractionmenu} \def\dodefineinteractionmenu[#1][#2][#3]% [name] [location] [settings] @@ -117,14 +117,14 @@ %D Setup menus: -\def\setupinteractionmenu +\unexpanded\def\setupinteractionmenu {\dodoubleargument\dosetupinteractionmenu} \def\dosetupinteractionmenu[#1][#2]% {\def\docommand##1{\getparameters[\??am##1][#2]}% \processcommalist[#1]\docommand} -\def\setupinteractionmenus[#1]% +\unexpanded\def\setupinteractionmenus[#1]% {\getparameters[\??am][#1]} %D Fill menus: @@ -157,7 +157,7 @@ \csname\??am:\c!menu:#1\endcsname \fi} -% \def\defineinteractionmenuclass +% \unexpanded\def\defineinteractionmenuclass % {\dodoubleargument\dodefineinteractionmenuclass} % % \def\dodefineinteractionmenuclass[#1][#2]% tag hori|veri @@ -574,13 +574,13 @@ % \setupinteractionmenu[\v!top ] [\c!height=\topheight ] % \setupinteractionmenu[\v!bottom] [\c!height=\bottomheight ] -\def\placeleftedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings) +\unexpanded\def\placeleftedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings) {\hbox to \leftedgewidth{\hsize\leftedgewidth\hss\interactionmenus[\v!left]}} -\def\placerightedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings) +\unexpanded\def\placerightedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings) {\hbox to \rightedgewidth{\hsize\rightedgewidth\interactionmenus[\v!right]\hss}} -\def\placetoptextblock +\unexpanded\def\placetoptextblock {\vbox to \topheight {\vsize\topheight \csname\??tk\v!top\c!before\endcsname @@ -588,7 +588,7 @@ \csname\??tk\v!top\c!after\endcsname \kern\zeropoint}} -\def\placebottomtextblock +\unexpanded\def\placebottomtextblock {\vbox to \bottomheight {\vsize\bottomheight \csname\??tk\v!bottom\c!before\endcsname diff --git a/tex/context/base/scrn-nav.mkiv b/tex/context/base/scrn-nav.mkiv index 670b52107..264e3ded2 100644 --- a/tex/context/base/scrn-nav.mkiv +++ b/tex/context/base/scrn-nav.mkiv @@ -44,7 +44,7 @@ \newtoks\everysetupinteraction -\def\setupinteraction +\unexpanded\def\setupinteraction {\dosingleargument\dodosetupinteraction} \def\dodosetupinteraction[#1]% % \dosetupinteraction == special diff --git a/tex/context/base/scrp-ini.mkiv b/tex/context/base/scrp-ini.mkiv index 0d0c2c125..6e6b10610 100644 --- a/tex/context/base/scrp-ini.mkiv +++ b/tex/context/base/scrp-ini.mkiv @@ -50,7 +50,7 @@ % when #2 == string, then only synonym, no settings -\def\definescript +\unexpanded\def\definescript {\dodoubleargument\dodefinescript} \def\dodefinescript[#1][#2]% @@ -62,7 +62,7 @@ {\getparameters[\??ls#1][\s!parent=#2]}% \setvalue{#1}{\dosetscript{#1}}} -\def\setupscript +\unexpanded\def\setupscript {\dodoubleargument\dosetupscript} \def\dosetupscript[#1][#2]% @@ -79,8 +79,8 @@ \fi} \def\setscript [#1]{\dosetscript{#1}} -\def\startscript[#1]{\begingroup\dosetscript{#1}} -\def\stopscript {\endgroup} +\unexpanded\def\startscript[#1]{\begingroup\dosetscript{#1}} +\unexpanded\def\stopscript {\endgroup} % \setscript[hangul] \hangul \startscript[hangul] diff --git a/tex/context/base/spac-ali.mkiv b/tex/context/base/spac-ali.mkiv index 9042b4ae6..b168a02be 100644 --- a/tex/context/base/spac-ali.mkiv +++ b/tex/context/base/spac-ali.mkiv @@ -66,7 +66,7 @@ \def\dodefinehbox[#1][#2]% {\setvalue{hbox#1}##1{\hbox to #2{\begstrut##1\endstrut\hss}}} -\def\definehbox +\unexpanded\def\definehbox {\dodoubleargument\dodefinehbox} \def\iobox#1#2#3#% here #3# is not really needed @@ -329,13 +329,13 @@ \framed[\c!align=\v!right]{\thepardata}}}% \endgroup} -\def\startshowpardata +\unexpanded\def\startshowpardata {\begingroup \showcomposition \showstruts\tracepositionstrue \tracingparagraphs\maxdimen \appendtoksonce\showpardata\let\showpardata\relax\to\everypar} -\def\stopshowpardata +\unexpanded\def\stopshowpardata {\endgraf \endgroup} diff --git a/tex/context/base/spac-grd.mkiv b/tex/context/base/spac-grd.mkiv index e55c7db48..bd5c51a85 100644 --- a/tex/context/base/spac-grd.mkiv +++ b/tex/context/base/spac-grd.mkiv @@ -169,7 +169,7 @@ \fi \fi} -\def\startbaselinecorrection +\unexpanded\def\startbaselinecorrection {\bgroup \let\stopbaselinecorrection\egroup \ifcase\baselinecorrectionmode @@ -248,7 +248,7 @@ \let\normalstartbaselinecorrection\startbaselinecorrection -\def\startbaselinecorrection +\unexpanded\def\startbaselinecorrection {\ifgridsnapping \snaptogrid[v!normal]\vbox\bgroup \let\stopbaselinecorrection\egroup diff --git a/tex/context/base/spac-hor.mkiv b/tex/context/base/spac-hor.mkiv index d519373dd..c1dc7a60d 100644 --- a/tex/context/base/spac-hor.mkiv +++ b/tex/context/base/spac-hor.mkiv @@ -76,7 +76,7 @@ % use \noindentation to suppress next indentation -\def\defineindentingmethod[#1]#2% +\unexpanded\def\defineindentingmethod[#1]#2% {\setvalue{\??in:#1}{#2}} \defineindentingmethod [\v!no] {\parindent\zeropoint}% was: \ctxparindent\noindent} @@ -287,7 +287,7 @@ \def\newfrenchspacing{\setfrenchspacing{1050}} \def\nonfrenchspacing{\resetfrenchspacing} -\def\definespacingmethod[#1]#2{\setvalue{\??sg\??sg#1}{#2}} +\unexpanded\def\definespacingmethod[#1]#2{\setvalue{\??sg\??sg#1}{#2}} \definespacingmethod[\v!packed]{\newfrenchspacing} \definespacingmethod[\v!broad ]{\nonfrenchspacing} @@ -462,7 +462,7 @@ \def\donarrower[#1]% hm, can be dorepeat directly {\dorepeatwithcommand[#1]\donarrowermethod} -\def\definenarrowermethod[#1]#2% +\unexpanded\def\definenarrowermethod[#1]#2% {\setvalue{\??sl:#1}{#2}} \def\donarrowermethod#1% @@ -497,11 +497,11 @@ % \advance\rightskip \dimexpr\ctxrightskip+\ctxmidskip\relax % \seteffectivehsize} % -% \def\stopnarrower +% \unexpanded\def\stopnarrower % {\@@slafter % was hard coded \par / needed, else skips forgotten % \egroup} % -% \def\setupnarrower +% \unexpanded\def\setupnarrower % {\dodoubleargument\getparameters[\??sl]} %D Contrary to \MKII\ we can now define classes of narrower (generalized @@ -519,7 +519,7 @@ \c!right=1.5em, \c!middle=1.5em] -\def\definenarrower +\unexpanded\def\definenarrower {\dodoubleempty\dodefinenarrower} \def\dodefinenarrower[#1][#2]% @@ -527,7 +527,7 @@ \setvalue{\e!start#1}{\dodoubleempty\dostartnarrower[#1]}% \setvalue{\e!stop #1}{\dostopnarrower}} -\def\setupnarrower +\unexpanded\def\setupnarrower {\dodoubleempty\dosetupnarrower} \def\dosetupnarrower[#1][#2]% @@ -629,7 +629,7 @@ %D Tolerance: -\def\definetolerancemethod +\unexpanded\def\definetolerancemethod {\dodoubleargument\dodefinetolerancemethod} \def\dodefinetolerancemethod[#1][#2]#3% @@ -655,7 +655,7 @@ {\processcommacommand[#1]\dotolerancencemethodvertical} {\processcommacommand[#1]\dotolerancencemethodhorizontal}} -\def\setuptolerance +\unexpanded\def\setuptolerance {\dosingleargument\dosetuptolerance} %D \macros @@ -781,7 +781,7 @@ \def\ignorecrlf {\let\crlf\justonespace\let\\\crlf} -\def\definehspace +\unexpanded\def\definehspace {\dotripleempty\dodefinehspace} \def\dodefinehspace[#1][#2][#3]% #1 = optional namespace diff --git a/tex/context/base/spac-pag.mkiv b/tex/context/base/spac-pag.mkiv index 10b2bd315..353afa536 100644 --- a/tex/context/base/spac-pag.mkiv +++ b/tex/context/base/spac-pag.mkiv @@ -125,7 +125,7 @@ \newcount\pagesignallevel -\def\startsignalrightpage % one may do a \postsignalrightplace +\unexpanded\def\startsignalrightpage % one may do a \postsignalrightplace {\advance\pagesignallevel\plusone \presignalrightpage \let\signalrightpage\relax @@ -134,7 +134,7 @@ \doifrightpageelse\donothing\donothing \freezepagestate} -\def\stopsignalrightpage +\unexpanded\def\stopsignalrightpage {\ifcase\pagesignallevel\or\postsignalrightpage\fi \advance\pagesignallevel\minusone} diff --git a/tex/context/base/spac-par.mkiv b/tex/context/base/spac-par.mkiv index edcf8e564..3477b1c1b 100644 --- a/tex/context/base/spac-par.mkiv +++ b/tex/context/base/spac-par.mkiv @@ -54,7 +54,7 @@ \chardef\everyparagraphintro\zerocount -\def\setupparagraphintro +\unexpanded\def\setupparagraphintro {\dodoubleempty\dosetupparagraphintro} \def\dosetupparagraphintro[#1][#2]% diff --git a/tex/context/base/spac-ver.mkiv b/tex/context/base/spac-ver.mkiv index 29633689d..75af82df7 100644 --- a/tex/context/base/spac-ver.mkiv +++ b/tex/context/base/spac-ver.mkiv @@ -87,7 +87,7 @@ % {\edef\normallineheight{\bodyfontinterlinespace}}}% % \fi} -% \def\setupspecifiedinterlinespace[#1]% +% \unexpanded\def\setupspecifiedinterlinespace[#1]% % {\getparameters[\??it][#1]% % \scratchdimen0\@@itheight\points % \advance\scratchdimen 0\@@itdepth\points @@ -120,7 +120,7 @@ {\edef\normallineheight{\bodyfontinterlinespace}}}% \fi} -\def\setupspecifiedinterlinespace[#1]% +\unexpanded\def\setupspecifiedinterlinespace[#1]% {\getparameters[\??it\currentinterlinespace][#1]% \dosetupspecifiedinterlinespaceindeed} @@ -166,7 +166,7 @@ {\assignvalue{#1}\currentrelativeinterlinespace{1.00}{1.25}{1.50}% \spacing\currentrelativeinterlinespace}} -\def\setuprelativeinterlinespace[#1]% +\unexpanded\def\setuprelativeinterlinespace[#1]% {\processcommalist[#1]\dosetuprelativeinterlinespace} \def\dosetuprelativeinterlinespace#1% @@ -200,7 +200,7 @@ \let\currentinterlinespace\empty -\def\defineinterlinespace +\unexpanded\def\defineinterlinespace {\dodoubleempty\dodefineinterlinespace} \def\dodefineinterlinespace[#1][#2]% @@ -521,7 +521,7 @@ \definesystemvariable {ws} % whitespace -\def\definewhitespacemethod[#1]#2{\setvalue{\??ws\??ws#1}{#2}} +\unexpanded\def\definewhitespacemethod[#1]#2{\setvalue{\??ws\??ws#1}{#2}} \definewhitespacemethod [\v!fix] {} \definewhitespacemethod [\v!fixed] {\setfalse\flexiblewhitespace} @@ -619,7 +619,7 @@ \let\doaroundlinecorrection\relax -\def\startlinecorrection +\unexpanded\def\startlinecorrection {\dodoubleempty\dostartlinecorrection} \def\dostartlinecorrection[#1][#2]% #2 gobbles spaces @@ -634,7 +634,7 @@ \offbaselinecorrection \ignorespaces} -\def\stoplinecorrection +\unexpanded\def\stoplinecorrection {\stopbaselinecorrection \doaroundlinecorrection \egroup} @@ -992,7 +992,7 @@ %D \NC \NC a normal strut \NC {\showstruts\setupstrut\strut} \NC \NR %D \stoptabulate -\def\setupstrut +\unexpanded\def\setupstrut {\dosingleempty\dosetupstrut} \def\dosetupstrut[#1]% yet undocumented, todo: fontstrut @@ -1361,7 +1361,7 @@ \fi \setevalue{\??gr:#1}{\attribute\snapmethodattribute\csname\currentsnapper\endcsname\space}} -\def\definegridsnapping +\unexpanded\def\definegridsnapping {\dodoubleargument\dodefinegridsnapping} \def\dodefinegridsnapping[#1][#2]% @@ -1466,7 +1466,7 @@ \def\snaptogrid {\dosingleempty\dosnaptogrid} \def\moveongrid {\dosingleempty\domoveongrid} -\def\placeongrid{\dosingleempty\doplaceongrid} +\unexpanded\def\placeongrid{\dosingleempty\doplaceongrid} \def\dodomoveongrid[#1]% {} % gone, unless we set an attribute @@ -1702,7 +1702,7 @@ \attribute\skippenaltyattribute #1\relax \flushblankhandling} -\def\startblankhandling +\unexpanded\def\startblankhandling {\par \ifvmode \expandafter\dostartblankhandling @@ -1718,7 +1718,7 @@ \setfalse\someblankdone \the\everybeforeblankhandling} -\def\stopblankhandling +\unexpanded\def\stopblankhandling {\the\everyafterblankhandling \ifconditional\someblankdone \vskip\blankskip @@ -1735,7 +1735,7 @@ % % % % we can move much to lua once we can expand there % % % % -\def\definevspacingamount +\unexpanded\def\definevspacingamount {\dotripleempty\dodefinevspacingamount} % \def\dodefinevspacingamount[#1][#2][#3]% @@ -1753,7 +1753,7 @@ {\settrue\someblankdone \advance\blankskip#1\dimexpr#2\relax} -\def\definevspacing +\unexpanded\def\definevspacing {\dodoubleempty\dodefinevspacing} \def\dodefinevspacing[#1][#2]% @@ -1884,7 +1884,7 @@ %D care as it does {\em not} work in tandem with the other spacing %D commands. -\def\definevspace +\unexpanded\def\definevspace {\dotripleempty\dodefinevspace} \def\dodefinevspace[#1][#2][#3]% @@ -1944,10 +1944,10 @@ %D \stoplines %D \stoptyping -% \def\setuplines +% \unexpanded\def\setuplines % {\dodoubleargument\getparameters[\??rg]} % -% \def\startlines +% \unexpanded\def\startlines % {\@@rgbefore % \pushmacro\checkindentation % \whitespace @@ -1968,7 +1968,7 @@ % \activatespacehandler\@@rgspace % \GotoPar} % -% \def\stoplines +% \unexpanded\def\stoplines % {\endgroup % \popmacro\checkindentation % \@@rgafter} @@ -2015,7 +2015,7 @@ \c!indenting=\v!no, \c!space=\v!default] -\def\definelines +\unexpanded\def\definelines {\dodoubleempty\dodefinelines} \def\dodefinelines[#1][#2]% @@ -2023,7 +2023,7 @@ \setvalue{\e!start#1}{\dostartlines[#1]}% \setvalue{\e!stop #1}{\dostoplines}} -\def\setuplines +\unexpanded\def\setuplines {\dodoubleempty\dosetuplines} \def\dosetuplines[#1][#2]% diff --git a/tex/context/base/strc-bkm.mkiv b/tex/context/base/strc-bkm.mkiv index 85d41f327..77854738d 100644 --- a/tex/context/base/strc-bkm.mkiv +++ b/tex/context/base/strc-bkm.mkiv @@ -55,7 +55,7 @@ %D Placement \unknown\ look how simple compared to \MKII: -\def\placebookmarks +\unexpanded\def\placebookmarks {\dodoubleempty\doplacebookmarks} \def\doplacebookmarks[#1][#2]% diff --git a/tex/context/base/strc-blk.mkiv b/tex/context/base/strc-blk.mkiv index 3d842b283..8aa856840 100644 --- a/tex/context/base/strc-blk.mkiv +++ b/tex/context/base/strc-blk.mkiv @@ -25,12 +25,12 @@ \def\blockparameter#1#2{\ifcsname\??tb#1#2\endcsname\csname\??tb#1#2\endcsname\fi} -\def\setupblockparameters{\dodoubleargument \dosetupblock} % fast one (for compatibility) -\def\setupblock {\dodoubleargumentwithset\dosetupblock} % handles set +\unexpanded\def\setupblockparameters{\dodoubleargument \dosetupblock} % fast one (for compatibility) +\unexpanded\def\setupblock {\dodoubleargumentwithset\dosetupblock} % handles set \def\dosetupblock[#1]{\getparameters[\??tb#1]} % [#1][#2]} -\def\defineblock[#1]% +\unexpanded\def\defineblock[#1]% {\processcommalist[#1]\dodefineblock} \def\dodefineblock#1% diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv index 535d63ac1..29e4ea36c 100644 --- a/tex/context/base/strc-des.mkiv +++ b/tex/context/base/strc-des.mkiv @@ -444,7 +444,7 @@ % setup descriptions -\def\setupdescriptions +\unexpanded\def\setupdescriptions {\dodoubleempty\dosetupdescriptions} \def\dosetupdescriptions[#1][#2]% % beter: \iffirstargument @@ -459,7 +459,7 @@ % define descriptions -\def\definedescription +\unexpanded\def\definedescription {\dotripleemptywithset\dodefinedescription} \def\dodefinedescription[#1][#2][#3]% to be simplified cf enumeration @@ -533,7 +533,7 @@ % setup enumerations -\def\setupenumerations +\unexpanded\def\setupenumerations {\dodoubleempty\dosetupenumerations} \def\dodosetupenumerations[#1][#2]% @@ -550,7 +550,7 @@ % define enumerations -\def\defineenumeration +\unexpanded\def\defineenumeration {\dotripleemptywithset\dodefineenumeration} \def\dodefineenumeration[#1][#2][#3]% #2 or #3 assignment @@ -892,10 +892,10 @@ % unfinished -\def\setuplabels +\unexpanded\def\setuplabels {\getparameters[\??db]} -\def\definelabel +\unexpanded\def\definelabel {\dotripleargumentwithset\dodefinelabel} \def\dodefinelabel[#1][#2][#3]% #2 or #3 assignment @@ -962,7 +962,7 @@ % to be reimplmented -\def\setupindentations +\unexpanded\def\setupindentations {\dodoubleempty\dosetupindentations} \def\dosetupindentations[#1][#2]% @@ -975,7 +975,7 @@ \def\dodosetupindentations[#1][#2]% {\getparameters[\??ds#1][#2]} -\def\defineindenting +\unexpanded\def\defineindenting {\dodoubleargumentwithset\dodefineindenting} \def\dodefineindenting[#1][#2]% diff --git a/tex/context/base/strc-flt.mkiv b/tex/context/base/strc-flt.mkiv index 89e015c46..67023d701 100644 --- a/tex/context/base/strc-flt.mkiv +++ b/tex/context/base/strc-flt.mkiv @@ -22,7 +22,7 @@ \ifdefined\addlocalbackgroundtobox\else \def\addlocalbackgroundtobox{\resetglobal\gobbleoneargument} \fi -\def\placefloats{\doflushfloats} % keep this one +\unexpanded\def\placefloats{\doflushfloats} % keep this one \let\currentfloat\empty @@ -231,7 +231,7 @@ %D Definitions: -\def\definefloat +\unexpanded\def\definefloat {\dotripleempty\dodefinefloat} \def\dodefinefloat[#1][#2][#3]% #1=naam #2=meervoud #3=parent @@ -381,9 +381,9 @@ {\letgvalue{@fl@r@#1}\relax \letgvalue{@fl@t@#1}\relax} - \def\placefloatcaptiontext [#1]{\getvalue{@fl@t@#1}} - \def\placefloatcaptionnumber [#1]{\getvalue{@fl@n@#1}} - \def\placefloatcaptionreference[#1]{\getvalue{@fl@r@#1}} + \unexpanded\def\placefloatcaptiontext [#1]{\getvalue{@fl@t@#1}} + \unexpanded\def\placefloatcaptionnumber [#1]{\getvalue{@fl@n@#1}} + \unexpanded\def\placefloatcaptionreference[#1]{\getvalue{@fl@r@#1}} % still needed for uguide @@ -450,7 +450,7 @@ % \fi % \stopsetups % -% \def\setupswithbox[#1]{\dowithnextbox{\setups[#1]}\vbox} +% \unexpanded\def\setupswithbox[#1]{\dowithnextbox{\setups[#1]}\vbox} % % test \setupswithbox[somefigure]{\framed[width=3cm] {}} test % test \setupswithbox[somefigure]{\framed[width=\dimexpr\textwidth+3cm\relax]{}} test @@ -973,7 +973,7 @@ {\flushsidefloats % hoort eigenlijk niet hier \docomplexreserveblock[#1][#2][\v!text,#3,\v!left][#4]} -\def\placefloat +\unexpanded\def\placefloat {\dotripleempty\docomplexplacefloat} \installinsertion\topins @@ -1943,16 +1943,16 @@ \def\somebackspacefloat [#1]{\somesidefloat[#1]} \def\somecutspacefloat [#1]{\somesidefloat[#1]} -\def\placesomeslotfloat {\OTRcommand\someslotfloat} -\def\placesomeherefloat {\OTRcommand\someherefloat} -\def\placesomefixdfloat {\OTRcommand\somefixdfloat} -\def\placesomepagefloat {\OTRcommand\somepagefloat} -\def\placesomeleftpagefloat {\OTRcommand\someleftpagefloat} -\def\placesomerightpagefloat{\OTRcommand\somerightpagefloat} -\def\placesometopsfloat {\OTRcommand\sometopsfloat} -\def\placesomebotsfloat {\OTRcommand\somebotsfloat} -\def\placesomesidefloat {\OTRcommand\somesidefloat} -\def\placesomefacefloat {\OTRcommand\somefacefloat} +\unexpanded\def\placesomeslotfloat {\OTRcommand\someslotfloat} +\unexpanded\def\placesomeherefloat {\OTRcommand\someherefloat} +\unexpanded\def\placesomefixdfloat {\OTRcommand\somefixdfloat} +\unexpanded\def\placesomepagefloat {\OTRcommand\somepagefloat} +\unexpanded\def\placesomeleftpagefloat {\OTRcommand\someleftpagefloat} +\unexpanded\def\placesomerightpagefloat{\OTRcommand\somerightpagefloat} +\unexpanded\def\placesometopsfloat {\OTRcommand\sometopsfloat} +\unexpanded\def\placesomebotsfloat {\OTRcommand\somebotsfloat} +\unexpanded\def\placesomesidefloat {\OTRcommand\somesidefloat} +\unexpanded\def\placesomefacefloat {\OTRcommand\somefacefloat} \def\somefixdfloat {\placesomefixdfloat} \def\somepagefloat {\placesomepagefloat} diff --git a/tex/context/base/strc-ini.mkiv b/tex/context/base/strc-ini.mkiv index 619442998..5ed7b423c 100644 --- a/tex/context/base/strc-ini.mkiv +++ b/tex/context/base/strc-ini.mkiv @@ -71,10 +71,10 @@ % level of a number in sets. This is all handles at the \LUA\ end. % References to such sets travel with the multipass information. -\def\definestructureresetset {\dotripleempty\dodefinestructureresetset} -\def\definestructureseparatorset {\dotripleempty\dodefinestructureseparatorset} -\def\definestructureconversionset{\dotripleempty\dodefinestructureconversionset} -\def\definestructureprefixset {\dotripleempty\dodefinestructureprefixset} +\unexpanded\def\definestructureresetset {\dotripleempty\dodefinestructureresetset} +\unexpanded\def\definestructureseparatorset {\dotripleempty\dodefinestructureseparatorset} +\unexpanded\def\definestructureconversionset{\dotripleempty\dodefinestructureconversionset} +\unexpanded\def\definestructureprefixset {\dotripleempty\dodefinestructureprefixset} \def\dodefinestructureresetset [#1][#2][#3]{\ctxlua{structure.sets.define("structure:resets", "#1","\luaescapestring{\detokenize{#2}}","\luaescapestring{\detokenize{#3}}",true)}} \def\dodefinestructureseparatorset [#1][#2][#3]{\ctxlua{structure.sets.define("structure:separators", "#1","\luaescapestring{\detokenize{#2}}","\luaescapestring{\detokenize{#3}}")}} diff --git a/tex/context/base/strc-itm.mkiv b/tex/context/base/strc-itm.mkiv index fcd5e6639..7207494ed 100644 --- a/tex/context/base/strc-itm.mkiv +++ b/tex/context/base/strc-itm.mkiv @@ -204,7 +204,7 @@ \setevalue{\??op\currentitemgroup#1\s!parent}{\??op\currentitemgroup}% \fi} -\def\defineitemgroup +\unexpanded\def\defineitemgroup {\dotripleempty\dodefineitemgroup} \def\dodefineitemgroup[#1][#2][#3]% todo: clone @@ -225,7 +225,7 @@ \newtoks\everysetupitemgroup -\def\setupitemgroups % [#1] +\unexpanded\def\setupitemgroups % [#1] {\dodoubleargument\getparameters[\??oo]} % [#1] \def\packitems @@ -402,7 +402,7 @@ {\def\docommand##1{\dodosetupitemgroup[##1][#2][#3][#4]}% \processcommalist[#1]\docommand} -\def\setupitemgroup +\unexpanded\def\setupitemgroup {\doquadrupleempty\dosetupitemgroup} \def\doadvanceitem @@ -513,7 +513,7 @@ \newconditional\autoconcatnextitem \settrue \autoconcatnextitem \newsignal \itemsignal -\def\startitemgroup +\unexpanded\def\startitemgroup {\dotripleempty\dostartitemgroup} \def\dostartitemgroup[#1][#2][#3]% @@ -591,7 +591,7 @@ \expandafter\flushcollecteditems \fi} -\def\stopcollectitems +\unexpanded\def\stopcollectitems {\ifconditional\randomizeitems \newcounter\itemcollectcounterdone \ifnum\itemcollectcounter>\zerocount @@ -599,7 +599,7 @@ \fi \fi} -\def\startcollectitems +\unexpanded\def\startcollectitems {\ifconditional\randomizeitems \newcounter\itemcollectcounter \letvalue{\e!start\v!item}\collectitemgroupitem @@ -607,7 +607,7 @@ %D End of plugin. -\ifx\startcolumns\undefined \def\startcolumns[#1]{} \fi +\ifx\startcolumns\undefined \unexpanded\def\startcolumns[#1]{} \fi \ifx\stopcolumns \undefined \let\stopcolumns\relax \fi \def\dosetsymalign#1% hm, we should use one of the core-spa macros or make a helper @@ -761,7 +761,7 @@ % \item \input ward \item \input ward \item \input ward % \stopitemize \blank -\def\stopitemgroup +\unexpanded\def\stopitemgroup {\stopcollectitems \ifconditional\textlistitem \removeunwantedspaces\space\ignorespaces @@ -1078,11 +1078,9 @@ \dodolapitem \fi\fi\fi \fi - \forceunexpanded % needed for m conversion (\os) / i need to look into this \setevalue{\@@currentitemsymbol\currentitemlevel}% {\getvalue{\@@localitemsymbol\currentitemlevel}}% still problems with \uchar ? %{\noexpand\getvalue{\@@localitemsymbol\currentitemlevel}}% no, spoils subrefs - \resetunexpanded \setfalse\headlistitem \setfalse\sublistitem \setfalse\symbollistitem @@ -1144,7 +1142,7 @@ \chardef\autoitemgroupspacing=2 % 0 = voor/na, 1=tussen als geen voor 2=(prev)tussen=old/normal -\unprotected\def\complexdoitemgroupitem[#1]% +\def\complexdoitemgroupitem[#1]% {\def\currentitemreference{#1}% \ifconditional\textlistitem % begin of item diff --git a/tex/context/base/strc-lnt.mkiv b/tex/context/base/strc-lnt.mkiv index 707559ac3..0df44294b 100644 --- a/tex/context/base/strc-lnt.mkiv +++ b/tex/context/base/strc-lnt.mkiv @@ -54,7 +54,7 @@ \def\dostoplinenote#1[#2]% {\stopline[#2]} -\def\definelinenote +\unexpanded\def\definelinenote {\dodoubleempty\dodefinelinenote} \def\dodefinelinenote[#1][#2]% @@ -63,7 +63,7 @@ \setuvalue{\e!start#1}{\dostartlinenote{#1}}% \setuvalue{\e!stop #1}{\dostoplinenote {#1}}} -\def\setuplinenote[#1]% convenient +\unexpanded\def\setuplinenote[#1]% convenient {\setupnote[ln:#1]} % We predefine one, namely \type {\linenote} cum suis. diff --git a/tex/context/base/strc-lst.mkiv b/tex/context/base/strc-lst.mkiv index 41bfb7822..413052882 100644 --- a/tex/context/base/strc-lst.mkiv +++ b/tex/context/base/strc-lst.mkiv @@ -127,7 +127,7 @@ % \appendtoks % \to \everystructurelist -\def\placestructurelist#1#2#3% hm ... [][][] +\unexpanded\def\placestructurelist#1#2#3% hm ... [][][] {\ctxlua{structure.lists.process("#1","#2","#3")}} \def\analysestructurelist#1#2#3% @@ -195,7 +195,7 @@ \listparameter{#1}% \fi} -\def\setuplistalternative[#1]% +\unexpanded\def\setuplistalternative[#1]% {\dodoubleargument\getparameters[\??li\??li#1]} \def\listfill {\listalternativeparameter\c!command } @@ -226,7 +226,7 @@ \def\docommand##1{\getparameters[\??li##1][#2]}% \processcommalist[#1]\docommand} -\def\setuplist +\unexpanded\def\setuplist {\dodoubleargument\dosetuplist} \def\dodefinelist[#1][#2][#3]% @@ -237,7 +237,7 @@ {\getparameters[\??li#1][\s!parent=\??li]} {\getparameters[\??li#1][\s!parent=\??li#2,#3]}}} -\def\setuplists % new, but not for users (hardly handy) +\unexpanded\def\setuplists % new, but not for users (hardly handy) {\dodoubleargument\getparameters[\??li]} \setuplists @@ -298,13 +298,13 @@ % \c!pageprefixconnector=\listparameter\c!prefixconnector, ]%\c!pagesegments=2:2] -\def\definelist +\unexpanded\def\definelist {\dotripleempty\dodefinelist} -\def\placelist +\unexpanded\def\placelist {\dodoubleempty\doplacelist} -\def\placerawlist +\unexpanded\def\placerawlist {\dodoubleempty\doplacerawlist} \def\dobeginoflist @@ -498,7 +498,7 @@ % \definelistplacement[MyListItem][none]#1#2#3% % {(#1) (#2) (#3)} -\def\definelistplacement +\unexpanded\def\definelistplacement {\dodoubleempty\dodefinelistplacement} \def\dodefinelistplacement[#1][#2]% @@ -834,7 +834,7 @@ \def\combinedlistparameter#1{\csname\??ih\currentcombinedlist#1\endcsname} -\def\setupcombinedlist +\unexpanded\def\setupcombinedlist {\dodoubleargument\dosetupcombinedlist} \def\dosetupcombinedlist[#1][#2]% @@ -842,7 +842,7 @@ \edef\currentcombinedlist{#1}% \normalexpanded{\noexpand\setuplist[\combinedlistparameter\c!list]}[#2]} -\def\definecombinedlist +\unexpanded\def\definecombinedlist {\dotripleempty\dodefinecombinedlist} \def\dodefinecombinedlist[#1][#2][#3]% @@ -853,7 +853,7 @@ \setvalue{\e!place#1}{\dodoubleempty\doplacecombinedlist[#1]}% \setvalue{\e!complete#1}{\dodoubleempty\docompletecombinedlist[#1]}} -\def\placecombinedlist +\unexpanded\def\placecombinedlist {\dodoubleempty\doplacecombinedlist} \def\doplacecombinedlist[#1][#2]% we can move much of the analysis to lua @@ -925,7 +925,7 @@ % % \definesystemvariable {ll} % ListLength % -% \def\setupremaininglistlength[#1]% +% \unexpanded\def\setupremaininglistlength[#1]% % {\getparameters[\??ll][#1]% % \globallet\listlengthcounter\!!zerocount} % diff --git a/tex/context/base/strc-mar.mkiv b/tex/context/base/strc-mar.mkiv index 65f360749..bb87051e0 100644 --- a/tex/context/base/strc-mar.mkiv +++ b/tex/context/base/strc-mar.mkiv @@ -73,7 +73,7 @@ \clearmarks#1% \fi} -\def\definenewmark#1% +\unexpanded\def\definenewmark#1% {\ifcsname\string#1:m\endcsname\else \@EA\@EA\@EA\newcount \markstatecs #1\global\markstatecs#1\plusone \@EA\@EA\@EA\renewmarks\markautocs #1% @@ -225,7 +225,7 @@ \def\dowithmarkcommandtwo#1#2#3% \command {mark} {mark} {\expandafter#1\csname\??mk:\markingcoupling{#2}\expandafter\endcsname\csname\??mk:\markingcoupling{#3}\endcsname} -\def\setupmarking +\unexpanded\def\setupmarking {\dodoubleargument\dosetupmarking} \def\dosetupmarking[#1][#2]% @@ -245,7 +245,7 @@ \let\alldefinedmarks\empty -\def\definemarking +\unexpanded\def\definemarking {\dodoubleempty\dodefinemarking} \def\dodefinemarking[#1][#2]% @@ -278,7 +278,7 @@ \def\relatemarking[#1]#2[#3]% define 1 as child of 2 {\dowithmarkcommandtwo\addmarkreset{#1}{#3}} -\def\definerawmarking[#1]% +\unexpanded\def\definerawmarking[#1]% {\dododefinemarking[#1][#1]% \getgparameters[\??mk#1][\c!limittext=]} % global ! diff --git a/tex/context/base/strc-mat.mkiv b/tex/context/base/strc-mat.mkiv index 18e0fc0e8..2064db2c5 100644 --- a/tex/context/base/strc-mat.mkiv +++ b/tex/context/base/strc-mat.mkiv @@ -116,7 +116,7 @@ \def\tracedformulamode {\hbox{\quad\tt\txx[\number\placeformulanumbermode,\number\formulasnumbermode,\number\subformulasnumbermode,\number\nestedformulanumbermode]}} -\def\placecurrentformulanumber +\unexpanded\def\placecurrentformulanumber {\rm % nodig ? \doif{\formulaparameter\c!location}\v!right{\hskip\formulaparameter\c!distance}% \formulaparameter\c!numbercommand @@ -267,7 +267,7 @@ %D -\def\defineformula +\unexpanded\def\defineformula {\dodoubleempty\dodefineformula} \def\dodefineformula[#1][#2]% @@ -277,7 +277,7 @@ \setvalue{\e!start#1\v!formula}{\dostartformula{#1}}% \setvalue{\e!stop #1\v!formula}{\dostopformula}}} -\def\defineformulaalternative +\unexpanded\def\defineformulaalternative {\dotripleargument\dodefineformulaalternative} \def\dodefineformulaalternative[#1][#2][#3]% @@ -320,7 +320,7 @@ \def\subformulaparameter#1{\ifcname\??fn#1\endcsname\cname\??fn#1\endcsname\fi} -\def\setupsubformulas +\unexpanded\def\setupsubformulas {\dodoubleargument\getparameters[\??fn]} \setupsubformulas @@ -478,7 +478,7 @@ %D \startformula x \stopformula % now has \noindent (in mkii we messed with baselineskip) %D \stoptyping -\def\startdisplaymath +\unexpanded\def\startdisplaymath {\bgroup \par \informulatrue @@ -493,7 +493,7 @@ %\setpredisplaysize \startinnermath} -\def\stopdisplaymath +\unexpanded\def\stopdisplaymath {\stopinnermath $$% \Ustopdisplaymath \par @@ -530,7 +530,7 @@ % \placeformula {f} \startspformule \fakespacingformula \stopspformule % \fakewords{20}{40} -\def\startsubformulas +\unexpanded\def\startsubformulas {\dosingleempty\dostartsubformulas} \def\dostartsubformulas[#1]% @@ -538,7 +538,7 @@ \global\settrue\insidesubformulas \handlesubformulasnumbering} -\def\stopsubformulas +\unexpanded\def\stopsubformulas {\nonoindentation \checknextindentation[\formulaparameter\c!indentnext]% \the\everyresetformulas % to be checked @@ -547,14 +547,14 @@ %D Named subformulas (to be redone) -\def\startnamedsubformulas +\unexpanded\def\startnamedsubformulas {\dosingleempty\dostartnamedsubformulas} \def\dostartnamedsubformulas[#1]#2% {\setformulalistentry{#2}% \startsubformulas[#1]} -\def\stopnamedsubformulas +\unexpanded\def\stopnamedsubformulas {\stopsubformulas} %D Experimental goodie: @@ -568,7 +568,7 @@ %D %D \typebuffer \getbuffer -\def\startformulas +\unexpanded\def\startformulas {\dosingleempty\dostartformulas} \def\dostartformulas[#1]#2\stopformulas % new / to be internationalized @@ -580,7 +580,7 @@ \forgetdisplayskips \startdisplaymath \setlocalhsize - \long\def\startformula##1\stopformula + \long\unexpanded\def\startformula##1\stopformula {\advance\scratchcounter\plusone}% \scratchcounter\zerocount #2% preroll @@ -591,8 +591,8 @@ \hss \def\normalstartformula{\vskip-\strutdepth\Ustartdisplaymath}% i hate this \def\normalstopformula {\Ustopdisplaymath}% - \def\startformula {\Ustartmath\vcenter\bgroup\normalstartformula}% - \def\stopformula {\normalstopformula\egroup\Ustopmath\hss}% + \unexpanded\def\startformula {\Ustartmath\vcenter\bgroup\normalstartformula}% + \unexpanded\def\stopformula {\normalstopformula\egroup\Ustopmath\hss}% #2% \egroup \stopdisplaymath @@ -639,12 +639,12 @@ {\def\currentformulasuffix{#1}% \dododoformulanumber} -\def\placeformula +\unexpanded\def\placeformula {\doglobal\settrue\insideplaceformula \settrue\incrementformulanumber \dodoubleempty\doplaceformula} -\def\placesubformula +\unexpanded\def\placesubformula {\doglobal\settrue\insideplacesubformula \setfalse\incrementformulanumber \dodoubleempty\doplaceformula} @@ -735,7 +735,7 @@ % todo -\def\placenamedformula +\unexpanded\def\placenamedformula {\dosingleempty\doplacenamedformula} \def\doplacenamedformula[#1]#2% diff --git a/tex/context/base/strc-not.mkiv b/tex/context/base/strc-not.mkiv index fd146d4cd..45e37b276 100644 --- a/tex/context/base/strc-not.mkiv +++ b/tex/context/base/strc-not.mkiv @@ -103,7 +103,7 @@ \newtoks\tobeprocessednotes -\def\processnotes#1% #1: \macro that uses \currentnote +\unexpanded\def\processnotes#1% #1: \macro that uses \currentnote {\def\doprocesssomenote##1{\edef\currentnote{##1}\let\currentdescription\currentnote#1}% \the\tobeprocessednotes} @@ -156,7 +156,7 @@ %D Are quite ligitimate, we default to a simple one 20\% of the %D text width. -\def\setupnotes +\unexpanded\def\setupnotes {\dodoubleargument\getparameters[\??vn]} \setupnotes @@ -206,14 +206,14 @@ \def\@@defaultnotedefloc{\v!inleft} \def\@@defaultnotedefdis{\!!zeropoint} -\def\startnotedef{\resetdescriptions\csname\e!start\??vn\??vn\currentnote\endcsname} -\def\stopnotedef {\csname\e!stop \??vn\??vn\currentnote\endcsname} +\unexpanded\def\startnotedef{\resetdescriptions\csname\e!start\??vn\??vn\currentnote\endcsname} +\unexpanded\def\stopnotedef {\csname\e!stop \??vn\??vn\currentnote\endcsname} \def\currentnoteins{\csname\??vn:\currentnote\endcsname} \newtoks \everysetupnote -\def\definenote +\unexpanded\def\definenote {\dodoubleempty\dodefinenote} \def\dodefinenote[#1][#2]% @@ -282,7 +282,7 @@ % \dochecknote % \to \everysetupnote -\def\setupnote +\unexpanded\def\setupnote {\dodoubleempty\dosetupnote} \def\dosetupnote[#1][#2]% @@ -463,7 +463,7 @@ %D A bit messy: -\def\placenoterule +\unexpanded\def\placenoterule {\bgroup \setupalign[\getvalue{\??vn\c!rule:a:\currentnote}]% \righttoleft @@ -471,7 +471,7 @@ \par \egroup} -\def\normalnoterule +\unexpanded\def\normalnoterule {\ifvmode \dontleavehmode \blackrule [ \c!color=\noteparameter\c!rulecolor, @@ -484,7 +484,7 @@ \ifx\setnotehsize\undefined - \def\setnotehsize{\hsize\noteparameter\c!width\relax} % can be overloaded + \unexpanded\def\setnotehsize{\hsize\noteparameter\c!width\relax} % can be overloaded \fi @@ -576,8 +576,8 @@ \newconditional\skipnoteplacement -\def\setnote [#1]{\getvalue{#1}} -\def\setnotetext[#1]{\global\settrue\skipnoteplacement\getvalue{#1}} +\unexpanded\def\setnote [#1]{\getvalue{#1}} +\unexpanded\def\setnotetext[#1]{\global\settrue\skipnoteplacement\getvalue{#1}} \def\domovednote#1#2#3#4% {\ifcase\ctxlua{structure.notes.deltapage("#1",#2)}\or\symbol[#3]\or\symbol[#4]\fi} @@ -645,7 +645,7 @@ \ctxlua{structure.notes.number("\currentnote",\currentnotenumber)}% \currentdescriptionnumberentry \domovednote{#1}{#2}\v!previouspage\v!nextpage}} -\def\typesetsomenotesymbol#1#2% running text +\unexpanded\def\typesetsomenotesymbol#1#2% running text {\removeunwantedspaces \doifitalicelse\/\donothing % Charles IV \footnote{the fourth} \ifdim\lastkern=\notesignal @@ -657,7 +657,7 @@ {\directgotobox{\dotypesetsomenotesymbol{#1}{#2}}[page(\ctxlua{structure.notes.getnumberpage("#1",\number#2)})]}% f: \globallet\lastnotesymbol\relax} -\def\typesetdummynotesymbol % temp hack +\unexpanded\def\typesetdummynotesymbol % temp hack {\removeunwantedspaces \doifitalicelse\/\donothing % Charles IV \footnote{the fourth} \ifdim\lastkern=\notesignal @@ -799,7 +799,7 @@ %D %D This command is implemented rather straightforward as: -\def\notesymbol +\unexpanded\def\notesymbol {\dodoubleempty\donotesymbol} \def\donotesymbol[#1][#2]% @@ -827,11 +827,11 @@ % % \dorecurse{6}{\input tufte\footnote{\input ward \input tufte \relax}} -\def\placenoteinserts +\unexpanded\def\placenoteinserts {\processnotes\doplacenoteinserts} -\def\unvboxed {\ifvmode\unvbox \else\box \fi} -\def\unvcopied{\ifvmode\unvcopy\else\copy\fi} +\unexpanded\def\unvboxed {\ifvmode\unvbox \else\box \fi} +\unexpanded\def\unvcopied{\ifvmode\unvcopy\else\copy\fi} \def\doplacenoteinserts {\relax\ifdim\ht\currentnoteins>\zeropoint\relax @@ -958,7 +958,7 @@ \newconditional\inlocalnotes -\def\startlocalnotes +\unexpanded\def\startlocalnotes {\dosingleempty\dostartlocalnotes} \def\dostartlocalnotes[#1]% @@ -966,7 +966,7 @@ \settrue\inlocalnotes \processcommacommand[\localnoteslist]\dodostartlocalnotes} -\def\stoplocalnotes +\unexpanded\def\stoplocalnotes {\processcommacommand[\localnoteslist]\dodostoplocalnotes \setfalse\inlocalnotes} @@ -981,7 +981,7 @@ {\restorestructurecounter[#1]}% \ctxlua{structure.notes.restore("#1")}} -\def\placelocalnotes +\unexpanded\def\placelocalnotes {\dodoubleempty\doplacelocalnotes} \def\doplacelocalnotes[#1][#2]% @@ -1031,10 +1031,10 @@ %D %D \showsetup{placefootnotes} -\def\placebottomnotes +\unexpanded\def\placebottomnotes {\processnotes\placenoteinserts} -\def\placenotes +\unexpanded\def\placenotes {\dodoubleempty\doplacenotes} \def\doplacenotes[#1][#2]% @@ -1118,13 +1118,13 @@ % is this ok? endnotes and such - \def\fakenotes + \unexpanded\def\fakenotes {\ifhmode\endgraf\fi\ifvmode \calculatetotalclevernoteheight \ifdim\totalnoteheight>\zeropoint \kern\totalnoteheight \fi \fi} - \def\fakepagenotes + \unexpanded\def\fakepagenotes {\ifhmode\endgraf\fi\ifvmode \calculatetotalpagenoteheight \ifdim\totalnoteheight>\zeropoint \kern\totalnoteheight \fi @@ -1232,20 +1232,20 @@ %D Compatibility macros: - \def\setupfootnotedefinition{\setupnotedefinition [\v!footnote]} - \def\setupfootnotes {\setupnote [\v!footnote]} -%unexpanded \def\footnote {\setnote [\v!footnote]} -\unexpanded \def\footnotetext {\setnotetext [\v!footnote]} - %def\note {\dodoubleempty\notesymbol [\v!footnote]} % alleen footnote - \def\placefootnotes {\dodoubleempty\doplacefootnotes [\v!footnote]} - \def\placelocalfootnotes {\dodoubleempty\doplacelocalfootnotes[\v!footnote]} - \def\startlocalfootnotes {\startlocalnotes [\v!footnote]} % alleen footnote - \def\stoplocalfootnotes {\stoplocalnotes } +\unexpanded\def\setupfootnotedefinition{\setupnotedefinition [\v!footnote]} +\unexpanded\def\setupfootnotes {\setupnote [\v!footnote]} +%unexpanded\def\footnote {\setnote [\v!footnote]} +\def\footnotetext {\setnotetext [\v!footnote]} +%unexpanded\def\note {\dodoubleempty\notesymbol [\v!footnote]} % alleen footnote +\unexpanded\def\placefootnotes {\dodoubleempty\doplacefootnotes [\v!footnote]} +\unexpanded\def\placelocalfootnotes {\dodoubleempty\doplacelocalfootnotes[\v!footnote]} +\unexpanded\def\startlocalfootnotes {\startlocalnotes [\v!footnote]} % alleen footnote +\unexpanded\def\stoplocalfootnotes {\stoplocalnotes } \def\doplacefootnotes [#1][#2]{\ifsecondargument\placenotes [#1][#2,\c!height=\textheight]\else\placenotes [#1]\fi} \def\doplacelocalfootnotes[#1][#2]{\ifsecondargument\placelocalnotes[#1][#2,\c!height=\textheight]\else\placelocalnotes[#1]\fi} -\def\note{\dodoubleempty\donote} +\unexpanded\def\note{\dodoubleempty\donote} \def\donote[#1][#2]{\ifsecondargument\donotesymbol[#1][#2]\else\secondargumenttrue\donotesymbol[\v!footnote][#1]\fi} @@ -1264,12 +1264,12 @@ \def\ownnotesymbol#1% #1 gets number passed {\executeifdefined{\??vn::\currentnote}\empty} -\def\setnotesymbol[#1]#2#3% +\unexpanded\def\setnotesymbol[#1]#2#3% {\prewordbreak % prevent lookback \setgvalue{\??vn::#1}{#3} \dolastnotesymbol} -\def\ownnote[#1]#2#3#4% +\unexpanded\def\ownnote[#1]#2#3#4% {\setnotesymbol[#1]{#2}{#3}% \setnotetext [#1]{#4}} diff --git a/tex/context/base/strc-num.mkiv b/tex/context/base/strc-num.mkiv index c5bad7224..5b5aebe7d 100644 --- a/tex/context/base/strc-num.mkiv +++ b/tex/context/base/strc-num.mkiv @@ -39,7 +39,7 @@ % todo: better inheritane system -\def\setupstructurecountering{\dodoubleempty\getparameters[\??nn]} +\unexpanded\def\setupstructurecountering{\dodoubleempty\getparameters[\??nn]} \setupstructurecountering [\c!way=\v!by\v!chapter, @@ -96,7 +96,7 @@ % \def\dostructurecounterparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dostructurecounterparentparameter\csname#1\s!number\endcsname#2\fi} % \def\dostructurecounterparentparameter#1#2{\ifx#1\relax\s!empty\else\dostructurecounterparameter#1#2\fi} -\def\definestructurecounter +\unexpanded\def\definestructurecounter {\dodoubleempty\dodefinestructurecounter} \def\dodefinestructurecounter[#1][#2]% @@ -115,7 +115,7 @@ {\getparameters[\??nn#1][\c!number=#2]% \docheckstructurecountersetup{#1}} -\def\setupstructurecounter +\unexpanded\def\setupstructurecounter {\dodoubleargument\dosetupstructurecounter} \def\dosetupstructurecounter[#1][#2]% @@ -324,7 +324,7 @@ % funny, here, todo: these are the defaults -\def\setupnumbering +\unexpanded\def\setupnumbering {\dodoubleempty\getparameters[\??nr]} \setupnumbering diff --git a/tex/context/base/strc-pag.mkiv b/tex/context/base/strc-pag.mkiv index 14c3d0361..0f3d7ba3b 100644 --- a/tex/context/base/strc-pag.mkiv +++ b/tex/context/base/strc-pag.mkiv @@ -84,9 +84,9 @@ \newtoks\everysetupuserpagenumber % todo: set state: none, start, stop, reset \newtoks\everysetupsubpagenumber % todo: set state: none, start, stop, reset -\def\setuprealpagenumber{\dosingleargument\dosetuprealpagenumber} -\def\setupuserpagenumber{\dosingleargument\dosetupuserpagenumber} -\def\setupsubpagenumber {\dosingleargument\dosetupsubpagenumber} +\unexpanded\def\setuprealpagenumber{\dosingleargument\dosetuprealpagenumber} +\unexpanded\def\setupuserpagenumber{\dosingleargument\dosetupuserpagenumber} +\unexpanded\def\setupsubpagenumber {\dosingleargument\dosetupsubpagenumber} \def\dosavepagenumberstate#1{\edef\oldpagenumberstate{\structurecounterparameter#1\c!state}} @@ -295,7 +295,7 @@ \newtoks\everysetuppagenumbering -\def\setuppagenumbering +\unexpanded\def\setuppagenumbering {\dosingleempty\dosetuppagenumbering} \def\dosetuppagenumbering[#1]% diff --git a/tex/context/base/strc-prc.mkiv b/tex/context/base/strc-prc.mkiv index a81cfddd1..2955a396b 100644 --- a/tex/context/base/strc-prc.mkiv +++ b/tex/context/base/strc-prc.mkiv @@ -44,7 +44,7 @@ %D Valid keys for defining a processor are \type {style}, \type {color}, \type {left}, %D \type {right}, and \type {command} (the given command takes one argument). -\def\defineprocessor +\unexpanded\def\defineprocessor {\dodoubleargument\dodefineprocessor} \def\dodefineprocessor[#1][#2]% diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv index 2c0a8842b..8290a1b13 100644 --- a/tex/context/base/strc-ref.mkiv +++ b/tex/context/base/strc-ref.mkiv @@ -367,7 +367,7 @@ %D We can trace references by setting the next switch to %D true. -\def\definereference +\unexpanded\def\definereference {\dodoubleempty\dodefinereference} \def\dodefinereference[#1][#2]% @@ -589,7 +589,7 @@ \chardef\autocrossfilereferences=0 -\def\setupreferencing +\unexpanded\def\setupreferencing {\dosingleargument\dosetupreferencing} \def\dosetupreferencing[#1]% @@ -639,7 +639,7 @@ \def\incrementreferenceprefix{+} \def\decrementreferenceprefix{-} -\def\setupreferenceprefix[#1]% +\unexpanded\def\setupreferenceprefix[#1]% {\edef\@@rfprefix{#1}% \ifx\@@rfprefix\empty \let\referenceprefix\empty @@ -905,7 +905,7 @@ % todo: inherit; probably not yet mkiv okay -\def\definereferenceformat +\unexpanded\def\definereferenceformat {\dodoubleargument\dodefinereferenceformat} \def\dodefinereferenceformat[#1][#2]% @@ -1253,7 +1253,7 @@ %D %D \showsetup{setupurl} -\def\setupurl +\unexpanded\def\setupurl {\dodoubleargument\getparameters[\??ur]} \unexpanded\def\url[#1]% @@ -1349,10 +1349,10 @@ % also lua, like urls and files -\def\setupprograms +\unexpanded\def\setupprograms {\dodoubleargument\getparameters[\??pr]} -\def\defineprogram +\unexpanded\def\defineprogram {\dotripleargument\dodefineprogram} \def\dodefineprogram[#1][#2][#3]% @@ -1399,7 +1399,7 @@ %D %D \showsetup{gotopage} -\def\definepage +\unexpanded\def\definepage {\dodoubleargument\dodefinepage} \def\dodefinepage[#1][#2]% @@ -1483,7 +1483,7 @@ %D %D \showsetup{setupbuttons} -\def\setupbuttons +\unexpanded\def\setupbuttons {\dodoubleargument\getparameters[\??bt]} \definecomplexorsimpleempty\button @@ -1782,7 +1782,7 @@ % \stop \blank % \stoptext -\def\setupreferencestructureprefix +\unexpanded\def\setupreferencestructureprefix {\dotripleargument\dosetupreferencestructureprefix} \def\getreferencestructureprefix#1#2#3% @@ -1796,7 +1796,7 @@ connector = \!!bs\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixconnector\!!es, }} -\def\setupreferencestructureprefix +\unexpanded\def\setupreferencestructureprefix {\dotripleempty\dosetupreferencestructureprefix} \def\dosetupreferencestructureprefix[#1][#2][#3]% diff --git a/tex/context/base/strc-reg.mkiv b/tex/context/base/strc-reg.mkiv index 0e690edcc..fcc37549c 100644 --- a/tex/context/base/strc-reg.mkiv +++ b/tex/context/base/strc-reg.mkiv @@ -76,7 +76,7 @@ \newtoks\everysetupregister -\def\setupregisters +\unexpanded\def\setupregisters {\dotripleempty\dosetupregisters} \def\dosetupregisters[#1][#2][#3]% @@ -125,7 +125,7 @@ %D Definition: -\def\defineregister +\unexpanded\def\defineregister {\dodoubleargument\dodefineregister} \def\dodefineregister[#1][#2]% #2? @@ -278,8 +278,8 @@ \def\donoregister #1#2#3{\doflushatpar{\doregisterstructurepageregister{#1}{\c!keys={#2},\c!entries={#3}}{}}} \def\dodoregister#1#2#3#4{\doflushatpar{\doregisterstructurepageregister{#1}{\c!keys={#2},\c!alternative=#3,\c!entries={#4}}{}}} -\def\startregister{\doquadrupleempty\dostartregister} -\def\stopregister {\dodoubleargument\dostopregister} +\unexpanded\def\startregister{\doquadrupleempty\dostartregister} +\unexpanded\def\stopregister {\dodoubleargument\dostopregister} % a synonym, so that we can nest with overlap without syntax check problems @@ -377,8 +377,8 @@ \def\dosetstructurepageregister[#1][#2][#3]% [register][settings][userdata] {\doflushatpar{\doregisterstructurepageregister{#1}{#2}{#3}}} -\def\startstructurepageregister{\doquadrupleempty\dostartstructurepageregister} -\def\stopstructurepageregister {\dodoubleargument\dostopstructurepageregister} +\unexpanded\def\startstructurepageregister{\doquadrupleempty\dostartstructurepageregister} +\unexpanded\def\stopstructurepageregister {\dodoubleargument\dostopstructurepageregister} \let\openstructurepageregisterrange \startstructurepageregister \let\closestructurepageregisterrange\stopstructurepageregister @@ -466,7 +466,7 @@ \dontcomplain \to \everyplaceregister -\def\placeregister +\unexpanded\def\placeregister {\dodoubleempty\doplaceregister} \def\doplaceregister[#1][#2]% @@ -600,49 +600,49 @@ %D placeindex as then flushing takes place inside the index. Took me hours %D to notice that. -\def\startregisteroutput +\unexpanded\def\startregisteroutput {\endgraf \begingroup \forgetparindent \forgetparskip} -\def\stopregisteroutput +\unexpanded\def\stopregisteroutput {\endgraf \endgroup} -\def\startregisterentries#1% depth +\unexpanded\def\startregisterentries#1% depth {\endgraf \begingroup \dosetregisterattributes\c!textstyle\c!textcolor \advance\leftskip\numexpr#1-1\relax\dimexpr\registerparameter\c!distance\relax \hangindent\registerparameter\c!distance\hangafter\plusone} -\def\stopregisterentries +\unexpanded\def\stopregisterentries {\endgraf \endgroup} -\def\startregistersection#1% title +\unexpanded\def\startregistersection#1% title {\registercharacter{#1}\endgraf} -\def\stopregistersection +\unexpanded\def\stopregistersection {\endgraf} \newconditional\registerpagedone -\def\startregisterpages +\unexpanded\def\startregisterpages {\begingroup \setfalse\registerpagedone \dosetregisterattributes\c!pagestyle\c!pagecolor} -\def\stopregisterpages +\unexpanded\def\stopregisterpages {\endgroup} -\def\startregisterseewords +\unexpanded\def\startregisterseewords {\begingroup \setfalse\registerpagedone \dosetregisterattributes\c!pagestyle\c!pagecolor} -\def\stopregisterseewords +\unexpanded\def\stopregisterseewords {\endgroup} \def\registerpageseparator% todo: , configurable diff --git a/tex/context/base/strc-ren.mkiv b/tex/context/base/strc-ren.mkiv index 04782fe7b..3a60a34a3 100644 --- a/tex/context/base/strc-ren.mkiv +++ b/tex/context/base/strc-ren.mkiv @@ -27,11 +27,11 @@ \newevery \everyheadstart \relax -\def\placeheadmargintexts +\unexpanded\def\placeheadmargintexts {\the\everyheadstart \doif{\structureheadparameter\c!margintext}\v!yes\placemargincontent} -\def\setupheadcomponentfont#1#2% +\unexpanded\def\setupheadcomponentfont#1#2% {\ifconditional\structureheadisdisplay \edef\askedstructureheadinterlinespace{\structureheadparameter\c!interlinespace}% \ifx\askedstructureheadinterlinespace\empty @@ -154,13 +154,13 @@ \fi \endheadplacement{#4}} -\def\placestructureheadnumbertext +\unexpanded\def\placestructureheadnumbertext {\doplacestructureheadnumbertext\empty\getstructureheadnumber\getstructureheadtitle\getstructureheadsyncs} -\def\placestructureheadtext +\unexpanded\def\placestructureheadtext {\doplacestructureheadtext\empty\getstructureheadtitle\getstructureheadsyncs} -\def\placestructureheadempty +\unexpanded\def\placestructureheadempty {\hbox \structureheadattribute {\getstructureheadsyncs}} %D \starttyping @@ -343,7 +343,7 @@ \let\numberheadalternative\v!normal -\def\defineheadplacement +\unexpanded\def\defineheadplacement {\dodoubleargument\dodefineheadplacement} \def\dodefineheadplacement[#1][#2]% #3#4 @@ -439,7 +439,7 @@ \fi #2}} -\def\placeheadmargin#1#2% +\unexpanded\def\placeheadmargin#1#2% {\vbox {\localheadsetup \begstrut % use one \strut here! @@ -474,7 +474,7 @@ {\begstrut#2}% \egroup} -\def\placeheadlohi#1#2#3% +\unexpanded\def\placeheadlohi#1#2#3% {\ifconditional\structureheadshownumber % \ifheadnumbercontent \setbox0\hbox{#2} \setbox2=#1{\localheadsetup\advance\hsize-\wd0\relax#3}% diff --git a/tex/context/base/strc-sbe.mkiv b/tex/context/base/strc-sbe.mkiv index 7b13e860b..206ac8a9c 100644 --- a/tex/context/base/strc-sbe.mkiv +++ b/tex/context/base/strc-sbe.mkiv @@ -31,8 +31,8 @@ \def\v!structureblockenvironment{structureblockenvironment} -\def\definestructureblock{\dotripleargument\dodefinestructureblock} -\def\setupstructureblock {\dodoubleargument\dosetupstructureblock} +\unexpanded\def\definestructureblock{\dotripleargument\dodefinestructureblock} +\unexpanded\def\setupstructureblock {\dodoubleargument\dosetupstructureblock} \def\setstructureblock {\dosingleargument\dosetstructureblock} % \def\structureblockparameter#1{\executeifdefined{\??nb\currentstructureblock#1}\empty} @@ -77,7 +77,7 @@ \let\currentstructureblock\s!unknown -\def\startstructureblock[#1]% +\unexpanded\def\startstructureblock[#1]% {%\ctxlua{structure.counters.check(0)}% we assume sane usage of \page, as this is the only workable place (in push) \begingroup \edef\currentstructureblock{\ctxlua{structure.sections.pushblock("#1")}}% @@ -86,7 +86,7 @@ \the\everybeforestructureblock\relax \showmessage\m!structures1\currentstructureblock} -\def\stopstructureblock +\unexpanded\def\stopstructureblock {\showmessage\m!structures2\currentstructureblock \the\everyafterstructureblock\relax \edef\currentstructureblock{\ctxlua{structure.sections.popblock()}}% diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv index 2074fabdf..35927d98a 100644 --- a/tex/context/base/strc-sec.mkiv +++ b/tex/context/base/strc-sec.mkiv @@ -75,7 +75,7 @@ \let\laststructuresectionname\empty -\def\definestructuresection[#1]% +\unexpanded\def\definestructuresection[#1]% {\doifundefined{\??nh#1} {\global\advance\maxstructuredepth\plusone \setevalue{\??nh#1\c!level}{\the\maxstructuredepth}% @@ -98,7 +98,7 @@ \fi \xdef\laststructuresectionname{#1}}} -\def\setupstructuresection +\unexpanded\def\setupstructuresection {\dotripleempty\dosetupstructuresection} \def\dosetupstructuresection[#1]% @@ -123,9 +123,9 @@ \let\currentstructurehead\empty \newtoks\everystructureheadsetup -\def\setupstructureheads{\dosingleargument\dosetupstructureheads} -\def\setupstructurehead {\dodoubleempty\dosetupstructurehead} -\def\definestructurehead{\dodoubleempty\dodefinestructurehead} +\unexpanded\def\setupstructureheads{\dosingleargument\dosetupstructureheads} +\unexpanded\def\setupstructurehead {\dodoubleempty\dosetupstructurehead} +\unexpanded\def\definestructurehead{\dodoubleempty\dodefinestructurehead} \newif\ifsectionnumber % maybe conditional @@ -401,7 +401,7 @@ \ifdefined\setupheadcomponentfont \else - \def\setupheadcomponentfont#1#2% + \unexpanded\def\setupheadcomponentfont#1#2% {\dosetstructureheadattributes\c!style\c!color \dosetstructureheadattributes#1#2% \dontconvertfont @@ -520,18 +520,18 @@ % typesetting -\def\placestructureheadnumbertext % dummy, will be overloaded +\unexpanded\def\placestructureheadnumbertext % dummy, will be overloaded {\getstructureheadnumber/\getstructureheadtitle \getstructureheadsyncs} -\def\placestructureheadtext % dummy, will be overloaded +\unexpanded\def\placestructureheadtext % dummy, will be overloaded {\getstructureheadtitle \getstructureheadsyncs} -\def\placestructureheadempty % dummy, will be overloaded +\unexpanded\def\placestructureheadempty % dummy, will be overloaded {\getstructureheadsyncs} -\def\placestructureheadhidden +\unexpanded\def\placestructureheadhidden {\setxvalue{\currentstructurehead:sync}% {\noexpand\pagetype[\currentstructureheadcoupling]% hm also number \noexpand\setmarking[\currentstructureheadcoupling]{\currentstructurelistnumber}% @@ -734,7 +734,7 @@ \def\thenamedstructureheadlevel#1% {\structuresectionlevel{\structuresectionheadsection{\structuresectionheadcoupling{#1}}}} -\def\setupheadnumber +\unexpanded\def\setupheadnumber {\dodoubleargument\dosetupheadnumber} \def\dosetupheadnumber[#1][#2]% todo: reset if at other level diff --git a/tex/context/base/strc-syn.mkiv b/tex/context/base/strc-syn.mkiv index be24497f0..65f517437 100644 --- a/tex/context/base/strc-syn.mkiv +++ b/tex/context/base/strc-syn.mkiv @@ -67,7 +67,7 @@ \newtoks\everysetupsynonyms -\def\setupsynonyms +\unexpanded\def\setupsynonyms {\dodoubleargument\dosetupsynonyms} \def\dosetupsynonyms[#1][#2]% @@ -98,7 +98,7 @@ %\c!expansion=, \s!language=\currentmainlanguage] -\def\definesynonyms +\unexpanded\def\definesynonyms {\doquadrupleempty\dodefinesynonyms} \def\dodefinesynonyms[#1][#2][#3][#4]% name plural \meaning \use @@ -121,7 +121,7 @@ \setvalue{\e!place \e!listof#2}{\placelistofsynonyms[#1]}% accepts extra argument \setvalue{\e!complete\e!listof#2}{\completelistofsynonyms[#1]}} -\def\definesynonym +\unexpanded\def\definesynonym {\dotripleempty\dodefinesynonym} \def\dodefinesynonym[#1][#2][#3]#4#5% @@ -174,7 +174,7 @@ \synonymparameter\c!synonymcommand{\ctxlua{joblists.synonym("#1","#2")}}% \normalexpanded{\endgroup\synonymparameter\c!next}} -\def\placelistofsynonyms +\unexpanded\def\placelistofsynonyms {\dodoubleempty\doplacelistofsynonyms} \def\doplacelistofsynonyms[#1][#2]% @@ -243,7 +243,7 @@ \newtoks\everysetupsorting -\def\setupsorting +\unexpanded\def\setupsorting {\dodoubleargument\dosetupsorting} \def\dosetupsorting[#1][#2]% @@ -264,7 +264,7 @@ %\c!expansion=, \s!language=\currentmainlanguage] -\def\definesorting +\unexpanded\def\definesorting {\dotripleempty\dodefinesorting} % if #3=\relax or \v!none, then no command but still protected @@ -286,7 +286,7 @@ \setvalue{\e!place \e!listof#2}{\placelistofsorts[#1]}% \setvalue{\e!complete\e!listof#2}{\completelistofsorts[#1]}} -\def\definesort +\unexpanded\def\definesort {\dotripleempty\dodefinesort} \def\dodefinesort[#1][#2][#3]#4% @@ -335,10 +335,10 @@ % % maybe just 'commandset' and then combine -\def\placelistofsorts +\unexpanded\def\placelistofsorts {\dodoubleempty\placelistofsorts} -\def\placelistofsorts[#1][#2]% NOG EEN RUWE VERSIE MAKEN ZONDER WITRUIMTE ETC ETC +\unexpanded\def\placelistofsorts[#1][#2]% NOG EEN RUWE VERSIE MAKEN ZONDER WITRUIMTE ETC ETC {\begingroup \def\currentsorting{#1}% \getparameters[\??so#1][#2]% diff --git a/tex/context/base/supp-fil.mkiv b/tex/context/base/supp-fil.mkiv index ce81ec7e4..872612eab 100644 --- a/tex/context/base/supp-fil.mkiv +++ b/tex/context/base/supp-fil.mkiv @@ -412,13 +412,13 @@ \newtoks \everystartreadingfile \newtoks \everystopreadingfile -\def\startreadingfile% beter een every en \setnormalcatcodes +\unexpanded\def\startreadingfile% beter een every en \setnormalcatcodes {\global\advance\readingfilelevel\plusone \the\everystartreadingfile \beginrestorecatcodes \setcatcodetable\prtcatcodes} -\def\stopreadingfile +\unexpanded\def\stopreadingfile {\endrestorecatcodes \the\everystopreadingfile \global\advance\readingfilelevel\minusone} diff --git a/tex/context/base/supp-mat.mkiv b/tex/context/base/supp-mat.mkiv index 595786f21..4aebddda9 100644 --- a/tex/context/base/supp-mat.mkiv +++ b/tex/context/base/supp-mat.mkiv @@ -52,14 +52,14 @@ \let\stopmathmode\relax -\def\startmathmode % cannot be used nested +\unexpanded\def\startmathmode % cannot be used nested {\relax\ifmmode \let\stopmathmode\relax \else \Ustartmath\let\stopmathmode\Ustopmath \fi} -\def\startmathmode % nested variant +\unexpanded\def\startmathmode % nested variant {\relax\ifmmode \begingroup\let\stopmathmode\endgroup \else diff --git a/tex/context/base/symb-ini.mkiv b/tex/context/base/symb-ini.mkiv index 253a7c41c..f4f6bdd79 100644 --- a/tex/context/base/symb-ini.mkiv +++ b/tex/context/base/symb-ini.mkiv @@ -45,7 +45,7 @@ % ss:set:tag -> symbol out of set % sstag -> list of symbols in set -\def\definesymbol +\unexpanded\def\definesymbol {\dotripleempty\dodefinesymbol} % \def\dodefinesymbol[#1][#2][#3]% class name meaning @@ -155,7 +155,7 @@ \appendtoks \resetexternalfigures \to \everysymbol -\def\definefiguresymbol +\unexpanded\def\definefiguresymbol {\dotripleempty\dodefinefiguresymbol} \def\dodefinefiguresymbol[#1][#2][#3]% @@ -233,15 +233,15 @@ \let\currentsymboldef\empty -\def\startsymbolset[#1] +\unexpanded\def\startsymbolset[#1] {\def\currentsymboldef{#1}} -\def\stopsymbolset +\unexpanded\def\stopsymbolset {\let\currentsymboldef\empty} \newtoks\symbolsetups -\def\setupsymbolset[#1]% +\unexpanded\def\setupsymbolset[#1]% {\prependtoksonce\fetchsymbol{#1}\to\symbolsetups} \def\resetsymbolset diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv index bcf525f78..fcc1ee88f 100644 --- a/tex/context/base/syst-aux.mkiv +++ b/tex/context/base/syst-aux.mkiv @@ -444,26 +444,19 @@ \def\globallet{\global\let} \let\glet\globallet %D \macros -%D {donottest,unexpanded} +%D {unexpanded} %D -%D When expansion of a macro gives problems, we can precede it -%D by \type{\donottest}. It seems that protection is one of the -%D burdens of developers of packages, so maybe that's why in -%D \ETEX\ protection is solved in a more robust way. -%D -%D Because we use thi smodule onl in \MKIV, we have removed the +%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 \donottest \firstofoneargument % we need to weed -\let \honorunexpanded \empty % we need to weed -\let \forceunexpanded \empty % we need to weed -\let \resetunexpanded \empty % we need to weed - -\let \unexpanded \normalprotected +\let\unexpanded\normalprotected %D \macros %D {doifundefined,doifdefined, @@ -628,8 +621,7 @@ \fi} %D \macros -%D {doif,doifelse,doifnot, -%D donottest} +%D {doif,doifelse,doifnot} %D %D Programming in \TEX\ differs from programming in procedural %D languages like \MODULA. This means that one --- well, let me @@ -646,9 +638,6 @@ %D \doifnot {string1} {string2} {...} %D \doifelse {string1} {string2} {then ...}{else ...} %D \stoptyping -%D -%D When expansion gives problems, we can precede the -%D troublemaker with \type{\donottest}. \long\def\doif#1#2% {\edef\!!stringa{#1}\edef\!!stringb{#2}% @@ -1156,11 +1145,11 @@ %D %D Two more: -\long\def\startprocesscommalist[#1]#2\stopprocesscommalist +\long\unexpanded\def\startprocesscommalist[#1]#2\stopprocesscommalist {\long\def\currentcommalistcommand##1{\def\currentcommalistitem{##1}#2}% \processcommalist[#1]\currentcommalistcommand} -\long\def\startprocesscommacommand[#1]#2\stopprocesscommacommand +\long\unexpanded\def\startprocesscommacommand[#1]#2\stopprocesscommacommand {\long\def\currentcommalistcommand##1{\def\currentcommalistitem{##1}#2}% \normalexpanded{\noexpand\processcommacommand[#1]}\currentcommalistcommand} @@ -1879,11 +1868,11 @@ \def\processassignmentcommand[#1]% {\normalexpanded{\noexpand\processassignmentlist[#1]}} -\long\def\startprocessassignmentlist[#1]#2\stopprocessassignmentlist +\long\unexpanded\def\startprocessassignmentlist[#1]#2\stopprocessassignmentlist {\long\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}% \processassignmentlist[#1]\currentassignmentlistcommand} -\long\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand +\long\unexpanded\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand {\long\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}% \normalexpanded{\noexpand\processassignmentlist[#1]}\currentassignmentlistcommand} @@ -2163,7 +2152,7 @@ %D \def\dosetupsomething[#1][#2]% %D {... #1 ... #2 ...} %D -%D \def\setupsomething +%D \unexpanded\def\setupsomething %D {\dodoubleargument\dosetupsomething} %D \stoptyping %D @@ -2501,13 +2490,13 @@ \def\docomplexorsimpleempty#1% {\doifnextoptionalelse{\firstargumenttrue#1}{\firstargumentfalse#1[]}} -\def\definecomplexorsimple#1% +\unexpanded\def\definecomplexorsimple#1% {\unexpanded\edef#1% {\noexpand\docomplexorsimple \@EA\noexpand\csname\s!complex\strippedcsname#1\endcsname \@EA\noexpand\csname\s!simple \strippedcsname#1\endcsname}} -\def\definecomplexorsimpleempty#1% +\unexpanded\def\definecomplexorsimpleempty#1% {\unexpanded\edef#1% {\noexpand\docomplexorsimpleempty \@EA\noexpand\csname\s!complex\strippedcsname#1\endcsname}} @@ -2902,7 +2891,7 @@ %D Also new: -\def\define#1% +\unexpanded\def\define#1% {\ifdefined#1% \message{[\noexpand#1is already defined]}% \expandafter\def\expandafter\gobbleddefinition @@ -4008,7 +3997,7 @@ %D hard coded delimiter like in: %D %D \starttyping -%D \def\startcommand#1\stopcommand% +%D \unexpanded\def\startcommand#1\stopcommand% %D {... #1 ...} %D \stoptyping %D @@ -4029,7 +4018,7 @@ %D This means that: %D %D \starttyping -%D \def\starthello% +%D \unexpanded\def\starthello% %D {\grabuntil{stophello}\message} %D %D \starthello Hello world!\stophello @@ -5328,7 +5317,7 @@ %D \def\dodefinesomething[#1][#2]% %D {\getparameters[\??xx#1][#2]} %D -%D \def\definesomething% +%D \unexpanded\def\definesomething% %D {\dodoubleargumentwithset\dodefinesomething} %D \stoptyping %D @@ -5940,10 +5929,10 @@ \def\dostopglobaldefs {\globaldefs\ifcsname @gd@\the\globaldefs\endcsname\zerocount} -\def\startlocal {\dostartglobaldefs>-} -\def\stoplocal {\dostopglobaldefs} -\def\startglobal {\dostartglobaldefs<+} -\def\stopglobal {\dostopglobaldefs} +\unexpanded\def\startlocal {\dostartglobaldefs>-} +\unexpanded\def\stoplocal {\dostopglobaldefs} +\unexpanded\def\startglobal {\dostartglobaldefs<+} +\unexpanded\def\stopglobal {\dostopglobaldefs} %D \macros %D {twodigitrounding} @@ -5975,7 +5964,7 @@ %D Beware of verbatim, i.e. catcode changes. %D %D \starttyping -%D \def\starthans% +%D \unexpanded\def\starthans% %D {\processcontent{stophans}\test{\message{\test}\wait}} %D \stoptyping %D @@ -6162,10 +6151,10 @@ % better: push/pop -\def\startstrictinspectnextcharacter +\unexpanded\def\startstrictinspectnextcharacter {\let\inspectnextcharacter\strictinspectnextcharacter} -\def\stopstrictinspectnextcharacter +\unexpanded\def\stopstrictinspectnextcharacter {\let\inspectnextcharacter\normalinspectnextcharacter} \def\strictdoifnextoptionalelse#1#2% @@ -6309,7 +6298,7 @@ \def\??dm{@@dm} % brrr -\def\definemeasure +\unexpanded\def\definemeasure {\dodoubleargument\dodefinemeasure} \def\dodefinemeasure[#1][#2]% @@ -6979,11 +6968,11 @@ \newbox\nointerferencebox -\def\startnointerference % not even grouped ! +\unexpanded\def\startnointerference % not even grouped ! {\setbox\nointerferencebox\vbox \bgroup} -\def\stopnointerference +\unexpanded\def\stopnointerference {\egroup \setbox\nointerferencebox\emptybox} diff --git a/tex/context/base/tabl-ltb.mkiv b/tex/context/base/tabl-ltb.mkiv index 095e30e2b..7d3fab0df 100644 --- a/tex/context/base/tabl-ltb.mkiv +++ b/tex/context/base/tabl-ltb.mkiv @@ -93,7 +93,7 @@ \chardef\linetablepage \zerocount \chardef\linetablerepeat\zerocount -\def\setuplinetable +\unexpanded\def\setuplinetable {\dotripleempty\dosetuplinetable} \def\dosetuplinetable[#1][#2][#3]% @@ -182,7 +182,7 @@ } {\xdef\noflinetablelines{\linetableparameter\c!lines}}} -\def\startlinetablecell +\unexpanded\def\startlinetablecell {\dosingleempty\dostartlinetablecell} \def\dostartlinetablecell[#1]% @@ -247,7 +247,7 @@ \dostartattributes{\??lec\number\linetablecolumn}\c!style\c!color\empty \begstrut \ignorespaces} -% \def\stoplinetablecell +% \unexpanded\def\stoplinetablecell % {\unskip \endstrut % \dostopattributes % \ifcase\linetablemode @@ -269,7 +269,7 @@ \newconditional\linetableautoheight \settrue\linetableautoheight -\def\stoplinetablecell +\unexpanded\def\stoplinetablecell {\unskip \endstrut \dostopattributes \ifcase\linetablemode @@ -298,7 +298,7 @@ \fi \egroup} -% \def\stoplinetablecell +% \unexpanded\def\stoplinetablecell % {\unskip \endstrut % \dostopattributes % \ifcase\linetablemode @@ -387,14 +387,14 @@ \setnoftableslines \fi} -\def\startlinetablepart +\unexpanded\def\startlinetablepart {\global\linetablesubcol\zerocount \setbox\scratchbox\hbox\bgroup \doconvertfont{\linetablerparameter\c!style}% \startcolor[\linetablerparameter\c!color]% \ignorespaces} -\def\stoplinetablepart +\unexpanded\def\stoplinetablepart {\ifnum\linetablepart>\zerocount \unskip \unskip % remove last intercolumn skip (distance+fill) \fi @@ -514,7 +514,7 @@ % \linetableparameter\c!var -> \@@levar (when no classes) -\def\startlinetablerun % to do: quit when nested +\unexpanded\def\startlinetablerun % to do: quit when nested {\bgroup \inlinetabletrue % autowidth @@ -571,7 +571,7 @@ \let\NR\linetableNR \flushlinetablehead} -\def\stoplinetablerun +\unexpanded\def\stoplinetablerun {\globallet\linetableline\!!maxcard \chardef\linetableheadstate\zerocount % blocked \flushlinetableparts @@ -736,19 +736,19 @@ {\stoplinetablecell % dummy \linetableER} -\def\startlinetable +\unexpanded\def\startlinetable {\startlinetablerun} -\def\stoplinetable +\unexpanded\def\stoplinetable {\stoplinetablerun} -\def\startlinetableanalysis +\unexpanded\def\startlinetableanalysis {\bgroup \linetableprerolltrue \trialtypesettingtrue \startlinetablerun} -\def\stoplinetableanalysis +\unexpanded\def\stoplinetableanalysis {\stoplinetablerun \egroup \globallet\noflinetablerows\linetablerows @@ -767,7 +767,7 @@ \newtoks \@@linetablehead -\long\def\startlinetablehead#1\stoplinetablehead +\long\unexpanded\def\startlinetablehead#1\stoplinetablehead {\ifinlinetable \@@linetablehead\emptytoks \fi diff --git a/tex/context/base/tabl-ntb.mkiv b/tex/context/base/tabl-ntb.mkiv index b2ac83aa5..b24eaa85d 100644 --- a/tex/context/base/tabl-ntb.mkiv +++ b/tex/context/base/tabl-ntb.mkiv @@ -351,7 +351,7 @@ %D %D \start \tightTBLrowspanfalse \getbuffer \stop -\def\setupTBLcell#1#2% cell over col over row +\unexpanded\def\setupTBLcell#1#2% cell over col over row {\setupTBLsection % already forgotten \edef\positiverow{\number#1}% \edef\positivecol{\number#2}% @@ -657,7 +657,7 @@ \long\def\doTABLEfoot[#1]#2\eTABLEfoot{\appendtoks\doTABLEsection[#1]{#2}\to\TBLfoot} \long\def\doTABLEsection[#1]#2% - {\def\setupTBLsection{\getparameters[\@@tbl\@@tbl][#1]}% + {\unexpanded\def\setupTBLsection{\getparameters[\@@tbl\@@tbl][#1]}% #2% \let\setupTBLsection\relax} @@ -1601,7 +1601,7 @@ % \bTRs[xx] \bTD oeps \eTD \bTD oeps \eTD \eTRs % \eTABLE -\def\defineTABLEsetup +\unexpanded\def\defineTABLEsetup {\dodoubleargument\dodefineTABLEsetup} \def\dodefineTABLEsetup[#1][#2]% diff --git a/tex/context/base/tabl-tab.mkiv b/tex/context/base/tabl-tab.mkiv index 7f9373678..72234eac8 100644 --- a/tex/context/base/tabl-tab.mkiv +++ b/tex/context/base/tabl-tab.mkiv @@ -980,12 +980,12 @@ \newconditional\tablerepeathead \newconditional\tablerepeattail -\def\starttable +\unexpanded\def\starttable {\bgroup \doif\@@tisplit\v!auto {\ifinsidesplitfloat\let\@@tisplit\v!yes\fi}% \doifinsetelse\@@tisplit{\v!yes,\v!repeat} - {\def\stoptable{\stoptables\egroup}% + {\unexpanded\def\stoptable{\stoptables\egroup}% \starttables} {\doifelsenothing\@@tiframe {\ifinsidefloat\else\startbaselinecorrection\fi} @@ -993,7 +993,7 @@ \postponenotes \firststagestartTABLE}} -\def\stoptable +\unexpanded\def\stoptable {\chuckTABLEautorow % before the tail, else noalign problem \insertTABLEtail \TABLEnoalign{\globalletempty\@@TABLEhead}% @@ -1039,7 +1039,7 @@ %D The implementation of the definition macro is not that %D complicated: -\def\definetabletemplate % to be redone +\unexpanded\def\definetabletemplate % to be redone {\bgroup \catcode`\|=\@@other \doquadrupleempty\dodefinetabletemplate} @@ -1208,7 +1208,7 @@ \newbox\tablecontentbox -\def\starttables +\unexpanded\def\starttables {\bgroup \splittablestrue \doifelse\@@tisplit\v!repeat @@ -1220,7 +1220,7 @@ \global\TABLEinbreakfalse \firststagestartTABLE} -% \def\stoptables +% \unexpanded\def\stoptables % {\ifconditional\tablerepeattail\else\insertTABLEtail\fi % \finishTABLE % \egroup @@ -1228,7 +1228,7 @@ % \flushnotes % \egroup} -\def\stoptables +\unexpanded\def\stoptables {\chuckTABLEautorow % AM: before the tail, else noalign problem \ifconditional\tablerepeattail\else\insertTABLEtail\fi \finishTABLE @@ -1454,7 +1454,7 @@ \global\TABLEgraydonefalse \fi} -\def\defineTABLEendings +\unexpanded\def\defineTABLEendings {\let\SR\TableSR \let\FR\TableFR \let\MR\TableMR @@ -1694,13 +1694,13 @@ %D \sym{\type{\HC}} a horizontal colored line %D \stopitemize -% \def\defineTABLErules +% \unexpanded\def\defineTABLErules % {\let\VL\TableVL % \let\VC\TableVC % \let\HL\TableHL % \let\HC\TableHC} -\def\defineTABLErules +\unexpanded\def\defineTABLErules {\let\VL\TableVL \let\VC\TableVC \let\HL\TableHL @@ -1865,7 +1865,7 @@ % n+1 uitleggen -\def\defineTABLEsteps +\unexpanded\def\defineTABLEsteps {\let\NL\TableNL \let\NR\TableNR \let\NC\TableNC @@ -1931,7 +1931,7 @@ \newif\ifTABLEdivision -% \def\defineTABLEdivisions +% \unexpanded\def\defineTABLEdivisions % {\global\TABLEdivisionfalse % in start % \let\DL\TableDL % \let\DC\TableDC @@ -1939,7 +1939,7 @@ % \let\VD\TableDV % \let\DR\TableDR} -\def\defineTABLEdivisions +\unexpanded\def\defineTABLEdivisions {\global\TABLEdivisionfalse % in start \let\DL\TableDL \let\DC\TableDC @@ -2044,7 +2044,7 @@ % definieer: \CL \RL (eerste \CL[green] = hele row! / \CL[1,green]) % dus: \CL en \RL mix tussen \HL en \BL -\def\defineTABLEbackgrounds +\unexpanded\def\defineTABLEbackgrounds {\let\BC \TableBC \let\BL \TableBL \let\BR \TableBR @@ -2345,7 +2345,7 @@ \global\chardef\TABLEendofrowdepth \TABLErowfactor \fi} -\def\defineTABLEshorthands% +\unexpanded\def\defineTABLEshorthands% {\def\SPAN##1{\use{##1}}% \def\TWO {\use2}% \def\THREE {\use3}% @@ -2354,7 +2354,7 @@ \def\SIX {\use6}% \def\REF {\ReFormat}} -\def\defineTABLEunits +\unexpanded\def\defineTABLEunits {\processaction [\@@tidistance] [ \v!none=>\OpenUp00\def\LOW{\Lower6 }, @@ -2414,8 +2414,8 @@ \expanded{\switchtobodyfont[\@@tibodyfont]}% % linecolor \doifsomething\@@tirulecolor - {\def\startglobalTABLEcolor{\startcolor[\@@tirulecolor]}% - \def\stopglobalTABLEcolor {\stopcolor}}% + {\unexpanded\def\startglobalTABLEcolor{\startcolor[\@@tirulecolor]}% + \unexpanded\def\stopglobalTABLEcolor {\stopcolor}}% % linethickness \LineThicknessFactor4 \scratchdimen\@@tirulethickness diff --git a/tex/context/base/tabl-tsp.mkiv b/tex/context/base/tabl-tsp.mkiv index 7e680ed5d..9ceb3af6e 100644 --- a/tex/context/base/tabl-tsp.mkiv +++ b/tex/context/base/tabl-tsp.mkiv @@ -36,7 +36,7 @@ [\c!way=\v!by\v!text, \c!conversion=\@@siconversion] -\def\setupfloatsplitting +\unexpanded\def\setupfloatsplitting {\dodoubleargument\getparameters[\??si]} \newif\ifinsidesplitfloat % will become chardef diff --git a/tex/context/base/toks-ini.mkiv b/tex/context/base/toks-ini.mkiv index 932c05f32..22deca745 100644 --- a/tex/context/base/toks-ini.mkiv +++ b/tex/context/base/toks-ini.mkiv @@ -19,7 +19,7 @@ %D Handy for manuals \unknown -\def\starttokens [#1]{\ctxlua{collectors.install("#1", "stoptokens")}} +\unexpanded\def\starttokens [#1]{\ctxlua{collectors.install("#1", "stoptokens")}} \let\stoptokens \relax \def\flushtokens [#1]{\ctxlua{collectors.flush("#1")}} \def\showtokens [#1]{\ctxlua{collectors.show("#1")}} @@ -62,7 +62,7 @@ \def\remaptokens#1% {\ctxlua{collectors.handle("#1",function(str) return collectors.remapper.convert("#1",str) end)}} -\def\defineremapper[#1]% +\unexpanded\def\defineremapper[#1]% {\setvalue{\e!start#1}{\dostartremapper{#1}}% \setvalue{\e!stop #1}{\dostopremapper {#1}}% \def\next##1{\setvalue{#1}####1{\getvalue{\e!start#1}####1##1}}% diff --git a/tex/context/base/type-ini.mkiv b/tex/context/base/type-ini.mkiv index af9258b44..cd65f8abb 100644 --- a/tex/context/base/type-ini.mkiv +++ b/tex/context/base/type-ini.mkiv @@ -186,7 +186,7 @@ % \definetypescriptsynonym[lbr][cmr] -\def\definetypescriptsynonym +\unexpanded\def\definetypescriptsynonym {\dodoubleempty\dodefinetypescriptsynonym} \def\dodefinetypescriptsynonym[#1][#2]% @@ -283,7 +283,7 @@ \def\doprocesstypescript {\pushmacro\fontclass} -\def\stoptypescript +\unexpanded\def\stoptypescript {\popmacro\fontclass} \long\def\noprocesstypescript#1\stoptypescript @@ -364,7 +364,7 @@ % \setupfontsynonym [\typescriptprefix\typescriptone] [handling=\typescriptthree] % \stoptypescript -\def\definetypescriptprefix +\unexpanded\def\definetypescriptprefix {\dodoubleargument\dodefinetypescriptprefix} \def\dodefinetypescriptprefix[#1][#2]% @@ -477,7 +477,7 @@ \setugvalue{#1}{\switchtotypeface[#1][#2]}% \fi}} -\def\setuptypeface% [class] [settings] +\unexpanded\def\setuptypeface% [class] [settings] {\doquadrupleempty\doswitchtotypeface[\setupbodyfont][\fontclass]} \unexpanded\def\switchtotypeface% [class] [settings] diff --git a/tex/context/base/type-run.mkiv b/tex/context/base/type-run.mkiv index 1b64c102e..e91398095 100644 --- a/tex/context/base/type-run.mkiv +++ b/tex/context/base/type-run.mkiv @@ -25,7 +25,7 @@ \edef\typescriptone {\truetypescript{#1}}% \edef\typescripttwo {\truetypescript{#2}}% \edef\typescriptthree{\truetypescript{#3}}% - \def\starttypescript + \unexpanded\def\starttypescript {\bgroup \obeylines % else we loose the first line due to lookahead \dotripleempty\dostarttypescript} @@ -35,7 +35,7 @@ \dochecktypescript{##2}\typescripttwo \ifdone \dochecktypescript{##3}\typescriptthree\ifdone \def\next% - {\def\stoptypescript{\egroup\type{\stoptypescript}} + {\unexpanded\def\stoptypescript{\egroup\type{\stoptypescript}} % what follows now is quite ugly \skipfirstverbatimlinefalse \type{\starttypescript} diff --git a/tex/context/base/typo-brk.mkiv b/tex/context/base/typo-brk.mkiv index f2a44fee0..38afbb454 100644 --- a/tex/context/base/typo-brk.mkiv +++ b/tex/context/base/typo-brk.mkiv @@ -27,7 +27,7 @@ \newcount \maxbreakpointsid -\def\definebreakpoints +\unexpanded\def\definebreakpoints {\dosingleargument\dodefinebreakpoints} \def\dodefinebreakpoints[#1]% diff --git a/tex/context/base/typo-cap.mkiv b/tex/context/base/typo-cap.mkiv index 6a1584ea9..af4e12bc2 100644 --- a/tex/context/base/typo-cap.mkiv +++ b/tex/context/base/typo-cap.mkiv @@ -180,7 +180,7 @@ \let\normalsmallcapped\smallcapped -\def\setupcapitals +\unexpanded\def\setupcapitals {\dosingleempty\dosetupcapitals} \def\dosetupcapitals[#1]% todo: don't use grouping just a switch diff --git a/tex/context/base/typo-krn.mkiv b/tex/context/base/typo-krn.mkiv index e34571384..b7a6113bc 100644 --- a/tex/context/base/typo-krn.mkiv +++ b/tex/context/base/typo-krn.mkiv @@ -23,14 +23,14 @@ % % {\setcharacterkerning[extrakerning]\input davis\relax} -\def\definecharacterkerning +\unexpanded\def\definecharacterkerning {\dodoubleargument\dodefinecharacterkerning} \def\dodefinecharacterkerning[#1][#2]% {\getparameters[\??ck#1][\c!factor=0.125,#2]% \setgvalue{\??ck:#1}{\ctxlua{kerns.setspacing(\csname\??ck#1\c!factor\endcsname)}}} -\def\setupcharacterkerning +\unexpanded\def\setupcharacterkerning {\dodoubleargument\dosetupcharacterkerning} \def\dosetupcharacterkerning[#1][#2]% diff --git a/tex/context/base/typo-mir.mkiv b/tex/context/base/typo-mir.mkiv index 708befbf3..4c85262aa 100644 --- a/tex/context/base/typo-mir.mkiv +++ b/tex/context/base/typo-mir.mkiv @@ -31,7 +31,7 @@ \newtoks\everysetupdirections -\def\setupdirections[#1]% there will be more like setting up directions themselves +\unexpanded\def\setupdirections[#1]% there will be more like setting up directions themselves {\getparameters[\??di][#1]% \the\everysetupdirections} diff --git a/tex/context/base/typo-spa.mkiv b/tex/context/base/typo-spa.mkiv index e73638af4..e059b62e4 100644 --- a/tex/context/base/typo-spa.mkiv +++ b/tex/context/base/typo-spa.mkiv @@ -25,13 +25,13 @@ \newcount \maxcharacterspacingid -\def\definecharacterspacing[#1]% +\unexpanded\def\definecharacterspacing[#1]% {\ifcsname\??ch#1\endcsname \else \global\advance\maxcharacterspacingid\plusone \setxvalue{\??ch:#1}{\the\maxcharacterspacingid}% \fi} -\def\setupcharacterspacing +\unexpanded\def\setupcharacterspacing {\dotripleargument\dosetupcharacterspacing} \def\dosetupcharacterspacing[#1][#2][#3]% diff --git a/tex/context/base/x-chemml.mkiv b/tex/context/base/x-chemml.mkiv index e0da353fc..f9ed32960 100644 --- a/tex/context/base/x-chemml.mkiv +++ b/tex/context/base/x-chemml.mkiv @@ -35,7 +35,7 @@ \xmlregisterns{cml}{chemml} -\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]} +\unexpanded\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]} \setupCMLappearance [ion] [\c!alternative=\v!a] diff --git a/tex/context/base/x-mathml.mkiv b/tex/context/base/x-mathml.mkiv index b7865a3c3..a5245c835 100644 --- a/tex/context/base/x-mathml.mkiv +++ b/tex/context/base/x-mathml.mkiv @@ -38,7 +38,7 @@ \xmlregistersetup{xml:mml:define} -\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]} +\unexpanded\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]} \def\MMLhack{\let\MMLpar\par \let\par\relax \everyvbox{\let\par\MMLpar}} @@ -152,7 +152,7 @@ %D In the styles, options can be set with: -\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[MML#1]} % no @@ because passed to lua +\unexpanded\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[MML#1]} % no @@ because passed to lua %D We will apply inner math to all bits and pieces made up by an %D \type {apply}. diff --git a/tex/context/base/x-set-11.mkiv b/tex/context/base/x-set-11.mkiv index 937838364..784df3113 100644 --- a/tex/context/base/x-set-11.mkiv +++ b/tex/context/base/x-set-11.mkiv @@ -37,13 +37,13 @@ % general -\def\setupnumfont {} -\def\setuptxtfont {} -\def\setupintfont {\WORD} -\def\setupvarfont {\sl} -\def\setupoptfont {\sl} -\def\setupalwcolor {} -\def\setupoptcolor {darkgray} +\unexpanded\def\setupnumfont {} +\unexpanded\def\setuptxtfont {} +\unexpanded\def\setupintfont {\WORD} +\unexpanded\def\setupvarfont {\sl} +\unexpanded\def\setupoptfont {\sl} +\unexpanded\def\setupalwcolor {} +\unexpanded\def\setupoptcolor {darkgray} \def\c!setup!definereserved#1#2% {\setvalue{c!setup!:r:#1}{#2}} @@ -152,10 +152,10 @@ \newif\ifshortsetup -\def\setup {\shortsetupfalse\doshowsetup} +\unexpanded\def\setup {\shortsetupfalse\doshowsetup} \def\showsetup {\shortsetupfalse\doshowsetup} \def\shortsetup{\shortsetuptrue \doshowsetup} -\def\setupsetup{\dodoubleargument\getparameters[\??stp]} +\unexpanded\def\setupsetup{\dodoubleargument\getparameters[\??stp]} %unexpanded\def\showsetupinlist#1#2#3{\shortsetupfalse\showsetupindeed{#3}\par} \unexpanded\def\showsetupinlist#1#2#3{\shortsetupfalse\xmlsetup{#3}{xml:setups:typeset}\par} @@ -179,8 +179,8 @@ \def\showsetupindeed#1% {\xmlfilterlist{\loadedsetups}{/interface/command[@name='#1']/command(xml:setups:typeset)}} -\def\placesetup {\placelistofsorts[texcommand][\c!criterium=\v!used]} -\def\placeallsetups{\placelistofsorts[texcommand][\c!criterium=\v!all ]} +\unexpanded\def\placesetup {\placelistofsorts[texcommand][\c!criterium=\v!used]} +\unexpanded\def\placeallsetups{\placelistofsorts[texcommand][\c!criterium=\v!all ]} \let\placeeverysetup\placeallsetups @@ -293,21 +293,21 @@ %D This is the second pass; here we generate the table. -\def\startfirstSETUPcolumn#1% +\unexpanded\def\startfirstSETUPcolumn#1% {\bgroup \advance\leftskip 2em \noindent\llap{\hbox to 2em{#1\hss}}} -\def\stopfirstSETUPcolumn +\unexpanded\def\stopfirstSETUPcolumn {\endgraf \egroup} -\def\startsecondSETUPcolumn#1#2% +\unexpanded\def\startsecondSETUPcolumn#1#2% {\bgroup \advance\hangindent\dimexpr\currentSETUPwidth+2.5em\relax \noindent \hbox to \hangindent{#1\hss\hbox to 2.5em{\hss#2\hss}}} -\def\stopsecondSETUPcolumn +\unexpanded\def\stopsecondSETUPcolumn {\endgraf \egroup} |