diff options
Diffstat (limited to 'tex/context/base/core-job.tex')
-rw-r--r-- | tex/context/base/core-job.tex | 152 |
1 files changed, 89 insertions, 63 deletions
diff --git a/tex/context/base/core-job.tex b/tex/context/base/core-job.tex index c986a5e56..9df225d31 100644 --- a/tex/context/base/core-job.tex +++ b/tex/context/base/core-job.tex @@ -35,22 +35,22 @@ \unprotect -\def\currentproject {} -\def\currentproduct {} -\def\currentenvironment {} -\def\currentcomponent {} +\let \currentproject \empty +\let \currentproduct \empty +\let \currentenvironment \empty +\let \currentcomponent \empty -\def\loadedfiles {} -\def\processedfiles {} +\let \loadedfiles \empty +\let \processedfiles \empty -\let\geenfilesmeer=\relax +\let \geenfilesmeer \relax \newcounter\textlevel \newcounter\fileprocesslevel \setvalue{\c!file::0}{\jobname} -\def\processedfile% is used in styles, don't change ! +\def\processedfile % is used in styles, don't change ! {\getvalue{\c!file::\fileprocesslevel}} %\def\processfile#1% @@ -64,7 +64,8 @@ {\doglobal\increment\fileprocesslevel \setxvalue{\c!file::\fileprocesslevel}{#2}% \@EA\doglobal\@EA\addtocommalist\@EA{#2}\processedfiles - #1{#2}{}{}% #1=\readlocfile|\readsetfile{dir} #2=filename + % #1=\readlocfile|\readsetfile{dir} #2=filename + #1{#2}\donothing\donothing \doglobal\decrement\fileprocesslevel} \def\processfile#1% @@ -92,57 +93,68 @@ \def\usepath[#1]% {\def\docommando##1% - {\doifelse{##1}{\v!reset} + {\doifelse{##1}\v!reset {\let\allinputpaths\empty} {\addtocommalist{##1}\allinputpaths}}% \processcommalist[#1]\docommando} +\def\usesubpath[#1]% new, see webschrift for usage + {\ifx\allinputpaths\empty + \edef\allinputpaths{#1}% + \else + \def\docommando##1% + {\def\dodocommando####1{\addtocommalist{##1/####1}\allinputpaths}% + \processcommalist[#1]\dodocommando}% + \processcommacommand[\allinputpaths]\docommando + \fi} + \def\registreerfileinfo[#1#2]#3% geen \showmessage ? - {\writestatus{\m!systems}{#1#2 file #3 at line \the\inputlineno}% + {\writestatus\m!systems{#1#2 file #3 at line \the\inputlineno}% \immediatewriteutility{f #1 {#3}}} \doifundefined{preloadfonts} {\let\preloadfonts=\relax} \doifundefined{preloadspecials} {\let\preloadspecials=\relax} -% \def\loadsystemfiles% +% \def\loadsystemfiles % {\reportprotectionstate -% \readsysfile{\f!newfilename} -% {\showmessage{\m!systems}{2}{\f!newfilename}}{}% -% \readsysfile{\f!oldfilename} -% {\showmessage{\m!systems}{2}{\f!oldfilename}}{}% -% \readsysfile{\f!filfilename} -% {\showmessage{\m!systems}{2}{\f!filfilename}}{}% -% \readsysfile{\f!sysfilename} -% {\showmessage{\m!systems}{2}{\f!sysfilename}}{}} +% \readsysfile\f!newfilename +% {\showmessage\m!systems2\f!newfilename}\donothing +% \readsysfile\f!oldfilename +% {\showmessage\m!systems2\f!oldfilename}\donothing +% \readsysfile\f!filfilename +% {\showmessage\m!systems2\f!filfilename}\donothing +% \readsysfile\f!sysfilename +% {\showmessage\m!systems2\f!sysfilename}\donothing} % % test \@@svgebied \def\loadallsystemfiles#1% {\ifx\@@svgebied\empty - \readsysfile{#1}{\showmessage{\m!systems}{2}{#1}}{}% + \readsysfile{#1}{\showmessage\m!systems2{#1}}\donothing \else \def\doloadsystemfile##1% - {\readsetfile{##1}{#1}{\showmessage{\m!systems}{2}{#1}}{}}% + {\readsetfile{##1}{#1}{\showmessage\m!systems2{#1}}\donothing}% \processcommacommand[\@@svgebied]\doloadsystemfile \fi} -\def\loadsystemfiles% +\def\loadsystemfiles {\reportprotectionstate - \readsysfile{\f!newfilename} - {\showmessage{\m!systems}{2}{\f!newfilename}}{}% - \readsysfile{\f!oldfilename} - {\showmessage{\m!systems}{2}{\f!oldfilename}}{}% + \readsysfile\f!newfilename + {\showmessage\m!systems2\f!newfilename}\donothing + \readsysfile\f!oldfilename + {\showmessage\m!systems2\f!oldfilename}\donothing \loadallsystemfiles\f!filfilename - \loadallsystemfiles\f!sysfilename} + \loadallsystemfiles\f!sysfilename + }%\loadallsystemfiles\f!modfilename} %D Loading of \type {cont-usr.tex} (edited by the user) %D and \type {cont-fmt.tex} (generated by texexec). \def\loaduserspecifications - {\readsysfile{\f!usrfilename} - {\showmessage{\m!systems}{2}{\f!usrfilename}}{}% - \readjobfile{\f!fmtfilename} - {\showmessage{\m!systems}{2}{\f!fmtfilename}}{}} + {\readsysfile\f!usrfilename + {\showmessage\m!systems2\f!usrfilename}\donothing + \readjobfile\f!fmtfilename + {\showmessage\m!systems2\f!fmtfilename}\donothing} %D We don't want multiple jobfiles to interfere. @@ -151,11 +163,11 @@ \xdef\texcommentsymbol{%} \egroup -\def\loadoptionfile% +\def\loadoptionfile {\readjobfile{\jobname.\f!optionextension} - {\showmessage{\m!systems}{2}{\jobname.\f!optionextension}}% - %{\showmessage{\m!systems}{2}{\jobname.\f!optionextension}}} - {\writestatus{\m!systems}{no \jobname.\f!optionextension}}} + {\showmessage\m!systems2{\jobname.\f!optionextension}}% + %{\showmessage\m!systems2{\jobname.\f!optionextension}}} + {\writestatus\m!systems {no \jobname.\f!optionextension}}} % \newevery \everyjob \EveryJob % \appendtoks ... \to \everyjob @@ -190,21 +202,32 @@ \prependtoks \loadtwopassdata \to \everystarttext % moved 28-02-2002 \appendtoks \checkreferences \to \everystarttext % new 04-12-1999 -\def\doateverystarttext% +% Most natural ... +% +% \def\doateverystarttext +% {\the\everystarttext +% \global\let\doateverystarttext\relax} +% +% ... most practical, since we can load env's in a +% something.run file (nested \starttext's; see for +% instance x-res-08, where we definitely want to +% open the file!). + +\def\doateverystarttext {\the\everystarttext - \global\let\doateverystarttext\relax} + \global\everystarttext\emptytoks} -\def\starttekst% +\def\starttekst {\doateverystarttext - \ifnum\textlevel=0 - \registreerfileinfo[begin]{\jobname}% - \expandafter\startcopyingblocks + \ifnum\textlevel=\zerocount + \registreerfileinfo[begin]{\jobname}% + \expandafter\startcopyingblocks \fi \doglobal\increment\textlevel\relax} -\def\stoptekst% +\def\stoptekst {\doglobal\decrement\textlevel\relax - \ifnum\textlevel>0 \else + \ifnum\textlevel>\zerocount \else \the\everystoptext %\the\everybye % %\the\everygoodbye % == \end (new) @@ -217,23 +240,23 @@ \let\normalend=\end -\def\end% - {\ifnum\textlevel>0 \else +\def\end + {\ifnum\textlevel>\zerocount \else \the\everybye \the\everygoodbye - \global\everygoodbye\emptytoks % rather unneeded - \global\everybye\emptytoks % but for sure + \global\everybye \emptytoks % rather unneeded + \global\everygoodbye\emptytoks % but for sure \expandafter\normalend \fi} \def\doexecutefileonce#1% {\beforesplitstring#1\at.\to\currentfile - \fullexpandtwoargsafter\doifnotinset{\currentfile}{\loadedfiles}% - {\fullexpandoneargafter\addtocommalist{\currentfile}\loadedfiles + \fullexpandtwoargsafter\doifnotinset\currentfile\loadedfiles + {\fullexpandoneargafter\addtocommalist\currentfile\loadedfiles \doexecutefile{#1}}} \def\doexecutefile#1% - {\registreerfileinfo[begin]{#1} + {\registreerfileinfo[begin]{#1}% \processfile{#1}% \registreerfileinfo[end]{#1}} @@ -269,8 +292,8 @@ \increment\filelevel\relax \fullexpandoneargafter\addtocommalist{#1}\loadedfiles} -\def\doprevlevel% - {\ifnum\filelevel=1 +\def\doprevlevel + {\ifnum\filelevel=\plusone \expandafter\stoptekst \else \decrement\filelevel\relax @@ -282,7 +305,7 @@ \donotexecutefile\doexecutefileonce \doexecutefileonce\doexecutefile#1\\} -\def\stopprojekt% +\def\stopprojekt {\doprevlevel} \def\startprodukt #1 % @@ -291,7 +314,7 @@ \doexecutefileonce\doexecutefileonce \donotexecutefile\doexecutefile#1\\} -\def\stopprodukt% +\def\stopprodukt {\doprevlevel} \def\startonderdeel #1 % @@ -300,7 +323,7 @@ \doexecutefileonce\doexecutefileonce \donotexecutefile\doexecutefile#1\\} -\def\stoponderdeel% +\def\stoponderdeel {\doprevlevel} \def\startomgeving #1 % @@ -308,17 +331,17 @@ \donotexecutefile\doexecutefileonce \donotexecutefile\donotexecutefile#1\\} -\def\stopomgeving% +\def\stopomgeving {\doprevlevel} \def\startdeelomgeving[#1]% {\let\loadedlocalenvironments\empty \def\docommando##1% {\beforesplitstring##1\at.\to\someevironment - \fullexpandoneargafter\addtocommalist{\someevironment}\loadedlocalenvironments}% + \fullexpandoneargafter\addtocommalist\someevironment\loadedlocalenvironments}% \processcommalist[#1]\docommando \fullexpandtwoargsafter\doifcommonelse % no longer next needed - {\currentproject,\currentproduct, + {\currentproject,\currentproduct,% \currentcomponent,\currentenvironment} {\loadedlocalenvironments} {\letvalue{\e!stop\e!deelomgeving}\relax} @@ -342,8 +365,8 @@ \long\def\startsetups#1 #2\stopsetups% for international purposes {\long\setvalue{\??su#1}{#2}} -\def\dodosetups#1% - {\getvalue{\??su#1}} +\def\setups + {\dosingleargument\dosetups} \def\dosetups[#1]% {\iffirstargument @@ -352,8 +375,11 @@ \expandafter\dodosetups \fi} -\def\setups% - {\dosingleargument\dosetups} +\def\dodosetups#1% + {\getvalue{\??su#1}} + +\def\doifsetupselse#1% + {\doifdefinedelse{\??su#1}} % Het <pagina>-karakter (FormFeed), wordt omgezet in \par |