diff options
Diffstat (limited to 'tex/context/base/supp-mrk.tex')
-rw-r--r-- | tex/context/base/supp-mrk.tex | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/tex/context/base/supp-mrk.tex b/tex/context/base/supp-mrk.tex index 34d484946..725f3138a 100644 --- a/tex/context/base/supp-mrk.tex +++ b/tex/context/base/supp-mrk.tex @@ -8,23 +8,23 @@ %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. -%D Remark: due to the lack of \type {\clearmark}, the \ETEX\ -%D dedicated mechanism is not yet operational. +%D Remark: due to the lack of \type {\clearmark}, the \ETEX\ +%D dedicated mechanism is not yet operational. %D This module has deverted so much from the original that I -%D can probably rewrite it to a more efficient one now and +%D can probably rewrite it to a more efficient one now and %D I will do so. %D There are 256 \COUNTERS, \DIMENSIONS, \SKIPS, \MUSKIPS\ and %D \BOXES, 16~in- and output buffers, but there is only one %D \MARK. In TugBoat~8 (1987, no~1) Jim Fox presents a set of %D macros that can be used to mimmick multiple marks. We -%D gladly adopt them here. I may rewrite this module from +%D gladly adopt them here. I may rewrite this module from %D scratch some day, since some low level \CONTEXT\ commands -%D can be used. +%D can be used. %D %D This module was changed on behalf of \ETEX. The main %D extension is that \type{\get..} and alike is used instead of @@ -40,7 +40,7 @@ \let\normalsplitbotmark = \splitbotmark \let\normalsplitfirstmark = \splitfirstmark -\beginETEX \marks cum suis +\beginETEX \marks cum suis \let\normalmarks = \marks \let\normaltopmarks = \topmarks @@ -53,18 +53,18 @@ \unprotect -%D We start with the presetting the interface macros. -%D +%D We start with the presetting the interface macros. +%D %D \starttabulatie[|||] -%D \NC \type{\getmarks} \NC sets the marks to their values \NC \NR -%D \NC \type{\getallmarks} \NC sets all marks to their values \NC \NR -%D \NC \type{\getsplitmarks} \NC sets the splitmarks to their values\NC \NR -%D \NC \type{\getallsplitmarks} \NC sets all splitmarks to their values\NC \NR -%D \NC \type{\setmarks} \NC synchronizes topmarks (\ETEX) \NC \NR +%D \NC \type{\getmarks} \NC sets the marks to their values \NC \NR +%D \NC \type{\getallmarks} \NC sets all marks to their values \NC \NR +%D \NC \type{\getsplitmarks} \NC sets the splitmarks to their values\NC \NR +%D \NC \type{\getallsplitmarks} \NC sets all splitmarks to their values\NC \NR +%D \NC \type{\setmarks} \NC synchronizes topmarks (\ETEX) \NC \NR %D \stoptabulatie %D -%D Later we will overload these, dependent of the brand of -%D \TEX\ that we use. +%D Later we will overload these, dependent of the brand of +%D \TEX\ that we use. \let \getmarks \gobbleoneargument \let \getallmarks \relax @@ -82,7 +82,7 @@ %D %D We can force expansion of marks with the following switch. -\newif\ifexpandmarks \expandmarkstrue % hm, true indeed ? +\newif\ifexpandmarks \expandmarkstrue % hm, true indeed ? \beginTEX @@ -188,7 +188,7 @@ %D command name constructors of Jim. This alternative leads to %D a more readable source (we hope). -\def\makemarknames#1% kan genest werken +\def\makemarknames#1% kan genest werken {\bgroup \escapechar=-1 \xdef\markname{\string#1}% @@ -204,7 +204,7 @@ %D make calls from outside the output routine a bit more %D robust. -\let\domark\relax % saves a restore on the stack +\let\domark\relax % saves a restore on the stack \def\definenewmark#1#2% {\bgroup @@ -266,7 +266,7 @@ \noexpand\domark \the\currentmarker{#2}}% \else - \!!toksb\@EA{#2}% one level, why ? handy for cs + \!!toksb\@EA{#2}% one level, why ? handy for cs \setxvalue\marklist {\the\!!toksa \noexpand\domark @@ -290,36 +290,36 @@ %D found, this macro is reassigned and from then on serves %D in building the new list. -% Although the next couple of macros are already defined -% in syst-gen.tex, we repeat them here. +% Although the next couple of macros are already defined +% in syst-gen.tex, we repeat them here. -\let\normalfi \fi % replaces \@fi +\let\normalfi \fi % replaces \@fi \let\normalelse \else % replaces \@else -\let\normalor \or % replaces \@or +\let\normalor \or % replaces \@or % Hm, resetting \!!toksa got lost and took me a half a day to -% trace down ([] showed up in the pagebody); I really have +% trace down ([] showed up in the pagebody); I really have % to clean up this messy module (write it from scratch). -\newif\ifnofirstmarker % an auxiliary switch +\newif\ifnofirstmarker % an auxiliary switch \def\getmarks#1% {\bgroup \makemarknames{#1}% \edef\topmarker{0\normaltopmark}% \edef\botmarker{0\normalbotmark}% - \!!toksa\emptytoks - \!!toksb\emptytoks - \nofirstmarkertrue - % does more worse than good + \!!toksa\emptytoks + \!!toksb\emptytoks + \nofirstmarkertrue + % does more worse than good \let\fi\relax \let\or\relax \let\else\relax % \let\domark\doscanmarks - \getvalue{\marklist}\lastmark + \getvalue\marklist\lastmark %\message{markstatus : [\the\!!toksa\the\!!toksb\the\!!toksc]}% - \long\setxvalue{\marklist}{\the\!!toksa\the\!!toksb\the\!!toksc}% + \long\setxvalue\marklist{\the\!!toksa\the\!!toksb\the\!!toksc}% \egroup} \def\getsplitmarks#1% @@ -328,10 +328,10 @@ % \@EA\let\@EA\savedmarklist\@EA\csname\marklist\endcsname \edef\topmarker{0\normalsplitfirstmark}% \edef\botmarker{0\normalsplitbotmark}% - \!!toksa\emptytoks - \!!toksb\emptytoks + \!!toksa\emptytoks + \!!toksb\emptytoks \nofirstmarkertrue - % does more worse than good + % does more worse than good \let\fi\relax \let\or\relax \let\else\relax @@ -369,30 +369,30 @@ \def\doscanmarks% {\afterassignment\dodoscanmarks\scratchcounter=} -\long\def\dorecovermarks#1\lastmark% nice trick +\long\def\dorecovermarks#1\lastmark% nice trick {\!!toksc{\domark#1}} -\def\lastmark% rest of trick +\def\lastmark% rest of trick {\!!toksc\emptytoks} \endTEX -%D The \ETEX\ way of doing things \unknown +%D The \ETEX\ way of doing things \unknown -\beginETEX \marks cum suis +\beginETEX \marks cum suis -\newtoks \listofmarks +\newtoks \listofmarks -\def\@@prk{prk:} -\def\@@mrk{mrk:} -\def\@@trk{trk:} -\def\@@frk{frk:} -\def\@@brk{brk:} +\def\@@prk{prk:} +\def\@@mrk{mrk:} +\def\@@trk{trk:} +\def\@@frk{frk:} +\def\@@brk{brk:} \def\@@crk{crk:} -%D We will use two state variables per mark, one to signal -%D that a new mark value is set, and one to trigger (on the -%D next page) the setting of the top mark. +%D We will use two state variables per mark, one to signal +%D that a new mark value is set, and one to trigger (on the +%D next page) the setting of the top mark. \def\checkedtopmarks #1{\csname\@@trk\string#1\endcsname} \def\checkedfirstmarks#1{\csname\@@frk\string#1\endcsname} @@ -406,20 +406,20 @@ \@EA\normalmarks\csname\@@prk\string#1\endcsname{\realfolio}% \ifexpandmarks\@EA\setexpandedmark\else\@EA\setnormalmark\fi#1} -\def\setexpandedmark#1#2% % marks expand anyway +\def\setexpandedmark#1#2% % marks expand anyway {\@EA\xdef\csname\@@crk\string#1\endcsname{#2}% - \normalmarks#1{#2}} + \normalmarks#1{#2}} -\def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark - {\scratchtoks{#2}% +\def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark + {\scratchtoks{#2}% \@EA\xdef\csname\@@crk\string#1\endcsname{\the\scratchtoks}% - \normalmarks#1{\the\scratchtoks}} % one level expansion + \normalmarks#1{\the\scratchtoks}} % one level expansion -\def\checktopmark#1% +\def\checktopmark#1% {%\writestatus{marks}{checking \string#1}\wait \ifcase\csname\@@mrk\string#1\endcsname\else\dochecktopmark#1\fi} -%\def\dochecktopmark#1% +%\def\dochecktopmark#1% % {\ifcase0\@EA\normalfirstmarks\csname\@@prk\string#1\endcsname\else % \@EA\ifx\csname\@@frk\string#1\endcsname\empty % \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}% @@ -441,7 +441,7 @@ \fi \fi} -%\def\resetmark#1% we cannot use \normalmarks#1{} +%\def\resetmark#1% we cannot use \normalmarks#1{} % {\global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount % \@EA\normalmarks\csname\@@prk\string#1\endcsname{0}% % \global\@EA\let\csname\@@trk\string#1\endcsname\empty @@ -458,28 +458,28 @@ \global\@EA\let\csname\@@crk\string#1\endcsname\empty} \def\definenewmark#1% - {\ifcsname\@@prk\string#1\endcsname\else % this is etex -) - \newmarks#1\doglobal\appendtoks\checktopmark#1\to\listofmarks - \@EA\newmarks\csname\@@prk\string#1\endcsname % status mark + {\ifcsname\@@prk\string#1\endcsname\else % this is etex -) + \newmarks#1\doglobal\appendtoks\checktopmark#1\to\listofmarks + \@EA\newmarks\csname\@@prk\string#1\endcsname % status mark \fi \global\@EA\mathchardef\csname\@@mrk\string#1\endcsname\zerocount \global\@EA\let\csname\@@crk\string#1\endcsname\empty - \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}% + \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}% \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}% \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}} -\let \newmark \definenewmark -\let \newpersistentmark \newmarks % \definenewmark +\let \newmark \definenewmark +\let \newpersistentmark \newmarks % \definenewmark \let \normalsetmark \setmark \def\getallmarks{\the\listofmarks} % \def\setallmarks{\the\listofmarks} -%D In \type {page-ini} or \type {core-mar} we should say: +%D In \type {page-ini} or \type {core-mar} we should say: %D -%D \starttypen -%D \appendtoks \getallmarks \to \everybeforepagebody -%D \appendtoks \setallmarks \to \everyafterpagebody -%D \stoptypen +%D \starttypen +%D \appendtoks \getallmarks \to \everybeforepagebody +%D \appendtoks \setallmarks \to \everyafterpagebody +%D \stoptypen \let\getcurrentmark \thecurrentmarks \let\gettopmark \checkedtopmarks @@ -488,13 +488,13 @@ \let\getsplitbottommark \normalsplitbotmarks \let\getsplitfirstmark \normalsplitfirstmarks -\let\getbotmark \getbottommark +\let\getbotmark \getbottommark \let\getsplitbotmark \normalsplitbotmarks \let\getsplittopmark \normalsplitfirstmarks \endETEX -%D A couple of goodies: +%D A couple of goodies: \let\getbotmark \getbottommark \let\getsplitbotmark\getsplitbottommark @@ -525,27 +525,27 @@ %D mechanism. In \ETEX\ we can however directly access more %D marks than we will ever need. -%D Resetting marks in not compatible with the old method. -%D Here a node is inserted, which can interfere badly. In -%D fact, a real \type {\clearmarks\name} is needed. +%D Resetting marks in not compatible with the old method. +%D Here a node is inserted, which can interfere badly. In +%D fact, a real \type {\clearmarks\name} is needed. %D -%D \starttypen +%D \starttypen %D \def\resetmark#1{\marks#1{}} %D \stoptypen %D %D A possible macro solution is presented here. When discussing %D \type {\clearmarks} on the \ETEX\ discussion list, Chris -%D Rowley suggested to use a reset flag. Unfortunately this -%D is not enough since we need to keep track of both set and +%D Rowley suggested to use a reset flag. Unfortunately this +%D is not enough since we need to keep track of both set and %D reset state then. This means that we must postpone resetting -%D to the page following the set, and as a result we need +%D to the page following the set, and as a result we need %D another auxiliary macro. The current solution is the best -%D I could come up with so far, especially given that we -%D need a fast mechanism. +%D I could come up with so far, especially given that we +%D need a fast mechanism. -%D For those who want to know the story behind resetting -%D marks, here are some examples of interference -%D +%D For those who want to know the story behind resetting +%D marks, here are some examples of interference +%D %D \startbuffer %D \setbox0=\vbox{test} %D \unvbox0\setbox0=\lastbox @@ -580,8 +580,8 @@ %D One final advice. Use marks with care. When used in globally %D assigned boxes, the list can grow quite big, and processing -%D can slow down considerably. This drawback is removed in -%D \ETEX\ mode. +%D can slow down considerably. This drawback is removed in +%D \ETEX\ mode. \beginTEX @@ -591,8 +591,8 @@ \let\rawgettopmark \gettopmark \let\rawgetfirstmark \getfirstmark \let\rawgetbotmark \getbotmark -\let\rawgetsplitbotmark \normalsplitbotmark -\let\rawgetsplitfirstmark\normalsplitfirstmark +\let\rawgetsplitbotmark \normalsplitbotmark +\let\rawgetsplitfirstmark\normalsplitfirstmark \let\rawgetsplittopmark \normalsplitfirstmark \endTEX @@ -605,9 +605,9 @@ \let\rawgettopmark \normaltopmarks \let\rawgetfirstmark \normalfirstmarks \let\rawgetbotmark \normalbotmarks -\let\rawgetsplitbotmark \normalsplitbotmarks -\let\rawgetsplitfirstmark\normalsplitfirstmarks -\let\rawgetsplittopmark \normalsplitfirstmarks +\let\rawgetsplitbotmark \normalsplitbotmarks +\let\rawgetsplitfirstmark\normalsplitfirstmarks +\let\rawgetsplittopmark \normalsplitfirstmarks \endETEX |