diff options
author | Hans Hagen <pragma@wxs.nl> | 2004-06-10 00:00:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2004-06-10 00:00:00 +0200 |
commit | 51d573f4c0e8d3b8499bff7a3c6fba3dcd71d725 (patch) | |
tree | a902c3c67fe2272ee9e2325d6a6f28f0fd15d9d8 /tex/context/base/core-buf.tex | |
parent | ab3f887feadf929129087cd2cbc3783064507565 (diff) | |
download | context-51d573f4c0e8d3b8499bff7a3c6fba3dcd71d725.tar.gz |
stable 2004.06.10
Diffstat (limited to 'tex/context/base/core-buf.tex')
-rw-r--r-- | tex/context/base/core-buf.tex | 243 |
1 files changed, 124 insertions, 119 deletions
diff --git a/tex/context/base/core-buf.tex b/tex/context/base/core-buf.tex index 2871475ed..dcd4030e6 100644 --- a/tex/context/base/core-buf.tex +++ b/tex/context/base/core-buf.tex @@ -188,7 +188,7 @@ \def\dostartbuffer {\bgroup - \obeylines % nodig, anders gaat 't fout als direct \starttabel (bv) + \obeylines % nodig, anders gaat 't fout als direct \starttable (bv) \doquadrupleempty\dodostartbuffer} \def\dodostartbuffer[#1][#2][#3][#4]% upward compatible @@ -201,11 +201,10 @@ \def\dododostartbuffer[#1][#2][#3][#4]% {%\showmessage\m!systems{15}{#2}% - \doifelsevalue{\??bu#1\c!alinea}\v!ja + \doifelsevalue{\??bu#1\c!paragraph}\v!yes {\segmentatebuffertrue} - {\doifnumberelse{\getvalue{\??bu#1\c!alinea}} - \segmentatebuffertrue\segmentatebufferfalse}% - \doifelse{#4}{} + {\doifnumberelse{\getvalue{\??bu#1\c!paragraph}}\segmentatebuffertrue\segmentatebufferfalse}% + \doifelsenothing{#4} {\letbeundefined{\e!stop\v!buffer}% % \let\stopbuffer=\relax % \undefined \@EA\@EA\@EA\convertargument\@EA\e!start\v!buffer\to\beginofblock % else a space \@EA\@EA\@EA\convertargument\@EA\e!stop \v!buffer\to\endofblock @@ -221,10 +220,10 @@ \egroup \getvalue{#4}}% \doifelsenothing{#2} - {\message{<\TEXbufferfile{\jobname}>}% - \immediate\openout\tmpblocks\TEXbufferfile\jobname} - {\message{<\TEXbufferfile{#2}>}% - \immediate\openout\tmpblocks\TEXbufferfile{#2}}% + {\edef\bufferfilename{\TEXbufferfile\jobname}}% + {\edef\bufferfilename{\TEXbufferfile{#2}}}% + \message{<\bufferfilename>}% + \immediate\openout\tmpblocks\bufferfilename \ifsegmentatebuffer \immediate\write\tmpblocks{\string\startbufferparagraph}% \fi @@ -238,22 +237,27 @@ % \setbuffer[name]#2\endbuffer : saves to file #1.tmp \def\setbuffer[#1]#2\endbuffer - {\immediate\openout\tmpblocks=\TEXbufferfile{#1}% + {\edef\bufferfilename{\TEXbufferfile{#1}}% + \message{<\bufferfilename>}% + \immediate\openout\tmpblocks\bufferfilename \convertargument#2\to\ascii \immediate\write\tmpblocks{\ascii}% \immediate\closeout\tmpblocks} +\def\dodobuffer#1#2% + {\beginrestorecatcodes + \ifundefined{\??bu#2\c!number}% + \edef\bufferfilename{\TEXbufferfile{#2}}% + \else + \edef\bufferfilename{\TEXbufferfile{def-\getvalue{\??bu#2\c!number}}}% + \fi + #1\bufferfilename\donothing\donothing + \endrestorecatcodes} + \def\dobuffer#1[#2]#3% - {\def\dodobuffer##1% - {%\showmessage\m!systems{#1}{##1}% - \beginrestorecatcodes - \doifdefinedelse{\??bu##1\c!nummer} - {#3{\TEXbufferfile{def-\getvalue{\??bu##1\c!nummer}}}\donothing\donothing} - {#3{\TEXbufferfile{##1}}\donothing\donothing}% - \endrestorecatcodes}% - \doifelsenothing{#2} - {\dodobuffer\jobname} - {\processcommalist[#2]\dodobuffer}} + {\doifelsenothing{#2} + {\dodobuffer#3\jobname} + {\processcommalist[#2]{\dodobuffer#3}}} \def\processTEXbuffer {\dodoubleempty\doprocessTEXbuffer} @@ -266,12 +270,12 @@ \fi} \def\dodoprocessTEXbuffer[#1][#2]% - {\getvalue{\??bu#1\c!voor}% + {\getvalue{\??bu#1\c!before}% \dobuffer{16}[#2]\readjobfile - \getvalue{\??bu#1\c!na}} + \getvalue{\??bu#1\c!after}} \let\getbuffer \processTEXbuffer % handy -\let\haalbuffer\processTEXbuffer % will move to mult-com.tex +\let\getbuffer\processTEXbuffer % will move to mult-com.tex \def\typebuffer {\dodoubleempty\dotypebuffer} @@ -283,31 +287,31 @@ \dobuffer{17}[#2]\typefile \fi} -\def\stelbufferin - {\dodoubleempty\dostelbufferin} +\def\setupbuffer + {\dodoubleempty\dosetupbuffer} -\def\dostelbufferin[#1][#2]% +\def\dosetupbuffer[#1][#2]% {\ifsecondargument \getparameters[\??bu#1][#2]% \else \getparameters[\??bu][#1]% \fi} -\def\dodefinieerbuffer[#1]% +\def\dodefinebuffer[#1]% {\iffirstargument % else problems \doglobal\increment\nofdefinedbuffers - \letvalue{\??bu#1\c!nummer}\nofdefinedbuffers - \letvalue{\??bu#1\c!alinea}\v!nee + \letvalue{\??bu#1\c!number}\nofdefinedbuffers + \letvalue{\??bu#1\c!paragraph}\v!no \setevalue{\e!start#1}% {\noexpand\dostartbuffer[#1][def-\nofdefinedbuffers][\e!start#1][\e!stop#1]}% - \setevalue{\e!haal#1}% + \setevalue{\e!get#1}% {\noexpand\dodoprocessTEXbuffer[#1][def-\nofdefinedbuffers]}% \setevalue{\e!type#1}% {\noexpand\dodotypebuffer[#1][def-\nofdefinedbuffers]}% \fi} -\def\definieerbuffer - {\dosingleargument\dodefinieerbuffer} +\def\definebuffer + {\dosingleargument\dodefinebuffer} % yet another undocumented feature, but who cares: @@ -350,8 +354,8 @@ {\dodoubleempty\dogetbufferparagraphs} \def\dosetbufferoffset#1% - {\doifnumberelse{\getvalue{\??bu#1\c!alinea}} - {\currentbufferparagraph-\getvalue{\??bu#1\c!alinea}} + {\doifnumberelse{\getvalue{\??bu#1\c!paragraph}} + {\currentbufferparagraph-\getvalue{\??bu#1\c!paragraph}} {\currentbufferparagraph \zerocount}% \relax} @@ -359,7 +363,7 @@ {\iffirstargument \ifsecondargument \dosetbufferoffset{#1}% - \doifelse{#2}\v!alles + \doifelse{#2}\v!all {\def\startbufferparagraph{\normalbufferparagraph{#1}}} {\def\startbufferparagraph{\filterbufferparagraph{#1}{#2}}}% \def\stopbufferparagraph{\dostopbufferparagraph{#1}}% @@ -382,10 +386,10 @@ {\dobuffer{16}[#1]\readjobfile} \def\dostopbufferparagraph#1% - {\getvalue{\??bu#1\c!na}\par} + {\getvalue{\??bu#1\c!after}\par} \def\dostartbufferparagraph#1% - {\par\getvalue{\??bu#1\c!voor}} + {\par\getvalue{\??bu#1\c!before}} \def\normalbufferparagraph {\advance\currentbufferparagraph \plusone @@ -406,6 +410,19 @@ \fi \next{#1}} +% nicer, but untested +% +% \def\filterbufferparagraph#1#2% +% {\advance\currentbufferparagraph \plusone +% \ifcase\currentbufferparagraph +% \@EA\gobblebufferparagraph +% \else +% \doifinsetelse{\the\currentbufferparagraph}{#2} +% {\@EA\dostartbufferparagraph} +% {\@EA\fakebufferparagraph}% +% \fi +% {#1}} + \long\def\gobblebufferparagraph#1#2\stopbufferparagraph {} @@ -434,7 +451,7 @@ {\expanded{\setvalue{\??se\s!old#2}{\@@filterheadpart[#1]}}% \doifnot{#2}\lastsection {\expanded{\dodosetblockcounters[\@@filtertailpart[#1]]}% - {\getvalue{\??se#2\c!na}}}} % ???? + {\getvalue{\??se#2\c!after}}}} % ???? \def\dosetblockcounters[#1]% {\ifblockpermitted @@ -546,7 +563,7 @@ \global\copyingblocksfalse \fi} -\def\geenblokkenmeer +\def\nomoreblocks {\stopcopyingblocks} \def\copyblockfile @@ -614,15 +631,9 @@ \bgroup \obeylines \long\gdef\copyblocklineAB#1 - {\processnextblocklineAB{#1}% - {\closeblock}% - {\writeoutblocks{#1}% - \writetmpblock{#1}% - \copyblocklineAB}} + {\processnextblocklineAB{#1}\closeblock{\writeoutblocks{#1}\writetmpblock{#1}\copyblocklineAB}} \long\gdef\skipblocklineAB#1 - {\processnextblocklineAB{#1}% - {\closeblock}% - {\skipblocklineAB}} + {\processnextblocklineAB{#1}\closeblock\skipblocklineAB} \egroup % \def\processnextblockline#1#2#3% @@ -655,15 +666,9 @@ \bgroup \obeylines \long\gdef\copyblockline#1 - {\processnextblockline{#1}% - {\closeblock}% - {\writeoutblocks{#1}% - \writetmpblock{#1}% - \copyblockline}} + {\processnextblockline{#1}\closeblock{\writeoutblocks{#1}\writetmpblock{#1}\copyblockline}} \long\gdef\skipblockline#1 - {\processnextblockline{#1}% - {\closeblock}% - {\skipblockline}} + {\processnextblockline{#1}\closeblock\skipblockline} \egroup \def\skipblock#1% @@ -688,8 +693,8 @@ \def\saveblock#1#2% {\checkcopyingblocks \obeylines - \@EA\@EA\@EA\convertargument\@EA\string\csname\e!eindvan#1\endcsname\to\endofblockA - %testen: \expanded{\convertargument\string\csname\e!eindvan#1\endcsname\to\endofblockA}% + \@EA\@EA\@EA\convertargument\@EA\string\csname\e!end#1\endcsname\to\endofblockA + %testen: \expanded{\convertargument\string\csname\e!end#1\endcsname\to\endofblockA}% \@EA\convertargument\string\eindvanblok[#1]\to\endofblockB % MULTI LINGUAL MAKEN \def\openblock {\dobeforeblock{#1}{#2}% @@ -721,25 +726,25 @@ \readjobfile\blockfilename\donothing\donothing \setblocklevel-}% -\def\dodefinieerblok[#1]% +\def\dodefineblock[#1]% {\passeerblok[#1]% - \handhaafblokken[#1]% - \stelblokin + \keepblocks[#1]% + \setupblock [#1] - [\c!voor=\blanko, - \c!na=\blanko, - \c!binnen=, - \c!letter=, + [\c!before=\blank, + \c!after=\blank, + \c!inner=, + \c!style=, \c!file=\jobname]} -\def\definieerblok - {\dosingleargumentwithset\dodefinieerblok} +\def\defineblock + {\dosingleargumentwithset\dodefineblock} -\def\dostelblokin[#1][#2]% +\def\dosetupblock[#1][#2]% {\getparameters[\??tb#1][#2]} -\def\stelblokin - {\dodoubleargumentwithset\dostelblokin} +\def\setupblock + {\dodoubleargumentwithset\dosetupblock} \def\passeerblok[#1]% {\setvalue{\s!thisisblock#1}##1[##2]% @@ -796,28 +801,28 @@ \fi \next} -\def\doverbergblokken[#1][#2]% +\def\dohideblocks[#1][#2]% {\def\docommando##1% - {\setvalue{\e!beginvan##1}% + {\setvalue{\e!begin##1}% {\bgroup\obeylines\dotripleempty\doverbergblok[##1][#2]}}% \processcommalist[#1]\docommando} -\def\verbergblokken - {\dodoubleempty\doverbergblokken} +\def\hideblocks + {\dodoubleempty\dohideblocks} \def\doexecuteloadedblock#1#2% {\blockpermittedtrue % ? - \bgroup % before \c!voor (think of: \c!voor=\startitemize) + \bgroup % before \c!before (think of: \c!before=\startitemize) \dosetupblockparameters[#1][#2]% voor 'voor'? - \getvalue{\??tb#1\c!voor}% - \dostartattributes{\??tb#1}\c!letter\c!kleur\empty + \getvalue{\??tb#1\c!before}% + \dostartattributes{\??tb#1}\c!style\c!color\empty \visibletrue \catcode`\^^M=\@@endofline\relax - \getvalue{\??tb#1\c!binnen}% + \getvalue{\??tb#1\c!inner}% \loadoneblock \par \dostopattributes - \getvalue{\??tb#1\c!na} + \getvalue{\??tb#1\c!after}% \egroup} \def\dohandhaafblok[#1][#2][#3]% @@ -832,7 +837,7 @@ {\doifcommonelse{#2}{#3} {\global\blockpermittedtrue \edef\bloktitel{#1:#2}} - {\doifinsetelse\v!alles{#2} + {\doifinsetelse\v!all{#2} {\doifelsenothing{#3} {\global\blockpermittedtrue \edef\bloktitel{#1}} @@ -854,14 +859,14 @@ \fi \saveblock{#1}{#3#4}} -\def\dohandhaafblokken[#1][#2]% +\def\dokeepblocks[#1][#2]% {\def\docommando##1% - {\setvalue{\e!beginvan##1}% + {\setvalue{\e!begin##1}% {\bgroup\obeylines\dotripleempty\dohandhaafblok[##1][#2]}}% \processcommalist[#1]\docommando} -\def\handhaafblokken - {\dodoubleempty\dohandhaafblokken} +\def\keepblocks + {\dodoubleempty\dokeepblocks} \newconditional\processblockstatus \newconditional\dummyblockstatus @@ -911,7 +916,7 @@ \setvalue{\s!thiswasblock#1}% {\par \dostopattributes - \getvalue{\??tb#1\c!na}% + \getvalue{\??tb#1\c!after}% \egroup \setblocklevel-}% \def\next @@ -919,10 +924,10 @@ \ifconditional\blockassignmentstatus \dosetupblockparameters[#1][#3]% \fi - \getvalue{\??tb#1\c!voor}% - \dostartattributes{\??tb#1}\c!letter\c!kleur\empty + \getvalue{\??tb#1\c!before}% + \dostartattributes{\??tb#1}\c!style\c!color\empty \visibletrue - \getvalue{\??tb#1\c!binnen}}% + \getvalue{\??tb#1\c!inner}}% \fi \else \def\next @@ -935,7 +940,7 @@ {\setvalue{\s!thisisblock#1}##1[##2]% {\dodogebruikblok{#1}{##1}{##2}{#2}}} -\def\dodogebruikblokken[#1][#2]% +\def\dodouseblocks[#1][#2]% {\def\docommando##1% {\dogebruikblok[##1][#2]}% \processcommalist[#1]\docommando @@ -944,40 +949,40 @@ {\loadallblocks{\getvalue{\??tb\commalistelement\c!file}}}% \endgroup} -\def\dogebruikblokken +\def\douseblocks {\begingroup - \doassign[\??bs][\c!criterium=\v!alles]% - \dodoubleempty\dodogebruikblokken} + \doassign[\??bs][\c!criterium=\v!all]% + \dodoubleempty\dodouseblocks} -\def\gebruikblokken - {\setfalse\processblockstatus\dogebruikblokken} +\def\useblocks + {\setfalse\processblockstatus\douseblocks} -\def\verwerkblokken - {\settrue \processblockstatus\dogebruikblokken} +\def\processblocks + {\settrue \processblockstatus\douseblocks} -\def\doselecteerblokken[#1][#2][#3]% +\def\doselectblocks[#1][#2][#3]% {\doifelsenothing{#3} {\getparameters[\??bs][#2]% - \dogebruikblokken[#1][]} + \douseblocks[#1][]} {\getparameters[\??bs][#3]% - \dogebruikblokken[#1][#2]}}% + \douseblocks[#1][#2]}}% -\def\selecteerblokken +\def\selectblocks {\begingroup - \doassign[\??bs][\c!criterium=\v!alles]% - \dotripleempty\doselecteerblokken} + \doassign[\??bs][\c!criterium=\v!all]% + \dotripleempty\doselectblocks} \def\beginvanblok[#1]% % er wordt ook gechecked op \eindvanblok[..] - {\getvalue{\e!beginvan#1}} + {\getvalue{\e!begin#1}} \def\forceerblokken[#1]% {\def\docommando##1% - {\setvalue{\e!beginvan##1}% + {\setvalue{\e!begin##1}% {\setblocklevel+\bgroup \dodoubleempty\doforceerblok[##1]}% - \setvalue{\e!eindvan##1}% + \setvalue{\e!end##1}% {\dostopattributes - \getvalue{\??tb##1\c!na}% + \getvalue{\??tb##1\c!after}% \egroup\setblocklevel-}}% \processcommalist[#1]\docommando} @@ -988,17 +993,17 @@ \ifconditional\blockassignmentstatus \dosetupblockparameters[#1][#2]% \fi - \getvalue{\??tb#1\c!voor}% - \dostartattributes{\??tb#1}\c!letter\c!kleur\empty - \getvalue{\??tb#1\c!binnen}} + \getvalue{\??tb#1\c!before}% + \dostartattributes{\??tb#1}\c!style\c!color\empty + \getvalue{\??tb#1\c!inner}} -\def\passeerblokken[#1]% +\def\bypassblocks[#1]% {\def\docommando##1% - {\setvalue{\e!beginvan##1}% + {\setvalue{\e!begin##1}% {\setblocklevel+\bgroup \obeylines % here, since we look ahead \dodoubleempty\dopasseerblok[##1]}%}% - \setvalue{\e!eindvan##1}% + \setvalue{\e!end##1}% {}}% \processcommalist[#1]\docommando} @@ -1007,20 +1012,20 @@ {\egroup\setblocklevel-}% \checkcopyingblocks \obeylines - \@EA\@EA\@EA\convertargument\@EA\string\csname\e!eindvan#1\endcsname\to\endofblockA + \@EA\@EA\@EA\convertargument\@EA\string\csname\e!end#1\endcsname\to\endofblockA \@EA\convertargument\string\eindvanblok[#1]\to\endofblockB % MULTI LINGUAL MAKEN \setupcopyblock \skipblocklineAB} % the buffer mechanism handles nesting, add some switch -\setvalue{\e!start\v!verbergen}% +\setvalue{\e!start\v!hiding}% {\dostartbuffer[buf-\nofpostponedblocks] - [\e!start\v!verbergen][\e!stop\v!verbergen]} + [\e!start\v!hiding][\e!stop\v!hiding]} -\stelbufferin - [\c!alinea=\v!nee, - \c!voor=, - \c!na=] +\setupbuffer + [\c!paragraph=\v!no, + \c!before=, + \c!after=] -\protect \endinput
\ No newline at end of file +\protect \endinput |