summaryrefslogtreecommitdiff
path: root/tex/context/base/syst-pln.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/syst-pln.tex')
-rw-r--r--tex/context/base/syst-pln.tex289
1 files changed, 145 insertions, 144 deletions
diff --git a/tex/context/base/syst-pln.tex b/tex/context/base/syst-pln.tex
index bf2cc1e60..becf67f83 100644
--- a/tex/context/base/syst-pln.tex
+++ b/tex/context/base/syst-pln.tex
@@ -8,24 +8,24 @@
%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 We used to load plain \TEX\ in a special way, but redefining
%D a couple of primitives so that for instance font loading was
-%D ignored. For those interested, this loader is found in
-%D \type {syst-tex.tex}.
+%D ignored. For those interested, this loader is found in
+%D \type {syst-tex.tex}.
%D This is a stripped down version of plain \TEX. We need this
%D module to get started. Whole sections are missing here,
%D like font loading and math. Thise are taken care of in
-%D dedicated modules. A few definitions are added (and
-%D marked as such).
+%D dedicated modules. A few definitions are added (and
+%D marked as such).
%D Characters can have special states, that can be triggered
%D by setting their category coded. Some are preset, others
%D are to be set as soon as possible, otherwise we cannot
-%D define any useful macros.
+%D define any useful macros.
%catcode`\^^@ = 9 % ascii null is ignored
%catcode`\\ = 0 % backslash is TeX escape character
@@ -45,44 +45,44 @@
%catcode`\^^? = 15 % ascii delete is invalid
\catcode`\~ = 13 % tilde is active
-\catcode`\^^L = 13 % ascii form-feed
+\catcode`\^^L = 13 % ascii form-feed
-%catcode`\A = 11
+%catcode`\A = 11
%.......
%catcode`\Z = 11
-%catcode`\a = 11
+%catcode`\a = 11
%.......
-%catcode`\z = 11
+%catcode`\z = 11
-\chardef\active = 13
+\chardef\active = 13
-\def ^^L{\par}
+\def ^^L{\par}
\def\^^M{\ } % control <return> = control <space>
\def\^^I{\ } % same for <tab>
%D In \CONTEXT, we simply ignore end||of||file tokens:
-
+
\catcode`\^^Z=9
-%D First we define a simplified version of the \CONTEXT\
+%D First we define a simplified version of the \CONTEXT\
%D protection mechanism.
\def\unprotect{\catcode`@=11}
\def\protect {\catcode`@=12}
-\unprotect
+\unprotect
-%D We do not set up mathcodes here, but postpone that to the
-%D math modules.
+%D We do not set up mathcodes here, but postpone that to the
+%D math modules.
\mathcode`\ = "8000 % \space
\mathcode`\' = "8000 % ^\prime
\mathcode`\_ = "8000 % \_
\mathcode`\^^? = "1273 % \smallint
-\sfcode`\)=0
-\sfcode`\'=0
+\sfcode`\)=0
+\sfcode`\'=0
\sfcode`\]=0
\chardef\@ne = 1
@@ -96,33 +96,33 @@
\mathchardef\@M = 10000
\mathchardef\@MM = 20000
-%D Pretty important definitions:
+%D Pretty important definitions:
-\let\bgroup={
+\let\bgroup={
\let\egroup=}
%D In plain \TEX\ the following explanation about the register
-%D allocation mechanism is given:
+%D allocation mechanism is given:
%D
-%D \startsmaller
+%D \startnarrower
%D The following counters are reserved:
%D
-%D \starttabulatie
-%D \NC 0--9 \NC page numbering \NC \NR
-%D \NC 10 \NC count allocation \NC \NR
-%D \NC 11 \NC dimen allocation \NC \NR
-%D \NC 12 \NC skip allocation \NC \NR
-%D \NC 13 \NC muskip allocation \NC \NR
-%D \NC 14 \NC box allocation \NC \NR
-%D \NC 15 \NC toks allocation \NC \NR
-%D \NC 16 \NC read file allocation \NC \NR
-%D \NC 17 \NC write file allocation \NC \NR
-%D \NC 18 \NC math family allocation \NC \NR
-%D \NC 19 \NC language allocation \NC \NR
-%D \NC 20 \NC insert allocation \NC \NR
-%D \NC 21 \NC the most recently allocated number \NC \NR
-%D \NC 22 \NC constant $-1$ \NC \NR
-%D \stoptabulatie
+%D \starttabulate
+%D \NC 0--9 \NC page numbering \NC \NR
+%D \NC 10 \NC count allocation \NC \NR
+%D \NC 11 \NC dimen allocation \NC \NR
+%D \NC 12 \NC skip allocation \NC \NR
+%D \NC 13 \NC muskip allocation \NC \NR
+%D \NC 14 \NC box allocation \NC \NR
+%D \NC 15 \NC toks allocation \NC \NR
+%D \NC 16 \NC read file allocation \NC \NR
+%D \NC 17 \NC write file allocation \NC \NR
+%D \NC 18 \NC math family allocation \NC \NR
+%D \NC 19 \NC language allocation \NC \NR
+%D \NC 20 \NC insert allocation \NC \NR
+%D \NC 21 \NC the most recently allocated number \NC \NR
+%D \NC 22 \NC constant $-1$ \NC \NR
+%D \stoptabulate
%D
%D New counters are allocated starting with 23, 24, etc. Other
%D registers are allocated starting with 10. This leaves 0
@@ -138,17 +138,17 @@
%D lowest-numbered insert that has been allocated. Of course,
%D \type {\box255} is reserved for \type {\output}; \type
%D {\count255}, \type {\dimen255}, and \type {\skip255} can be
-%D used freely.
-%D
+%D used freely.
+%D
%D It is recommended that macro designers always use \type
%D {\globa}l assignments with respect to registers numbered 1,
%D 3, 5, 7, 9, and always non||\type {\global} assignments
%D with respect to registers 0, 2, 4, 6, 8, 255. This will
%D prevent \quote {save stack buildup} that might otherwise
-%D occur.
-%D \stopsmaller
+%D occur.
+%D \stopnarrower
%D
-%D We well overload some macros in \ETEX\ mode.
+%D We well overload some macros in \ETEX\ mode.
\count10 = 22 % allocates \count registers 23, 24, ...
\count11 = 9 % allocates \dimen registers 10, 11, ...
@@ -165,14 +165,14 @@
\countdef\insc@unt = 20 % the insertion counter
\countdef\allocationnumber= 21 % the most recent allocation
\countdef\m@ne = 22 % a handy constant
- \m@ne = -1
+ \m@ne = -1
\def\wlog{\immediate\write\m@ne} % write on log file (only)
-%D \startsmaller
+%D \startnarrower
%D Here are abbreviations for the names of scratch registers
%D that don't need to be allocated.
-%D \stopsmaller
+%D \stopnarrower
\countdef \count@ = 255
\dimendef \dimen@ = 0
@@ -181,15 +181,15 @@
\skipdef \skip@ = 0
\toksdef \toks@ = 0
-%D \startsmaller
+%D \startnarrower
%D Now, we define \type {\newcount}, \type {\newbox}, etc. so
%D that you can say \newcount\foo and \type {\foo} will be
%D defined (with \type {\countdef}) to be the next counter. To
%D find out which counter \type {\foo} is, you can look at
%D \type {\allocationnumber}. Since there's no \type {\boxdef}
%D command, \type {\chardef} is used to define a \type
-%D {\newbox}, \type {\newinsert}, \type {\newfam}, and so on.
-%D \stopsmaller
+%D {\newbox}, \type {\newinsert}, \type {\newfam}, and so on.
+%D \stopnarrower
\def\newcount {\alloc@0\count \countdef \insc@unt}
\def\newdimen {\alloc@1\dimen \dimendef \insc@unt}
@@ -226,35 +226,35 @@
\errmessage{No room for a new #3}
\fi}
-\newdimen\maxdimen \maxdimen = 16383.99999pt
-\newskip \hideskip \hideskip = -1000pt plus 1fill
+\newdimen\maxdimen \maxdimen = 16383.99999pt
+\newskip \hideskip \hideskip = -1000pt plus 1fill
\newskip \centering \centering = 0pt plus 1000pt minus 1000pt
-\newdimen\p@ \p@ = 1pt
-\newdimen\z@ \z@ = 0pt
+\newdimen\p@ \p@ = 1pt
+\newdimen\z@ \z@ = 0pt
\newskip \z@skip \z@skip = 0pt plus 0pt minus 0pt
\newbox \voidb@x % permanently void box register
-%D We define \type {\newif} a la plain \TEX, but will
-%D redefine it later. As Knuth says:
+%D We define \type {\newif} a la plain \TEX, but will
+%D redefine it later. As Knuth says:
+%D
+%D \startnarrower
+%D And here's a different sort of allocation: for example,
%D
-%D \startsmaller
-%D And here's a different sort of allocation: for example,
+%D \starttyping
+%D \newif\iffoo
+%D \stoptyping
%D
-%D \starttypen
-%D \newif\iffoo
-%D \stoptypen
-%D
-%D creates \type {\footrue}, \type {\foofalse} to go
+%D creates \type {\footrue}, \type {\foofalse} to go
%D with \type {\iffoo}.
-%D \stopsmaller
+%D \stopnarrower
\def\newif#1%
- {\count@\escapechar
+ {\count@\escapechar
\escapechar\m@ne
\expandafter\expandafter\expandafter\def\@if #1{true}{\let#1\iftrue }%
\expandafter\expandafter\expandafter\def\@if#1{false}{\let#1\iffalse}%
\@if#1{false}% the condition starts out false
- \escapechar\count@}
+ \escapechar\count@}
\def\@if#1#2%
{\csname\expandafter\if@\string#1#2\endcsname}
@@ -265,7 +265,7 @@
\egroup
-%D Build||in numeric variables.
+%D Build||in numeric variables.
\adjdemerits = 10000
\binoppenalty = 700
@@ -277,21 +277,21 @@
\delimiterfactor = 901
\displaywidowpenalty = 50
\doublehyphendemerits = 10000
-%endlinechar = `\^^M
-\errorcontextlines = 5
-%escapechar = `\\
+%endlinechar = `\^^M
+\errorcontextlines = 5
+%escapechar = `\\
\exhyphenpenalty = 50
%fam = 0
\finalhyphendemerits = 5000
%floatingpenalty = 0
%globaldefs = 0
-%hangafter = 1
+%hangafter = 1
\hbadness = 1000
%holdinginserts = 0
\hyphenpenalty = 50
%interlinepenalty = 0
%language = 0
-\lefthyphenmin = 2
+\lefthyphenmin = 2
\linepenalty = 10
%looseness = 0
%mag = 1000
@@ -308,7 +308,7 @@
\showboxbreadth = 5
\showboxdepth = 3
%time = 0
-\tolerance = 200
+\tolerance = 200
%tracingcommands = 0
\tracinglostchars = 1
%tracingmacros = 0
@@ -323,15 +323,15 @@
\widowpenalty = 150
%year = 0
-%D Extra numeric variables.
+%D Extra numeric variables.
-\newcount \interdisplaylinepenalty
-\newcount \interfootnotelinepenalty
+\newcount \interdisplaylinepenalty
+\newcount \interfootnotelinepenalty
\interdisplaylinepenalty = 100
\interfootnotelinepenalty = 100
-%D Build in dimension variables.
+%D Build in dimension variables.
\abovedisplayshortskip = 0pt plus 3pt
\abovedisplayskip = 12pt plus 3pt minus 9pt
@@ -372,15 +372,15 @@
\vsize = 8.9in
%xspaceskip = 0pt
-%D Extra dimension parameters.
+%D Extra dimension parameters.
-\newskip \bigskipamount
-\newdimen \jot
-\newskip \medskipamount
-\newskip \normalbaselineskip
-\newskip \normallineskip
-\newdimen \normallineskiplimit
-\newskip \smallskipamount
+\newskip \bigskipamount
+\newdimen \jot
+\newskip \medskipamount
+\newskip \normalbaselineskip
+\newskip \normallineskip
+\newdimen \normallineskiplimit
+\newskip \smallskipamount
\bigskipamount = 12pt plus 4pt minus 4pt
\jot = 3pt
@@ -390,15 +390,15 @@
\normallineskiplimit = 0pt
\smallskipamount = 3pt plus 1pt minus 1pt
-%D The following shortcuts are rather standard:
+%D The following shortcuts are rather standard:
-\def\lq{`}
+\def\lq{`}
\def\rq{'}
-\def\lbrack{[}
+\def\lbrack{[}
\def\rbrack{]}
-\let\endgraf=\par
+\let\endgraf=\par
\let\endline=\cr
\def\space{ }
@@ -406,46 +406,47 @@
\def\null {\hbox{}}
%D The next loop construct is about the fastest you can get.
-%D Beware: this macro does not support nested loops.
+%D Beware: this macro does not support nested loops. We use
+%D a namespace prefix \type {@@pln}.
-\long\def\loop#1\repeat{\long\def\body{#1}\iterate}
+\long\def\loop#1\repeat{\long\def\@@plnbody{#1}\@@plniterate}
-%D The following makes \type {\loop} \unknown\ \type {\if}
-%D \unknown\ \type {\repeat} skippable:
+%D The following makes \type {\loop} \unknown\ \type {\if}
+%D \unknown\ \type {\repeat} skippable (clever trick):
-\let\repeat=\fi
+\let\repeat=\fi
-%D The original:
+%D The original (no \type {@@pln} there):
-\def\iterate{\body\let\next\iterate\else\let\next\relax\fi\next}
+\def\@@plniterate{\@@plnbody\let\next\@@plniterate\else\let\next\relax\fi\next}
-%D A more efficient alternative:
+%D A more efficient alternative:
-\def\iterate{\body\expandafter\iterate\else\expandafter\relax\fi}
+\def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\expandafter\relax\fi}
-%D An even more efficient one:
+%D An even more efficient one:
-\def\iterate{\body\expandafter\iterate\else\fi}
+\def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\fi}
%D Counter 0 is normally used as page counter:
\countdef\pageno=0 \pageno=1 % first page is number 1
%D Beside the raw counter \type {\pageno} the \type {\folio}
-%D macro provides the value.
+%D macro provides the value.
\def\folio{\the\pageno}
-%D Indeed, we don't define a real output routine yet:
+%D Indeed, we don't define a real output routine yet:
\output{\box255}
-%D We don't support \type {\magnification} and just consume
-%D the value.
+%D We don't support \type {\magnification} and just consume
+%D the value.
\let\magnification\count@
-%D The following macro will be overloaded in \ETEX.
+%D The following macro will be overloaded in \ETEX.
\def\tracingall
{\tracingonline \@ne
@@ -461,8 +462,8 @@
\showboxdepth \maxdimen
\errorstopmode}
-%D Some users expect this macro to be present. This one
-%D sends the hyphenated word to the terminal.
+%D Some users expect this macro to be present. This one
+%D sends the hyphenated word to the terminal.
\def\showhyphens#1%
{\setbox0\vbox
@@ -471,31 +472,31 @@
\pretolerance\m@ne
\tolerance\m@ne
\hbadness0
- \showboxdepth0
+ \showboxdepth0
\ #1}}
%D The following bunch of macros deals with basic alignment.
-%D We just include them here so that they can be used if
-%D needed. Normally, \CONTEXT\ users will fall back on one of
-%D the three table environments.
+%D We just include them here so that they can be used if
+%D needed. Normally, \CONTEXT\ users will fall back on one of
+%D the three table environments.
\newcount \mscount
-\newif \ifus@
+\newif \ifus@
\newif \if@cr
-\newbox \tabs
-\newbox \tabsyet
+\newbox \tabs
+\newbox \tabsyet
\newbox \tabsdone
\def\hidewidth % for alignment entries that can stick out
- {\hskip\hideskip}
+ {\hskip\hideskip}
\def\ialign % initialized \halign
{\everycr{}
\tabskip\z@skip
- \halign}
+ \halign}
\def\multispan#1%
- {\omit
+ {\omit
\mscount#1\relax
\loop
\ifnum\mscount>\@ne \sp@n
@@ -507,43 +508,43 @@
\advance\mscount\m@ne}
\def\cleartabs
- {\global\setbox\tabsyet\null
+ {\global\setbox\tabsyet\null
\setbox\tabs\null}
\def\settabs
- {\setbox\tabs\null
+ {\setbox\tabs\null
\futurelet\next\sett@b}
\def\sett@b
- {\ifx\next\+%
+ {\ifx\next\+%
\def\nxt{\afterassignment\s@tt@b\let\nxt}%
\else
\let\nxt\s@tcols
- \fi
- \let\next\relax
+ \fi
+ \let\next\relax
\nxt}
-\def\s@tt@b%
- {\let\nxt\relax
+\def\s@tt@b%
+ {\let\nxt\relax
\us@false\m@ketabbox}
-\def\tabalign%
- {\us@true\m@ketabbox}
+\def\tabalign%
+ {\us@true\m@ketabbox}
-\let\+\tabalign % no outer here
+\let\+\tabalign % no outer here
\def\s@tcols#1\columns%
{\count@#1%
\dimen@\hsize
\loop
- \ifnum\count@>\z@ \@nother
+ \ifnum\count@>\z@ \@nother
\repeat}
\def\@nother%
- {\dimen@ii\dimen@
+ {\dimen@ii\dimen@
\divide\dimen@ii\count@
\setbox\tabs\hbox{\hbox to\dimen@ii{}\unhbox\tabs}%
- \advance\dimen@-\dimen@ii
+ \advance\dimen@-\dimen@ii
\advance\count@\m@ne}
\def\m@ketabbox%
@@ -564,8 +565,8 @@
{\if@cr
\egroup % now \box\z@ holds the column
\else
- \hss\egroup
- \global\setbox\tabsyet\hbox
+ \hss\egroup
+ \global\setbox\tabsyet\hbox
{\unhbox\tabsyet\global\setbox\@ne\lastbox}% now \box\@ne holds its size
\ifvoid\@ne
\global\setbox\@ne\hbox to\wd\z@{}%
@@ -576,7 +577,7 @@
\fi
\box\z@}
-%D Users are advised not to use the following macros:
+%D Users are advised not to use the following macros:
\def\hang
{\hangindent\parindent}
@@ -590,11 +591,11 @@
{\advance\leftskip \parindent
\advance\rightskip\parindent}
-%D Useful, used too, but sometimes dangerous:
+%D Useful, used too, but sometimes dangerous:
-\def\leavevmode{\unhbox\voidb@x}
+\def\leavevmode{\unhbox\voidb@x}
-%D We will overload these, but may need them beforehand:
+%D We will overload these, but may need them beforehand:
\bgroup
\catcode`\^^M=\active%
@@ -615,27 +616,27 @@
\chardef\#=`\#
\chardef\$=`\$
-\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}}
+\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}}
-%D Used at all?
+%D Used at all?
\def\slash{/\penalty\exhyphenpenalty} % a `/' that acts like a `-'
-%D Replaced later on:
+%D Replaced later on:
\def\line {\hbox to\hsize}
\def\leftline #1{\line{#1\hss}}
\def\rightline #1{\line{\hss#1}}
\def\centerline#1{\line{\hss#1\hss}}
-%D These are used by TaBlE:
+%D These are used by TaBlE:
\newif\ifh@
\newif\ifv@
-%D Let's end in the plain way:
+%D Let's end in the plain way:
\def\fmtname {ConTeXt Minimized Plain TeX}
-\def\fmtversion{3.1415926}
+\def\fmtversion{3.1415926}
-\protect \endinput
+\protect \endinput