summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-01-05 19:27:46 +0100
committerHans Hagen <pragma@wxs.nl>2012-01-05 19:27:46 +0100
commit6b3e925da3d2f7bf4755144c7d8c1fbe54f3ae07 (patch)
tree568ed5c68b4a7a3a402f2c5e662caf2b2066a9a5 /tex
parent7c04c6ac5b7fb1a9a0bdbe859b7dab1324b7cad5 (diff)
downloadcontext-6b3e925da3d2f7bf4755144c7d8c1fbe54f3ae07.tar.gz
beta 2011.12.18 15:57
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/back-exp.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4071 -> 4075 bytes
-rw-r--r--tex/context/base/context-version.pngbin104996 -> 106425 bytes
-rw-r--r--tex/context/base/font-ini.mkiv82
-rw-r--r--tex/context/base/grph-fil.lua10
-rw-r--r--tex/context/base/page-imp.mkiv29
-rw-r--r--tex/context/base/status-files.pdfbin23984 -> 23963 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin169712 -> 169723 bytes
-rw-r--r--tex/context/base/supp-box.mkiv156
-rw-r--r--tex/context/base/syst-ini.mkiv35
-rw-r--r--tex/context/base/tabl-tbl.mkiv62
11 files changed, 119 insertions, 257 deletions
diff --git a/tex/context/base/back-exp.mkiv b/tex/context/base/back-exp.mkiv
index f891224e4..202171a91 100644
--- a/tex/context/base/back-exp.mkiv
+++ b/tex/context/base/back-exp.mkiv
@@ -102,7 +102,7 @@
\to \everyenableelements
\appendtoks
- \unexpanded\def\dotagsetitemgroup{\taggedctxcommand{settagitemgroup("\currentitemgroup",\ifconditional\packlistitem true\else false\fi,"\currentitemsymbol")}}%
+ \unexpanded\def\dotagsetitemgroup{\taggedctxcommand{settagitemgroup("\currentitemgroup",\ifconditional\c_itemgroups_pack true\else false\fi,"\currentitemgroupsymbol")}}%
\to \everyenableelements
\appendtoks
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index d294b4d27..a67105ca2 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png
index f70c28fb0..d62edb2fa 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv
index 4f6f2927a..99018eb2b 100644
--- a/tex/context/base/font-ini.mkiv
+++ b/tex/context/base/font-ini.mkiv
@@ -14,6 +14,9 @@
% runtime commands will move to modules
+% at some point fontclass will always have a value so that quite some
+% code can go away
+
% todo: reconsider design sizes ... kick 'm out which removes the size
% code and simplifies things considerably. After all, there will be no
% lm math in sizes.
@@ -195,18 +198,18 @@
{\dosingleempty\dodefinedfont}
\unexpanded\def\startfont
- {\bgroup\definedfont}
+ {\begingroup\definedfont}
\unexpanded\def\stopfont
- {\egroup}
+ {\endgroup}
\def\doiffontcharelse#1#2%
- {\bgroup
+ {\begingroup
\definedfont[#1]%
\iffontchar\font#2\relax
- \egroup\expandafter\firstoftwoarguments
+ \endgroup\expandafter\firstoftwoarguments
\else
- \egroup\expandafter\secondoftwoarguments
+ \endgroup\expandafter\secondoftwoarguments
\fi}
%D For more detailed (and historic information) we refer to the file
@@ -556,9 +559,6 @@
\let\currentmathsize\!!plusthree\let\fontbody\scriptscriptface\dodosetmathfamily\scriptscriptfont#1\font
\let\currentmathsize\!!plustwo \let\fontbody\scriptface \dodosetmathfamily\scriptfont #1\font
\let\currentmathsize\!!plusone \let\fontbody\textface \dodosetmathfamily\textfont #1\font
- \ifconditional\optimizemathfontdefinitions
- \dosavefontclassmathfamily#1#2%
- \fi
\let\currentmathsize\empty
\let\fontbody\savedfontbody
\autofontsizefalse}
@@ -588,9 +588,6 @@
\let\currentmathsize\!!plusthree\let\fontbody\scriptscriptface\dodosetboldmathfamily\scriptscriptfont#1#3%
\let\currentmathsize\!!plustwo \let\fontbody\scriptface \dodosetboldmathfamily\scriptfont #1#3%
\let\currentmathsize\!!plusone \let\fontbody\textface \dodosetboldmathfamily\textfont #1#3%
- \ifconditional\optimizemathfontdefinitions
- \dosavefontclassmathfamily#1#2%
- \fi
\let\currentmathsize\empty
\let\fontbody\savedfontbody
\let\defaultfontclass\savedfontclass
@@ -607,8 +604,8 @@
\def\dosetmathfamily#1#2% fam tag
{\ifconditional\optimizemathfontdefinitions
- \ifcsname\??ff:\fontclass:\textface:\c!mm:#2:\fontsize\endcsname
- \csname\??ff:\fontclass:\textface:\c!mm:#2:\fontsize\endcsname
+ \ifcsname*\fontclass\textface\c!mm#21\fontsize1*\endcsname
+ \dopresetmathfamilyindeed#1#2%
\else
\dosetmathfamilyindeed#1#2%
\fi
@@ -618,8 +615,8 @@
\def\dosetboldmathfamily#1#2#3% fam tag
{\ifconditional\optimizemathfontdefinitions
- \ifcsname\??ff:\fontclass:\textface:\c!mm:#2:\fontsize\endcsname
- \csname\??ff:\fontclass:\textface:\c!mm:#2:\fontsize\endcsname
+ \ifcsname*\fontclass\textface\c!mm#21\fontsize1*\endcsname
+ \dopresetmathfamilyindeed#1#2%
\else
\dosetboldmathfamilyindeed#1#2#3%
\fi
@@ -627,32 +624,17 @@
\dosetboldmathfamilyindeed#1#2#3%
\fi}
-\unexpanded\def\doresetfontclassmathfamily#1#2#3%
- {\global\expandafter\let\csname\??ff:#1:\textface:\c!mm:#2:#3\endcsname\undefined}
+\def\dopresetmathfamilyindeed#1#2%
+ {\scriptscriptfont#1\csname*\fontclass\scriptscriptface\c!mm#23\fontsize3*\endcsname
+ \scriptfont #1\csname*\fontclass\scriptface \c!mm#22\fontsize2*\endcsname
+ \textfont #1\csname*\fontclass\textface \c!mm#21\fontsize1*\endcsname}
-\def\dosavefontclassmathfamilyindeed#1#2% weird double 1-3 .. will be cleaned up
- {\expandafter\xdef\csname\??ff:\fontclass:\textface:\c!mm:#2:\fontsize\endcsname{%
- \scriptscriptfont#1\csname*\fontclass\scriptscriptface\c!mm#23\fontsize3*\endcsname
- \scriptfont #1\csname*\fontclass\scriptface \c!mm#22\fontsize2*\endcsname
- \textfont #1\csname*\fontclass\textface \c!mm#21\fontsize1*\endcsname}%
- \ifcsname\??ff:l:\fontclass\endcsname \else
- \expandafter\newtoks\csname\??ff:l:\fontclass\endcsname
- \fi
- \normalexpanded{\global\csname\??ff:l:\fontclass\endcsname
- {\the\csname\??ff:l:\fontclass\endcsname\doresetfontclassmathfamily{\fontclass}{#2}{\fontsize}}}%
- }
-
-\def\resetfontclassmathfamilies#1%
- {\ifcsname\??ff:l:#1\endcsname
- \the\csname\??ff:l:#1\endcsname
- \global\csname\??ff:l:#1\endcsname\emptytoks
- \fi}
+\let\resetfontclassmathfamilies\gobbleoneargument
+\let\dosavefontclassmathfamily \gobbletwoarguments
-\let\dosavefontclassmathfamily\gobbletwoarguments
-
-\appendtoks
- \glet\dosavefontclassmathfamily\dosavefontclassmathfamilyindeed
-\to \everystarttext
+% \appendtoks
+% \glet\dosavefontclassmathfamily\dosavefontclassmathfamilyindeed
+% \to \everystarttext
% It would be nice if characters could be defined in a neutral way (say fam 255) and
% be mapped to a real family during noad list construction. However, this changes
@@ -2295,19 +2277,6 @@
\setnewconstant\fontdigits\plustwo % was 1
-% \def\normalizebodyfontsize#1\to#2%
-% {\@EA\@EA\@EA\donormalizedbodyfontsize\@EA\WITHOUTPT\the\dimexpr#1+\ifcase\fontdigits.5\or.05\or.005\fi\points\relax000\to#2}
-%
-% \def\donormalizedbodyfontsize#1.#2#3#4#5\to#6% \points ?
-% {\edef#6% not \ifcase#2\else due to \relax adding
-% {#1%
-% \ifcase\fontdigits
-% \or \ifcase#2 \else .#2\fi % 1
-% \or \ifcase#2#3 \else .#2\ifcase#3 \else #3\fi\fi % 2
-% \else \ifcase#2#3#4 \else .#2\ifcase#4 \ifcase#3 \else#3\fi \else#3#4\fi\fi % 3
-% \fi
-% \s!pt}}
-
\def\normalizebodyfontsize#1\to#2%
{\edef#2{\ctxcommand{nbfs(\number\dimexpr#1\relax,\number\fontdigits)}}}
@@ -2755,14 +2724,7 @@
% For Taco: optional fall backs:
-\ifx\checkfontclass\undefined \let\checkfontclass\gobbleoneargument \fi % implemented in type-ini
-
-% \def\setcurrentfontstyle#1%
-% {%\message{[3 #1]}%
-% \checkfontclass{#1}%
-% \edef\fontstyle{#1}%
-% \ifmmode\mr\fi % otherwise \rm not downward compatible
-% \synchronizefont}
+\ifdefined\checkfontclass \else \let\checkfontclass\gobbleoneargument \fi % implemented in type-ini
\unexpanded\def\setcurrentfontstyle#1%
{%\message{[3 #1]}%
diff --git a/tex/context/base/grph-fil.lua b/tex/context/base/grph-fil.lua
index da7441288..1ec88b487 100644
--- a/tex/context/base/grph-fil.lua
+++ b/tex/context/base/grph-fil.lua
@@ -42,11 +42,11 @@ function jobfiles.run(name,action)
if trace_run then
report_run("processing file, changes in '%s', processing forced",name)
end
- local a = type(action)
- if a == "function" then
- a(name)
- elseif a == "string" and action ~= "" then
- os.execute(a)
+ local ta = type(action)
+ if ta == "function" then
+ action(name)
+ elseif ta == "string" and action ~= "" then
+ os.execute(action)
else
report_run("processing file, no action given for processing '%s'",name)
end
diff --git a/tex/context/base/page-imp.mkiv b/tex/context/base/page-imp.mkiv
index fcfe43e34..edf82834d 100644
--- a/tex/context/base/page-imp.mkiv
+++ b/tex/context/base/page-imp.mkiv
@@ -21,19 +21,26 @@
%D {starttextdata}
%D
%D This is a user macro (appending to every last shipout is not
-%D really user friendly.
+%D really user friendly).
-\newtoks\collectedtextdata
+\newtoks\t_page_text_data
-\long\unexpanded\def\starttextdata#1\stoptextdata
- {\doglobal\appendtoks#1\to\collectedtextdata}
+\unexpanded\def\starttextdata#1\stoptextdata
+ {\global\let\page_shipouts_flush_text_data\page_shipouts_flush_text_data_indeed
+ \globaladdtotoks\t_page_text_data{#1}}
-\def\flushtextdata
- {\vsmashed{\the\collectedtextdata}% all dimensions zero
- \global\collectedtextdata\emptytoks
- \globallet\flushtextdata\donothing}
+\let\stoptextdata\relax
-\prependtoks \flushtextdata \to \everylastshipout
+\def\page_shipouts_flush_text_data_indeed
+ {\vsmashed{\the\t_page_text_data}%
+ \global\t_page_text_data\emptytoks
+ \global\let\page_shipouts_flush_text_data\relax}
+
+\let\page_shipouts_flush_text_data\relax
+
+\prependtoks
+ \page_shipouts_flush_text_data
+\to \everylastshipout
% Problem: we need to apply the finalizers to a to be shipped out page (as
% we can have positioning involved). However, we can also add stuff in the
@@ -85,8 +92,8 @@
\finalizeshipoutbox\shipoutscratchbox
\page_shipouts_handle{\box\shipoutscratchbox}%
\fi
- \the\everyaftershipout
- \setnextrealpageno}
+ \setnextrealpageno % so this comes before \everyaftershipout so in fact:
+ \the\everyaftershipout} % at this point we're already on the next realpage
\def\page_shipouts_ignore#1%
{\begingroup
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 27f401f74..38db9bfd2 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index ef503386e..75a569f81 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/supp-box.mkiv b/tex/context/base/supp-box.mkiv
index 1b24b0455..40aec18e0 100644
--- a/tex/context/base/supp-box.mkiv
+++ b/tex/context/base/supp-box.mkiv
@@ -257,36 +257,6 @@
%D thereby \type {\mathchoice}, the next macro looks ugly.
%D We also take care of non||braced arguments.
-% \unexpanded\def\phantom {\ph@nt\nextbox\nextbox\nextbox}
-% \unexpanded\def\vphantom{\ph@nt\nextbox\nextbox\voidbox}
-% \unexpanded\def\hphantom{\ph@nt\voidbox\voidbox\nextbox}
-%
-% \def\ph@nt#1#2#3%
-% {\def\doph@nt
-% {\ifmmode
-% \def\mathph@nt####1####2{\makeph@nt#1#2#3{$\mathsurround\zeropoint####1{####2}$}}%
-% \def\nextph@nt{\mathpalette\mathph@nt}%
-% \else\ifx\nextph@nt\bgroup
-% \def\nextph@nt{\makeph@nt#1#2#3}%
-% \else
-% \def\nextph@nt####1{\makeph@nt#1#2#3{####1}}%
-% \fi\fi
-% \nextph@nt}%
-% \futurelet\nextph@nt\doph@nt}
-%
-% \def\makeph@nt#1#2#3%
-% {\begingroup
-% \dowithnextbox
-% {\setbox\scratchbox\emptyhbox
-% \ht\scratchbox\ht#1%
-% \dp\scratchbox\dp#2%
-% \wd\scratchbox\wd#3%
-% \box\scratchbox
-% \endgroup}
-% \normalhbox}
-%
-% \let\finph@nt\undefined
-
\unexpanded\def\phantom {\begingroup\futurelet\nexttoken\boxes_phantom_indeed }
\unexpanded\def\vphantom{\begingroup\futurelet\nexttoken\boxes_phantom_indeed_v}
\unexpanded\def\hphantom{\begingroup\futurelet\nexttoken\boxes_phantom_indeed_h}
@@ -687,12 +657,6 @@
%D
%D {\em todo: Search source for potential usage!}
-% \unexpanded\def\dowithnextboxcontent#1#2% inside, after
-% {\def\boxes_with_next_box_one{#2}%
-% \def\boxes_with_next_box_two{#1\aftergroup\boxes_with_next_box_one}%
-% \afterassignment\boxes_with_next_box_two
-% \setbox\nextbox}
-
\unexpanded\def\dowithnextboxcontent#1#2% inside, after
{\def\boxes_with_next_box_one{#2}%
\def\boxes_with_next_box_two{#1}%
@@ -1989,17 +1953,6 @@
%D middle and right. These box types can be used to typeset
%D paragraphs.
-% \unexpanded\def\lbox{\makelrcbox\normalvbox\raggedleft}
-% \unexpanded\def\cbox{\makelrcbox\normalvbox\raggedcenter}
-% \unexpanded\def\rbox{\makelrcbox\normalvbox\raggedright}
-%
-% \unexpanded\def\ltop{\makelrcbox\normalvtop\raggedleft}
-% \unexpanded\def\ctop{\makelrcbox\normalvtop\raggedcenter}
-% \unexpanded\def\rtop{\makelrcbox\normalvtop\raggedright}
-%
-% \def\makelrcbox#1#2#3#%
-% {#1#3\bgroup \forgetall \let\\=\endgraf #2\let\next=}
-
\def\boxes_lrc_process#1{\bgroup\forgetall\let\\\endgraf#1\let\next}
\unexpanded\def\lbox#1#{\normalvbox#1\boxes_lrc_process\raggedleft }
@@ -2030,22 +1983,6 @@
%D
%D \getbuffer
-% \unexpanded\def\tbox{\tbbox\ht\dp}
-% \unexpanded\def\bbox{\tbbox\dp\ht}
-
-% \def\tbbox#1#2%
-% {\normalhbox\bgroup
-% \dowithnextbox
-% {\scratchdimen\dimexpr\ht\nextbox+\dp\nextbox-#1\strutbox\relax
-% #1\nextbox#1\strutbox
-% #2\nextbox\scratchdimen
-% \setbox\nextbox\normalhbox{\lower\dp\nextbox\box\nextbox}%
-% #1\nextbox#1\strutbox
-% #2\nextbox\scratchdimen
-% \box\nextbox
-% \egroup}
-% \normalhbox}
-
\unexpanded\def\tbox{\normalhbox\bgroup\dowithnextboxcs\boxes_tbox_finish\normalhbox}
\unexpanded\def\bbox{\normalhbox\bgroup\dowithnextboxcs\boxes_bbox_finish\normalhbox}
@@ -2188,73 +2125,6 @@
\newdimen\boxhdisplacement
\newdimen\boxvdisplacement
-% \unexpanded\def\rightbox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement\boxoffset
-% \global\boxvdisplacement.5\ht\scratchbox
-% \global\advance\boxvdisplacement-.5\dp\scratchbox
-% \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box\scratchbox}}
-
-% \unexpanded\def\leftbox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement-\wd\scratchbox
-% \global\advance\boxhdisplacement-\boxoffset
-% \global\boxvdisplacement.5\ht\scratchbox
-% \global\advance\boxvdisplacement-.5\dp\scratchbox
-% \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box\scratchbox}}
-
-% \unexpanded\def\topbox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement-.5\wd\scratchbox
-% \global\boxvdisplacement-\dp\scratchbox
-% \global\advance\boxvdisplacement-\boxoffset
-% \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box\scratchbox}}
-
-% \unexpanded\def\bottombox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement-.5\wd\scratchbox
-% \global\boxvdisplacement\ht\scratchbox
-% \global\advance\boxvdisplacement\boxoffset
-% \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box\scratchbox}}
-
-% \unexpanded\def\lefttopbox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement-\wd\scratchbox
-% \global\advance\boxhdisplacement-\boxoffset
-% \global\boxvdisplacement-\dp\scratchbox
-% \global\advance\boxvdisplacement-\boxoffset
-% \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box\scratchbox}}
-
-% \unexpanded\def\righttopbox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement\boxoffset
-% \global\boxvdisplacement-\dp\scratchbox
-% \global\advance\boxvdisplacement-\boxoffset
-% \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box\scratchbox}}
-
-% \unexpanded\def\leftbottombox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement-\wd\scratchbox
-% \global\advance\boxhdisplacement-\boxoffset
-% \global\boxvdisplacement\ht\scratchbox
-% \global\advance\boxvdisplacement\boxoffset
-% \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box\scratchbox}}
-
-% \unexpanded\def\rightbottombox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement\boxoffset
-% \global\boxvdisplacement\ht\scratchbox
-% \global\advance\boxvdisplacement\boxoffset
-% \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box\scratchbox}}
-
\unexpanded\def\rightbox {\normalhbox\bgroup\dowithnextboxcs\boxes_rightbox_finish \placedbox}
\unexpanded\def\leftbox {\normalhbox\bgroup\dowithnextboxcs\boxes_leftbox_finish \placedbox}
\unexpanded\def\topbox {\normalhbox\bgroup\dowithnextboxcs\boxes_topbox_finish \placedbox}
@@ -2306,7 +2176,7 @@
\boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box\nextbox
\egroup}
-\unexpanded\def\righttopbox_finish
+\def\boxes_righttopbox_finish
{\global\boxhdisplacement\boxoffset
\global\boxvdisplacement-\dp\nextbox
\global\advance\boxvdisplacement-\boxoffset
@@ -2328,30 +2198,6 @@
\boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box\nextbox
\egroup}
-% \unexpanded\def\middlebox#1%
-% {\normalhbox{\setbox\scratchbox\placedbox{#1}\boxoffset=-.5\wd\scratchbox\rightbox{\box\scratchbox}}}
-
-% \def\baselinemiddlebox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement-.5\wd\scratchbox
-% \global\advance\boxhdisplacement-\boxoffset
-% \global\boxvdisplacement-\boxoffset
-% \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box\scratchbox}}
-
-% \unexpanded\def\baselineleftbox#1%
-% {\global\boxhdisplacement-\wd\scratchbox
-% \global\advance\boxhdisplacement-\boxoffset
-% \global\boxvdisplacement-\boxoffset
-% \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box\scratchbox}}
-
-% \unexpanded\def\baselinerightbox#1%
-% {\normalhbox
-% {\setbox\scratchbox\placedbox{#1}%
-% \global\boxhdisplacement\boxoffset
-% \global\boxvdisplacement-\boxoffset
-% \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box\scratchbox}}
-
\unexpanded\def\middlebox {\normalhbox\bgroup\dowithnextboxcs\boxes_middlebox_finish \placedbox}
\unexpanded\def\baselinemiddlebox{\normalhbox\bgroup\dowithnextboxcs\boxes_baselinemiddlebox_finish\placedbox}
\unexpanded\def\baselineleftbox {\normalhbox\bgroup\dowithnextboxcs\boxes_baselineleftbox_finish \placedbox}
diff --git a/tex/context/base/syst-ini.mkiv b/tex/context/base/syst-ini.mkiv
index e4cdfbd2b..a5127a0ab 100644
--- a/tex/context/base/syst-ini.mkiv
+++ b/tex/context/base/syst-ini.mkiv
@@ -655,11 +655,38 @@
\normaleveryjob{\the\everyjob}
-\normalprotected\def\appendtotoks #1{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=}
-\normalprotected\def\prependtotoks#1{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=}
+% these token list helpers might move to syst-aux.mkiv
+%
+% we assume a \cs. not toks0 or so
+%
+% \normalprotected\def\appendtotoks #1#{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=}
+% \normalprotected\def\prependtotoks#1#{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=}
-\def\doappendtotoks {\expandafter\expandafter\expandafter{\expandafter\the\expandafter\temp\the\scratchtoks}}
-\def\doprependtotoks{\expandafter\expandafter\expandafter{\expandafter\the\expandafter\scratchtoks\the\temp}}
+\newtoks\t_syst_app_pre_temp
+
+\normalprotected\def\appendtotoks #1{\let\scratch_toks#1\afterassignment\syst_app_toks_l\t_syst_app_pre_temp=}
+\normalprotected\def\prependtotoks#1{\let\scratch_toks#1\afterassignment\syst_pre_toks_l\t_syst_app_pre_temp=}
+
+% \def\syst_app_toks{\scratch_toks\expandafter\expandafter\expandafter{\expandafter\the\expandafter\scratch_toks\the\t_syst_app_pre_temp}}}
+% \def\syst_pre_toks{\scratch_toks\expandafter\expandafter\expandafter{\expandafter\the\expandafter\t_syst_app_pre_temp\the\scratch_toks}}}
+
+\normalprotected\def\globalappendtotoks #1{\let\scratch_toks#1\afterassignment\syst_app_toks_g\t_syst_app_pre_temp=}
+\normalprotected\def\globalprependtotoks#1{\let\scratch_toks#1\afterassignment\syst_pre_toks_g\t_syst_app_pre_temp=}
+
+\def\syst_app_toks_l{\normalexpanded{\scratch_toks{\the\scratch_toks\the\t_syst_app_pre_temp}}}
+\def\syst_pre_toks_l{\normalexpanded{\scratch_toks{\the\t_syst_app_pre_temp\the\scratch_toks}}}
+
+\def\syst_app_toks_g{\global\syst_app_toks_l}
+\def\syst_pre_toks_g{\global\syst_pre_toks_l}
+
+\normalprotected\def\addtotoks #1{\let\scratch_toks#1\afterassignment\syst_add_toks_l\let\next}
+\normalprotected\def\globaladdtotoks#1{\let\scratch_toks#1\afterassignment\syst_add_toks_g\let\next}
+
+\def\syst_add_toks_l{\scratch_toks\expandafter\bgroup\the\scratch_toks}
+\def\syst_add_toks_g{\global\syst_add_toks_l}
+
+\normalprotected\def\addtotokscs #1#2{#1{\the#1#2}} % saves a few bytes
+\normalprotected\def\globaladdtotokscs#1#2{\global#1{\the#1#2}} % saves a few bytes
%D \macros
%D {begcsname}
diff --git a/tex/context/base/tabl-tbl.mkiv b/tex/context/base/tabl-tbl.mkiv
index 680e9160a..cf6c04991 100644
--- a/tex/context/base/tabl-tbl.mkiv
+++ b/tex/context/base/tabl-tbl.mkiv
@@ -449,7 +449,7 @@
\dotabulatepostskip{\the\tabulateposskip}%
\alignmark\alignmark
}}%
- \appendtoks\NC\to\tabulatedummy
+ \tabulatedummy{\the\tabulatedummy\NC}%
\tabulatepreskip.5\tabulateunit\relax
\ifnum\tabulatecolumns<\numexpr\noftabulatecolumns-\plusone\relax
\tabulateposskip\tabulatepreskip
@@ -461,34 +461,48 @@
\newcount\tabulatealign
-\setvalue{\??tt>\meaning x}{\tabulatealign\zerocount\settabulatepreamble} % internal
-\setvalue{\??tt>\meaning l}{\tabulatealign\plusone\settabulatepreamble}
-\setvalue{\??tt>\meaning r}{\tabulatealign\plustwo\settabulatepreamble}
-\setvalue{\??tt>\meaning c}{\tabulatealign\plusthree\settabulatepreamble}
+\setvalue{\??tt>\meaning x}{\tabulatealign\zerocount
+ \settabulatepreamble} % internal
+\setvalue{\??tt>\meaning l}{\tabulatealign\plusone
+ \settabulatepreamble}
+\setvalue{\??tt>\meaning r}{\tabulatealign\plustwo
+ \settabulatepreamble}
+\setvalue{\??tt>\meaning c}{\tabulatealign\plusthree
+ \settabulatepreamble}
\setvalue{\??tt>\meaning p}{\gettabulateparagraph}
\setvalue{\??tt>\meaning s}{\gettabulatesetups}
\setvalue{\??tt>\meaning w}{\gettabulatewidth}
\setvalue{\??tt>\meaning f}{\gettabulatefont}
-\setvalue{\??tt>\meaning B}{\tabulatefont{\bf}\settabulatepreamble}
-\setvalue{\??tt>\meaning I}{\tabulatefont{\it}\settabulatepreamble}
-\setvalue{\??tt>\meaning S}{\tabulatefont{\sl}\settabulatepreamble}
-\setvalue{\??tt>\meaning T}{\tabulatefont{\tt}\settabulatepreamble}
-\setvalue{\??tt>\meaning R}{\tabulatefont{\rm}\settabulatepreamble}
-\setvalue{\??tt>\meaning m}{\tabulatebmath{$}\tabulateemath{$}\settabulatepreamble}
-\setvalue{\??tt>\meaning M}{\tabulatebmath{$\displaystyle}\tabulateemath{$}\settabulatepreamble}
+\setvalue{\??tt>\meaning B}{\tabulatefont{\bf}%
+ \settabulatepreamble}
+\setvalue{\??tt>\meaning I}{\tabulatefont{\it}%
+ \settabulatepreamble}
+\setvalue{\??tt>\meaning S}{\tabulatefont{\sl}%
+ \settabulatepreamble}
+\setvalue{\??tt>\meaning T}{\tabulatefont{\tt}%
+ \settabulatepreamble}
+\setvalue{\??tt>\meaning R}{\tabulatefont{\rm}%
+ \settabulatepreamble}
+\setvalue{\??tt>\meaning m}{\tabulatebmath{$}\tabulateemath{$}%
+ \settabulatepreamble}
+\setvalue{\??tt>\meaning M}{\tabulatebmath{$\displaystyle}\tabulateemath{$}%
+ \settabulatepreamble}
\setvalue{\??tt>\meaning h}{\gettabulatehook}
\setvalue{\??tt>\meaning b}{\gettabulatebefore}
\setvalue{\??tt>\meaning a}{\gettabulateafter}
\setvalue{\??tt>\meaning i}{\gettabulatepreskip}
\setvalue{\??tt>\meaning j}{\gettabulateposskip}
\setvalue{\??tt>\meaning k}{\gettabulatepreposskip}
-\setvalue{\??tt>\meaning e}{\appendtoks\global\settrue\tabulateequal\to\tabulatesettings\settabulatepreamble}
-\setvalue{\??tt>\meaning ~}{\appendtoks\fixedspaces\to\tabulatesettings\settabulatepreamble}
+\setvalue{\??tt>\meaning e}{\tabulatesettings\expandafter{\the\tabulatesettings\global\settrue\tabulateequal}%
+ \settabulatepreamble}
+\setvalue{\??tt>\meaning ~}{\tabulatesettings\expandafter{\the\tabulatesettings\fixedspaces}%
+ \settabulatepreamble}
\setvalue{\??tt>\meaning g}{\gettabulatealign}
\setvalue{\??tt>\meaning .}{\gettabulatealign.}
\setvalue{\??tt>\meaning ,}{\gettabulatealign,}
\setvalue{\??tt>\meaning C}{\doparsecolortabulate}
-\setvalue{\??tt>\s!unknown }{\message{unknown preamble key [\meaning\next]}\settabulatepreamble}
+\setvalue{\??tt>\s!unknown }{\writestatus{error}{unknown preamble key [\meaning\next]}%
+ \settabulatepreamble}
\setvalue{\??tt>\meaning\relax}{}
\def\dosettabulatepreamble
@@ -1271,11 +1285,11 @@
\fi}
\appendtoks
- \glet\registertabulateparoptions\doregistertabulateparoptions
+ \glet\registertabulateparoptions\doregistertabulateparoptions
\to \everytabulate
\appendtoks
- \registertabulateparoptions
+ \registertabulateparoptions
\to \everytabulaterow
\def\flushtabulateindent
@@ -1651,8 +1665,12 @@
\edef\totaltabulatecolumns{\the\numexpr3*\tabulatecolumns+4}%
\tabulatewidth\zeropoint
\initializetableboxes\tabulatecolumns
- \appendtoks\aligntab\alignmark\alignmark\global\advance\tabulatecolumn\plusone\to\tabulatepreamble
- \appendtoks\NC\unskip\unskip\crcr\flushtabulated\to\tabulatedummy % no count
+ \tabulatepreamble\expandafter{\the\tabulatepreamble
+ \aligntab\alignmark\alignmark\global\advance\tabulatecolumn\plusone
+ }%
+ \tabulatedummy\expandafter{\the\tabulatedummy
+ \NC\unskip\unskip\crcr\flushtabulated % no count
+ }%
\global\tabulatecolumn\zerocount
\resettabulatepheight
\let\bbskip\empty
@@ -1725,7 +1743,7 @@
%
\dostarttagged\t!tabulate\empty
\dostarttagged\t!tabulaterow\empty
- \appendtoks\dostoptagged\dostarttagged\t!tabulaterow\empty\to\everycr
+ \everycr\expandafter{\the\everycr\dostoptagged\dostarttagged\t!tabulaterow\empty}%
\@EA\halign\@EA{\the\tabulatepreamble\crcr\fulltabulatecontent\crcr}%
\dostoptagged
\dostoptagged
@@ -1840,7 +1858,9 @@
% {\blank
% \stoptabulatenoalign}
-\appendtoks\let\TB\TabulateTB\to\everytabulate
+\appendtoks
+ \let\TB\TabulateTB
+\to \everytabulate
%D Some new trickery:
%D