summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/core-tab.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/core-tab.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/core-tab.tex159
1 files changed, 95 insertions, 64 deletions
diff --git a/Master/texmf-dist/tex/context/base/core-tab.tex b/Master/texmf-dist/tex/context/base/core-tab.tex
index 5828e85f7d5..2e843eae817 100644
--- a/Master/texmf-dist/tex/context/base/core-tab.tex
+++ b/Master/texmf-dist/tex/context/base/core-tab.tex
@@ -13,6 +13,9 @@
\writestatus{loading}{Context Core Macros / TaBlE Embedding}
+% By now it makes more sense to merge the patches into the original
+% and clean that one up too.
+
% Don't change the splitter:
%
% ... \NR
@@ -64,9 +67,7 @@
% meldingen row, column, use, advise
% \AR: UITSTELLEN / EXPERIMENTEEL
-
% WAARDELOZE ERROR HANDLER
-
% THIS RENEWED MODULE WORKS OK BUT STILL LOOKS BAD
%D We felt no need to write our own table building macros,
@@ -361,34 +362,39 @@
\newif\ifForgetTableBarAndQuote \ForgetTableBarAndQuotetrue
-\bgroup
-
-\catcode`\|=\@@active
-\catcode`\"=\@@active
-
-\gdef\pushouterbarandquote
- {\ifForgetTableBarAndQuote
- \let|\letterbar
- \let"\letterdoublequote
- \ifnum\catcode`\|=\@@active \let\outertablebar |\else\let\outertablebar \relax\fi
- \ifnum\catcode`\"=\@@active \let\outertablequote"\else\let\outertablequote\relax\fi
- \fi}
-
-\gdef\popouterbarandquote
- {\ifForgetTableBarAndQuote
- \ifx\outertablebar \relax\else\let|\outertablebar \fi
- \ifx\outertablequote\relax\else\let"\outertablequote\fi
- \else
- \redefinetablebarandquote
- \fi}
+% \bgroup
-\egroup
+% \catcode`\|=\@@active
+% \catcode`\"=\@@active
+%
+% \gdef\pushouterbarandquote
+% {\ifForgetTableBarAndQuote
+% \ifnum\catcode`\|=\@@active \let\outertablebar |\else\let\outertablebar \relax\fi
+% \ifnum\catcode`\"=\@@active \let\outertablequote"\else\let\outertablequote\relax\fi
+% \let|\letterbar
+% \let"\letterdoublequote
+% \fi}
+%
+% \gdef\popouterbarandquote
+% {\ifForgetTableBarAndQuote
+% \ifx\outertablebar \relax\else\let|\outertablebar \fi
+% \ifx\outertablequote\relax\else\let"\outertablequote\fi
+% \else
+% \redefinetablebarandquote
+% \fi}
+%
+% \egroup
+%
+% \def\ObeyTableBarAndQuote
+% {\ForgetTableBarAndQuotefalse
+% \ifintable
+% \redefinetablebarandquote
+% \fi}
-\def\ObeyTableBarAndQuote
- {\ForgetTableBarAndQuotefalse
- \ifintable
- \redefinetablebarandquote
- \fi}
+\let\ActivateBarAndQuote \relax
+\let\ObeyTableBarAndQuote\relax
+\let\pushouterbarandquote\relax
+\let\popouterbarandquote \relax
%D \macros
%D {ObeyTableBarAndQuote}
@@ -998,7 +1004,7 @@
{\bgroup % kan-ie weg?
\global\intabletrue
\pushouterbarandquote
- \catcode`\|=\@@other
+ %catcode`\|=\@@other
\complexorsimple\secondstagestartTABLE}
\def\simplesecondstagestartTABLE#1%
@@ -1023,10 +1029,10 @@
%D The implementation of the definition macro is not that
%D complicated:
-\def\douseTABLEtemplate#1#2#3%
- {\gdef\TABLEhead{\getvalue{@@TABLEhead#2}}%
- \gdef\TABLEtail{\getvalue{@@TABLEtail#3}}%
- \complexsecondstagestartTABLE[#1]}
+\def\definetabletemplate % to be redone
+ {\bgroup
+ \catcode`\|=\@@other
+ \doquadrupleempty\dodefinetabletemplate}
\def\dodefinetabletemplate[#1][#2][#3][#4]%
{\ifsecondargument
@@ -1034,10 +1040,10 @@
\fi
\egroup}
-\def\definetabletemplate
- {\bgroup
- \catcode`\|=\@@other
- \doquadrupleempty\dodefinetabletemplate}
+\def\douseTABLEtemplate#1#2#3%
+ {\gdef\TABLEhead{\getvalue{@@TABLEhead#2}}%
+ \gdef\TABLEtail{\getvalue{@@TABLEtail#3}}%
+ \complexsecondstagestartTABLE[#1]}
%D The optional third and fourth arguments define which table
%D head and tail to use.
@@ -1098,18 +1104,24 @@
\fi \fi
\TABLEnoalign{\globalpopmacro\simpleTableHL}}
-\def\complexsecondstagestartTABLE#1[#2]%
- {\convertargument|\to\asciia
- \convertargument#2\to\asciib
+\bgroup \catcode`|=\@@other \catcode`"=\@@other
+
+\gdef\complexsecondstagestartTABLE#1[#2]% brr nested mess
+ {\bgroup
+ \@@useotherbar
+ \@@useotherquote
\global\setfalse\someTABLEhead
\global\setfalse\someTABLEtail
- \doifinstringelse\asciia\asciib
- {\gdef\restartTABLE{\dorestartTABLE{\thirdstagestartTABLE{#2}}}}
+ \expanded{\doifinstringelse{|}{#2}}
+ {\xdef\restartTABLE{\noexpand\dorestartTABLE{\noexpand\thirdstagestartTABLE{#2}}}}
{\doifdefinedelse{\c!Table#2}
{\gdef\restartTABLE{\getvalue{\c!Table#2}}}
{\gdef\restartTABLE{\dorestartTABLE{\getvalue{#2}}}}}%
+ \egroup
\restartTABLE}
+\egroup
+
%D The third stage involves a lot of (re)sets, which we will
%D explain later.
@@ -1153,6 +1165,7 @@
\doifsomething{#1}
{\def\TABLEformat{#1}%
\getTABLEnofcolumns\TABLEformat
+ % more modern is to use catcode tables
\expandafter\BeginFormat\TABLEformat\EndFormat}}
\def\finishTABLE
@@ -1197,13 +1210,22 @@
\global\TABLEinbreakfalse
\firststagestartTABLE}
+% \def\stoptables
+% {\ifconditional\tablerepeattail\else\insertTABLEtail\fi
+% \finishTABLE
+% \egroup
+% \dosplittablebox\tablecontentbox
+% \flushnotes
+% \egroup}
+
\def\stoptables
- {\ifconditional\tablerepeattail\else\insertTABLEtail\fi
- \finishTABLE
- \egroup
- \dosplittablebox\tablecontentbox
- \flushnotes
- \egroup}
+ {\chuckTABLEautorow % AM: before the tail, else noalign problem
+ \ifconditional\tablerepeattail\else\insertTABLEtail\fi
+ \finishTABLE
+ \egroup
+ \dosplittablebox\tablecontentbox
+ \flushnotes
+ \egroup}
\newdimen\TABLEcaptionheight % obsolete
@@ -1410,8 +1432,8 @@
\def\checkTABLErow#1% pure for message purposes
{\unskip % added
\ifTABLEgraydone
- \convertargument #1\to\asciia
- \convertcommand\TABLEendBCL\to\asciib
+ \defconvertedargument\asciia{#1}%
+ \defconvertedcommand \asciib\TABLEendBCL
\ifx\asciia\asciib \else
\writestatus\m!TABLE{confusing \asciia\space and \asciib}%
\gdef\TABLEgraylineerror%
@@ -1617,18 +1639,25 @@
%D \TABLE\ changes the catcode when needed.}
\bgroup
-\catcode`\|=\@@active
-\gdef\protectTABLEbar{\let|\letterbar}
-\catcode`\|=\@@other
+ \catcode`\|=\@@other \gdef\@@otherbar {|}
+ \catcode`\"=\@@other \gdef\@@otherquote {"}
+ \catcode`\|=\@@active \gdef\@@useotherbar {\let|\@@otherbar}
+ \catcode`\"=\@@active \gdef\@@useotherquote{\let"\@@otherquote}
+\egroup
+
+\bgroup \catcode`\|=\@@other
+
\gdef\getTABLEnofcolumns#1%
{\bgroup
\cleanupfeatures % needed !
- \protectTABLEbar % is still a feature
- \expanded{\convertargument#1}\to\ascii
+ \@@useotherbar
+ \@@useotherquote
+ \expanded{\defconvertedargument\noexpand\ascii{#1}}%
\@EA\doglobal\@EA\counttoken\@EA|\@EA\in\ascii\to\maxTABLEcolumn
\global\advance\maxTABLEcolumn \minusone
% in case of & counting, divide by 2
\egroup}
+
\egroup
\def\!ttDoHalign
@@ -1866,14 +1895,16 @@
\normalTABLEquote
\fi}
-\bgroup
-\catcode`\|=\@@active
-\catcode`\"=\@@active
-\gdef\redefinetablebarandquote%
- {\def|{\VL}% % \normalTABLEsimplebar
- \def\|##1{\VL[##1]}% % \normalTABLEcomplexbar
- \def"{\NC}} % \normalTABLEquote
-\egroup
+% \bgroup
+% \catcode`\|=\@@active
+% \catcode`\"=\@@active
+% \gdef\redefinetablebarandquote
+% {\def|{\VL}% % \normalTABLEsimplebar
+% \def\|##1{\VL[##1]}% % \normalTABLEcomplexbar
+% \def"{\NC}} % \normalTABLEquote
+% \egroup
+
+\let\redefinetablebarandquote\relax
%D \startitemize[3*ruim]
%D \sym{\type{\DL}}
@@ -2318,7 +2349,7 @@
{\chardef\TABLErowfactor\zerocount}
{\chardef\TABLErowfactor\plustwo }}
-\def\dohandlebar
+\def\dohandlebar % here ?
{\ifmmode
\@EA\domathmodebar
\else\ifintable