summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mult-ini.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/mult-ini.mkiv')
-rw-r--r--tex/context/base/mkiv/mult-ini.mkiv449
1 files changed, 205 insertions, 244 deletions
diff --git a/tex/context/base/mkiv/mult-ini.mkiv b/tex/context/base/mkiv/mult-ini.mkiv
index 8fd0d9472..d66749d14 100644
--- a/tex/context/base/mkiv/mult-ini.mkiv
+++ b/tex/context/base/mkiv/mult-ini.mkiv
@@ -11,27 +11,25 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D This module is a stripped down version of \type {mult-ini.tex},
-%D which we keep around as \type {mult-kep.tex} for sentimental
-%D reasons. There you will find some more historic information.
+%D This module is a stripped down version of \type {mult-ini.tex}, which we keep
+%D around as \type {mult-kep.tex} for sentimental reasons. There you will find some
+%D more historic information.
\writestatus{loading}{ConTeXt Multilingual Macros / Initialization}
\unprotect
-\registerctxluafile{mult-ini}{1.001}
+\registerctxluafile{mult-ini}{}
%D \macros
%D [constanten,variabelen,commands]
%D {v!,c!,k!,s!,e!,m!,l!,r!,f!,p!,x!,y!}
%D
-%D In the system modules we introduced some prefixed constants,
-%D variables (both macros) and registers. Apart from a
-%D tremendous saving in terms of memory and a gain in speed we
-%D use from now on prefixes when possible for just another
-%D reason: consistency and multi||linguality. Systematically
-%D using prefixed macros enables us to implement a
-%D multi||lingual user interface. Redefining these next set of
+%D In the system modules we introduced some prefixed constants, variables (both
+%D macros) and registers. Apart from a tremendous saving in terms of memory and a
+%D gain in speed we use from now on prefixes when possible for just another reason:
+%D consistency and multi||linguality. Systematically using prefixed macros enables
+%D us to implement a multi||lingual user interface. Redefining these next set of
%D prefixes therefore can have desastrous results.
%D
%D \startlinecorrection
@@ -50,9 +48,9 @@
%D \stoptable
%D \stoplinecorrection
%D
-%D In the single||lingual version we used \type{!}, \type{!!},
-%D \type{!!!} and \type{!!!!}. In the meantime some of these
-%D are obsolete (we had some 12 originally).
+%D In the single||lingual version we used \type {!}, \type {!!}, \type {!!!} and
+%D \type {!!!!}. In the meantime some of these are obsolete (we had some 12
+%D originally).
\def\c!prefix!{c!}
\def\k!prefix!{k!}
@@ -66,18 +64,16 @@
%D [constants,variables,commands]
%D {@@,??}
%D
-%D Variables generated by the system can be recognized on their
-%D prefix \type{@@}. They are composed of a command (class)
-%D specific tag, which can be recognized on \type{??}, and a
-%D system constant, which has the prefix \type{c!}. We'll se
-%D some more of this.
+%D Variables generated by the system can be recognized on their prefix \type {@@}.
+%D They are composed of a command (class) specific tag, which can be recognized on
+%D \type {??}, and a system constant, which has the prefix \type {c!}. We'll se some
+%D more of this.
\def\??prefix {??}
\def\@@prefix {@@}
-%D Just to be complete we repeat some of the already defined
-%D system constants here. Maybe their prefix \type{\s!} now
-%D falls into place.
+%D Just to be complete we repeat some of the already defined system constants here.
+%D Maybe their prefix \type {\s!} now falls into place.
\def\s!next {next} \def\s!default {default}
\def\s!dummy {dummy} \def\s!unknown {unknown}
@@ -90,26 +86,24 @@
\def\s!true {true}
\def\s!false {false}
-%D The word \type{height} takes 6~token memory cells. The
-%D control sequence \type{\height} on the other hand uses only
-%D one. Knowing this, we can improve the performance of \TEX,
-%D both is terms of speed and memory usage, by using control
+%D The word \type {height} takes 6~token memory cells. The control sequence \type
+%D {\height} on the other hand uses only one. Knowing this, we can improve the
+%D performance of \TEX, both is terms of speed and memory usage, by using control
%D sequences instead of the words written in full.
%D
-%D Where in the \ASCII\ file the second lines takes nine extra
-%D characters, \TEX\ saves us 13~tokens.
+%D Where in the \ASCII\ file the second lines takes nine extra characters, \TEX\
+%D saves us 13~tokens.
%D
%D \starttyping
%D \hrule width 10pt height 2pt depth 1pt
%D \hrule \s!width 10pt \s!height 2pt \s!depth 1pt
%D \stoptyping
%D
-%D One condition is that we have defined \type {\s!height},
-%D \type {\s!width} and \type {\s!depth} as respectively
-%D \type {height}, \type {width} and \type {depth}. Using this
-%D scheme therefore only makes sense when a token sequence is
-%D used more than once. Savings like this should of course be
-%D implemented in english, just because \TEX\ is english.
+%D One condition is that we have defined \type {\s!height}, \type {\s!width} and
+%D \type {\s!depth} as respectively \type {height}, \type {width} and \type {depth}.
+%D Using this scheme therefore only makes sense when a token sequence is used more
+%D than once. Savings like this should of course be implemented in english, just
+%D because \TEX\ is english.
\def\s!width {width} \let\!!width \s!width % obsolete
\def\s!height{height} \let\!!height\s!height % obsolete
@@ -142,19 +136,16 @@
%D definemessageconstant,
%D definefileconstant}
%D
-%D The first part of this module is dedicated to dealing with
-%D multi||lingual constants and variables. When \CONTEXT\ grew
-%D bigger and bigger in terms of bytes and used string space,
-%D we switched to predefined constants. At the cost of more
-%D hash table entries, the macros not only becase more compact,
-%D they became much faster too. Maybe an even bigger advantage
-%D was that mispelling could no longer lead to problems. Even a
-%D multi||lingual interface became possible.
+%D The first part of this module is dedicated to dealing with multi||lingual
+%D constants and variables. When \CONTEXT\ grew bigger and bigger in terms of bytes
+%D and used string space, we switched to predefined constants. At the cost of more
+%D hash table entries, the macros not only becase more compact, they became much
+%D faster too. Maybe an even bigger advantage was that mispelling could no longer
+%D lead to problems. Even a multi||lingual interface became possible.
%D
-%D Constants --- we'll introduce the concept of variables later
-%D on --- are preceded by a type specific prefix, followed by a
-%D \type{!}. To force consistency, we provide a few commands
-%D for defining such constants.
+%D Constants |<|we'll introduce the concept of variables later on|>| are preceded by
+%D a type specific prefix, followed by a \type {!}. To force consistency, we provide
+%D a few commands for defining such constants.
%D
%D \starttyping
%D \defineinterfaceconstant {name} {meaning}
@@ -192,10 +183,9 @@
\unexpanded\def\definesystemconstant #1{\expandafter\def\csname\s!prefix!#1\endcsname{#1}}
\unexpanded\def\definemessageconstant #1{\expandafter\def\csname\m!prefix!#1\endcsname{#1}}
-%D In a parameter driven system, some parameters are shared
-%D by more system components. In \CONTEXT\ we can distinguish
-%D parameters by a unique prefix. Such a prefix is defined
-%D with:
+%D In a parameter driven system, some parameters are shared by more system
+%D components. In \CONTEXT\ we can distinguish parameters by a unique prefix. Such a
+%D prefix is defined with:
%D
%D \starttyping
%D \definesystemvariable {name}
@@ -209,16 +199,14 @@
%D {selectinterface,
%D defaultinterface, currentinterface, currentresponses}
%D
-%D With \type{\selectinterface} we specify the language we are
-%D going to use. The system asks for the language wanted, and
-%D defaults to \type{\currentinterface} when we just give
-%D \type{enter}. By default the message system uses the
-%D current interface language, but \type{\currentresponses}
-%D can specify another language too.
+%D With \type {\selectinterface} we specify the language we are going to use. The
+%D system asks for the language wanted, and defaults to \type {\currentinterface}
+%D when we just give \type {enter}. By default the message system uses the current
+%D interface language, but \type {\currentresponses} can specify another language
+%D too.
%D
-%D Because we want to generate formats directly too, we do
-%D not ask for interface specifications when these are already
-%D defined (like in cont-nl.tex and alike).
+%D Because we want to generate formats directly too, we do not ask for interface
+%D specifications when these are already defined (like in cont-nl.tex and alike).
\ifdefined\defaultinterface
@@ -257,9 +245,8 @@
%D \macros
%D {startinterface}
%D
-%D Sometimes we want to define things only for specific
-%D interface languages. This can be done by means of the
-%D selector:
+%D Sometimes we want to define things only for specific interface languages. This
+%D can be done by means of the selector:
%D
%D \starttyping
%D \startinterface language
@@ -273,24 +260,22 @@
{\doifnot{#1}{all}{\doifnotinset\currentinterface{#1}{\gobbleuntil\stopinterface}}}
\let\stopinterface\relax
-
+
%D \macros
%D {startmessages,
%D getmessage,
%D showmessage,
%D makemessage}
%D
-%D A package as large as \CONTEXT\ can hardly function without
-%D a decent message mechanism. Due to its multi||lingual
-%D interface, the message subsystem has to be multi||lingual
-%D too. A major drawback of this feature is that we have to
-%D code messages. As a result, the source becomes less self
-%D documented. On the other hand, consistency will improve.
+%D A package as large as \CONTEXT\ can hardly function without a decent message
+%D mechanism. Due to its multi||lingual interface, the message subsystem has to be
+%D multi||lingual too. A major drawback of this feature is that we have to code
+%D messages. As a result, the source becomes less self documented. On the other
+%D hand, consistency will improve.
%D
-%D Because the overhead in terms of entries in the (already
-%D exhausted) hash table has to be minimal, messages are packed
-%D in libraries. We can extract a message from such a library
-%D in three ways:
+%D Because the overhead in terms of entries in the (already exhausted) hash table
+%D has to be minimal, messages are packed in libraries. We can extract a message
+%D from such a library in three ways:
%D
%D \starttyping
%D \getmessage {library} {tag}
@@ -298,13 +283,11 @@
%D \makemessage {library} {tag} {data}
%D \stoptyping
%D
-%D The first command gets the message \type{tag} from the
-%D \type{library} specified. The other commands take an extra
-%D argument: a list of items to be inserted in the message
-%D text. While \type{\showmessage} shows the message at the
-%D terminal, the other commands generate the message as text.
-%D Before we explain the \type{data} argument, we give an
-%D example of a library.
+%D The first command gets the message \type {tag} from the \type {library}
+%D specified. The other commands take an extra argument: a list of items to be
+%D inserted in the message text. While \type {\showmessage} shows the message at the
+%D terminal, the other commands generate the message as text. Before we explain the
+%D \type {data} argument, we give an example of a library.
%D
%D \starttyping
%D \startmessages english library: alfa
@@ -332,12 +315,11 @@
%D something : second (and last) message to you
%D \stoptyping
%D
-%D As we can see, the title entry is shown with the message.
-%D The data fields are comma separated and are specified in the
-%D message text by \type{--}.
+%D As we can see, the title entry is shown with the message. The data fields are
+%D comma separated and are specified in the message text by \type {--}.
%D
-%D It is not required to define all messages in a library at
-%D once. We can add messages to a library in the following way:
+%D It is not required to define all messages in a library at once. We can add
+%D messages to a library in the following way:
%D
%D \starttyping
%D \startmessages english library: alfa
@@ -345,21 +327,17 @@
%D \stopmessages
%D \stoptyping
%D
-%D Because such definitions can take place in different
-%D modules, the system gives a warning when a tag occurs more
-%D than once. The first occurrence takes preference over later
-%D ones, so we had better use a save offset, as shown in the
-%D example. As we can see, the title field is specified only
-%D the first time!
+%D Because such definitions can take place in different modules, the system gives a
+%D warning when a tag occurs more than once. The first occurrence takes preference
+%D over later ones, so we had better use a save offset, as shown in the example. As
+%D we can see, the title field is specified only the first time!
%D
-%D Because we want to check for duplicate tags, the macros
-%D are a bit more complicated than neccessary. The \NEWLINE\
-%D token is used as message separator.
+%D Because we want to check for duplicate tags, the macros are a bit more
+%D complicated than neccessary. The \NEWLINE\ token is used as message separator.
+%D
+%D For internal purposes one can use \type {\setmessagetext}, which puts the message
+%D text asked for in \type {\currentmessagetext}.
%D
-%D For internal purposes one can use \type {\setmessagetext},
-%D which puts the message text asked for in \type
-%D {\currentmessagetext}.
-
%D These will become obsolete:
\unexpanded\def\startmessages #1 library: #2 %
@@ -399,17 +377,16 @@
%D \macros
%D {ifshowwarnings, ifshowmessages}
%D
-%D Sometimes displaying message can slow down processing
-%D considerably. We therefore introduce warnings. Users can
-%D turn of warnings and messages by saying:
+%D Sometimes displaying message can slow down processing considerably. We therefore
+%D introduce warnings. Users can turn of warnings and messages by saying:
%D
%D \starttyping
%D \showwarningstrue
%D \showmessagestrue
%D \stoptyping
%D
-%D Turning off messages also turns off warnings, which is
-%D quote logical because they are less important.
+%D Turning off messages also turns off warnings, which is quote logical because they
+%D are less important.
% not yet mkiv
@@ -435,13 +412,12 @@
%D \macros
%D {dosetvalue,dosetevalue,dosetgvalue,dosetxvalue,docopyvalue,doresetvalue} % dogetvalue
%D
-%D We already defined these auxiliary macros in the system
-%D modules. Starting with this module however, we have to take
-%D multi||linguality a bit more serious.
-
-%D In due time, when we exclusively use the parameter handler code, we can drop
-%D the backmapping (\type{\c!k...}) and make \type {\c!c...} similar to
-%D \type {\v!...}. In that case we can simply the following setters.
+%D We already defined these auxiliary macros in the system modules. Starting with
+%D this module however, we have to take multi||linguality a bit more serious.
+%D
+%D In due time, when we exclusively use the parameter handler code, we can drop the
+%D backmapping (\type{\c!k...}) and make \type {\c!c...} similar to \type {\v!...}.
+%D In that case we can simply the following setters.
\unexpanded\def\doletvalue #1#2{\expandafter\let \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
\unexpanded\def\dosetvalue #1#2{\expandafter\def \csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
@@ -476,16 +452,16 @@
\stopinterface
-%D We can now redefine some messages that will be
-%D introduced in the multi||lingual system module.
+%D We can now redefine some messages that will be introduced in the multi||lingual
+%D system module.
\unexpanded\def\showassignerror #1#2{\showmessage\m!check1{#1,#2}\waitonfatalerror}
\unexpanded\def\showargumenterror#1#2{\showmessage\m!check2{#1,#2}\waitonfatalerror}
\unexpanded\def\showdefinederror #1#2{\showmessage\m!check3{#1,#2}\waitonfatalerror}
-%D \CONTEXT\ is a parameter driven package. This means that
-%D users instruct the system by means of variables, values and
-%D keywords. These instructions take the form:
+%D \CONTEXT\ is a parameter driven package. This means that users instruct the
+%D system by means of variables, values and keywords. These instructions take the
+%D form:
%D
%D \starttyping
%D \setupsomething[some variable=some value, another one=a keyword]
@@ -497,13 +473,11 @@
%D \dosomething[this way,that way,no way]
%D \stoptyping
%D
-%D Because the same variables can occur in more than one setup
-%D command, we have to be able to distinguish them. This is
-%D achieved by assigning them a unique prefix.
+%D Because the same variables can occur in more than one setup command, we have to
+%D be able to distinguish them. This is achieved by assigning them a unique prefix.
%D
-%D Imagine a setup command for boxed text, that enables us to
-%D specify the height and width of the box. Behide the scenes
-%D the command
+%D Imagine a setup command for boxed text, that enables us to specify the height and
+%D width of the box. Behide the scenes the command
%D
%D \starttyping
%D \setupbox [width=12cm, height=3cm]
@@ -517,16 +491,16 @@
%D \stoptyping
%D
%D while a similar command for specifying the page dimensions
-%D of an \cap{A4} page results in:
+%D of an \cap {A4} page results in:
%D
%D \starttyping
%D \<page><width> {21.0cm}
%D \<page><height> {27.9cm}
%D \stoptyping
%D
-%D The prefixes \type{<box>} and \type{<page>} are hidden from
-%D users and can therefore be language independant. Variables
-%D on the other hand, differ for each language:
+%D The prefixes \type {<box>} and \type {<page>} are hidden from users and can
+%D therefore be language independant. Variables on the other hand, differ for each
+%D language:
%D
%D \starttyping
%D \<box><color> {<blue>}
@@ -534,28 +508,24 @@
%D \<box><couleur> {<blue>}
%D \stoptyping
%D
-%D In this example we can see that the assigned values or
-%D keywords are language dependant too. This will be a
-%D complication when defining multi||lingual setup files.
+%D In this example we can see that the assigned values or keywords are language
+%D dependant too. This will be a complication when defining multi||lingual setup
+%D files.
%D
-%D A third phenomena is that variables and values can have a
-%D similar meaning.
+%D A third phenomena is that variables and values can have a similar meaning.
%D
%D \starttyping
%D \<pagenumber><location> {<left>}
%D \<skip><left> {12cm}
%D \stoptyping
%D
-%D A (minor) complication is that where in english we use
-%D \type{<left>}, in dutch we find both \type{<links>} and
-%D \type{<linker>}. This means that when we use some sort of
-%D translation table, we have to distinguish between the
-%D variables at the left side and the fixed values at the
-%D right.
+%D A (minor) complication is that where in english we use \type {<left>}, in dutch
+%D we find both \type {<links>} and \type {<linker>}. This means that when we use
+%D some sort of translation table, we have to distinguish between the variables at
+%D the left side and the fixed values at the right.
%D
-%D The same goes for commands that are composed of different
-%D user supplied and/or language specific elements. In english
-%D we can use:
+%D The same goes for commands that are composed of different user supplied and/or
+%D language specific elements. In english we can use:
%D
%D \starttyping
%D \<empty><figure>
@@ -569,14 +539,13 @@
%D \<leeg><intermezzo>
%D \stoptyping
%D
-%D These subtle differences automatically lead to a solution
-%D where variables, values, elements and other components have
-%D a similar logical name (used in macro's) but a different
-%D meaning (supplied by the user).
+%D These subtle differences automatically lead to a solution where variables,
+%D values, elements and other components have a similar logical name (used in
+%D macro's) but a different meaning (supplied by the user).
%D
-%D Our solution is one in which the whole system is programmed
-%D in terms of identifiers with language specific meanings. In
-%D such an implementation, each fixed variable is available as:
+%D Our solution is one in which the whole system is programmed in terms of
+%D identifiers with language specific meanings. In such an implementation, each
+%D fixed variable is available as:
%D
%D \starttyping
%D \<prefix><variable>
@@ -594,75 +563,66 @@
%D \def\boxwidth{12cm}
%D \stoptyping
%D
-%D because we don't want to recode the source, a setup command
-%D in another language has to expand to this variable, so:
+%D because we don't want to recode the source, a setup command in another language
+%D has to expand to this variable, so:
%D
%D \starttyping
%D \setupblock[width=12cm]
%D \stoptyping
%D
-%D has to result in the definition of \type{\boxwidth} too.
-%D This method enables us to build compact, fast and readable
-%D code.
+%D has to result in the definition of \type {\boxwidth} too. This method enables us
+%D to build compact, fast and readable code.
%D
-%D An alternative method, which we considered using, uses a
-%D more indirect way. In this case, both calls generate a
-%D different variable:
+%D An alternative method, which we considered using, uses a more indirect way. In
+%D this case, both calls generate a different variable:
%D
%D \starttyping
%D \def\boxwidth {12cm}
%D \def\boxbreedte {12cm}
%D \stoptyping
%D
-%D And because we don't want to recode those megabytes of
-%D already developed code, this variable has to be called with
-%D something like:
+%D And because we don't want to recode those megabytes of already developed code,
+%D this variable has to be called with something like:
%D
%D \starttyping
%D \valueof\box\width
%D \stoptyping
%D
-%D where \type{\valueof} takes care of the translation of
-%D \type{width} or \type{breedte} to \type{width} and
-%D combining this with \type{box} to \type{\boxwidth}.
+%D where \type {\valueof} takes care of the translation of \type {width} or \type
+%D {breedte} to \type {width} and combining this with \type {box} to \type
+%D {\boxwidth}.
%D
-%D One advantage of this other scheme is that, within certain
-%D limits, we can implement an interface that can be switched
-%D to another language at will, while the current approach
-%D fixes the interface at startup. There are, by the way,
-%D other reasons too for not choosing this scheme. Switching
-%D user generated commands is for instance impossible and a
-%D dual interface would therefore give a strange mix of
-%D languages.
+%D One advantage of this other scheme is that, within certain limits, we can
+%D implement an interface that can be switched to another language at will, while
+%D the current approach fixes the interface at startup. There are, by the way, other
+%D reasons too for not choosing this scheme. Switching user generated commands is
+%D for instance impossible and a dual interface would therefore give a strange mix
+%D of languages.
%D
-%D Now let's work out the first scheme. Although the left hand
-%D of the assignment is a variable from the users point of
-%D view, it is a constant in terms of the system. Both
-%D \type{width} and \type{breedte} expand to \type{width}
-%D because in the source we only encounter \type{width}. Such
-%D system constants are presented as
+%D Now let's work out the first scheme. Although the left hand of the assignment is
+%D a variable from the users point of view, it is a constant in terms of the system.
+%D Both \type {width} and \type {breedte} expand to \type {width} because in the
+%D source we only encounter \type {width}. Such system constants are presented as
%D
%D \starttyping
%D \c!width
%D \stoptyping
%D
-%D This constant is always equivalent to \type{width}. As we
-%D can see, we use \type{c!} to mark this one as constant. Its
-%D dutch counterpart is:
+%D This constant is always equivalent to \type {width}. As we can see, we use \type
+%D {c!} to mark this one as constant. Its dutch counterpart is:
%D
%D \starttyping
%D breedte
%D \stoptyping
%D
-%D When we interpret a setup command each variable is
-%D translated to it's \type{c!} counterpart. This means that
-%D \type{breedte} and \type{width} expand to \type{breedte}
-%D and \type{\c!width} which both expand to \type{width}. That
-%D way user variables become system constants.
+%D When we interpret a setup command each variable is translated to it's \type{c!}
+%D counterpart. This means that \type {breedte} and \type{width} expand to \type
+%D {breedte} and \type {\c!width} which both expand to \type {width}. That way user
+%D variables become system constants.
%D
-%D The interpretation is done by means of a general setup
-%D command \type{\getparameters} that we introduced in the
-%D system module. Let us define some simple setup command:
+%D The interpretation is done by means of a general setup command \type
+%D {\getparameters} that we introduced in the system module. Let us define some
+%D simple setup command:
%D
%D \starttyping
%D \unexpanded\def\setupbox[#1]%
@@ -675,27 +635,25 @@
%D \setupbox [width=3cm, height=1cm]
%D \stoptyping
%D
-%D Afterwards we have two variables \type{\@@bxwidth} and
-%D \type{\@@bxheight} which have the values \type{3cm} and
-%D \type{1cm} assigned. These variables are a combinatiom of
-%D the setup prefix \type{\??bx}, which expands to \type{@@bx}
-%D and the translated user supplied variables \type{width} and
-%D \type{height} or \type{breedte} and \type{hoogte},
-%D depending on the actual language. In dutch we just say:
+%D Afterwards we have two variables \type {\@@bxwidth} and \type {\@@bxheight} which
+%D have the values \type {3cm} and \type {1cm} assigned. These variables are a
+%D combinatiom of the setup prefix \type {\??bx}, which expands to \type {@@bx} and
+%D the translated user supplied variables \type {width} and \type {height} or \type
+%D {breedte} and \type {hoogte}, depending on the actual language. In dutch we just
+%D say:
%D
%D \starttyping
%D \stelblokin [breedte=3cm,hoogte=1cm]
%D \stoptyping
%D
-%D and get ourselves \type{\@@bxwidth} and \type{\@@bxheight}
-%D too. In the source of \CONTEXT, we can recognize constants
-%D and variables on their leading \type{c!}, \type{v!} etc.,
-%D prefixes on \type{??} and composed variables on \type{@@}.
+%D and get ourselves \type {\@@bxwidth} and \type {\@@bxheight} too. In the source
+%D of \CONTEXT, we can recognize constants and variables on their leading \type
+%D {c!}, \type {v!} etc., prefixes on \type {??} and composed variables on \type
+%D {@@}.
%D
-%D We already saw that user supplied keywords need some
-%D special treatment too. This time we don't translate the
-%D keyword, but instead use in the source a variable which
-%D meaning depends on the interface language.
+%D We already saw that user supplied keywords need some special treatment too. This
+%D time we don't translate the keyword, but instead use in the source a variable
+%D which meaning depends on the interface language.
%D
%D \starttyping
%D \v!left
@@ -711,16 +669,14 @@
%D \v!right=>\dosomethingontheright]
%D \stoptyping
%D
-%D Because variables like \type{\@@bxlocation} can have a lot
-%D of meanings, including tricky expandable tokens, we cannot
-%D translate this meaning when we compare. This means that
-%D \type{\@@bxlocation} can be \type{left} of \type{links} of
-%D whatever meaning suits the language. But because
-%D \type{\v!left} also has a meaning that suits the language,
-%D we are able to compare.
+%D Because variables like \type {\@@bxlocation} can have a lot of meanings,
+%D including tricky expandable tokens, we cannot translate this meaning when we
+%D compare. This means that \type {\@@bxlocation} can be \type {left} of \type
+%D {links} of whatever meaning suits the language. But because \type {\v!left} also
+%D has a meaning that suits the language, we are able to compare.
%D
-%D Although we know it sounds confusing we want to state two
-%D important characteristics of the interface as described:
+%D Although we know it sounds confusing we want to state two important
+%D characteristics of the interface as described:
%D
%D \startnarrower \em
%D user variables become system constants
@@ -731,11 +687,10 @@
%D \startnarrower \em
%D user constants (keywords) become system variables
%D \stopnarrower
-
-%D The \type {\c!internal} is a left over from the time that
-%D the user interface documents were not using a specification
-%D alongside a keyword specification but used a shared file in
-%D which case we need to go in both directions.
+%D
+%D The \type {\c!internal} is a left over from the time that the user interface
+%D documents were not using a specification alongside a keyword specification but
+%D used a shared file in which case we need to go in both directions.
% temporary mkiv hack (we can best just store the whole table in memory)
@@ -750,10 +705,9 @@
%D \macros
%D {defineinterfaceconstant}
%D
-%D Next we redefine a previously defined macro to take care of
-%D interface translation too. It's a bit redundant, because
-%D in these situations we could use the c||version, but for
-%D documentation purposes the x||alternative comes in handy.
+%D Next we redefine a previously defined macro to take care of interface translation
+%D too. It's a bit redundant, because in these situations we could use the
+%D c||version, but for documentation purposes the x||alternative comes in handy.
\unexpanded\def\defineinterfaceconstant#1#2%
{\expandafter\def\csname\c!prefix!#1\endcsname{#2}}
@@ -761,16 +715,14 @@
%D \macros
%D {startelements}
%D
-%D Due to the object oriented nature of \CONTEXT, we also need
-%D to define the elements that are used to build commands.
+%D Due to the object oriented nature of \CONTEXT, we also need to define the
+%D elements that are used to build commands.
%D
-%D Such elements sometimes are the same in diferent
-%D languages, but mostly they differ. Things can get even
-%D confusing when we look at for instance the setup commands.
-%D In english we say \type{\setup<something>}, but in dutch we
-%D have: \type{\stel<iets>in}. Such split elements are no
-%D problem, because we just define two elements. When no second
-%D part is needed, we use a \type{-}:
+%D Such elements sometimes are the same in different languages, but mostly they
+%D differ. Things can get even confusing when we look at for instance the setup
+%D commands. In english we say \type{\setup<something>}, but in dutch we have: \type
+%D {\stel<iets>in}. Such split elements are no problem, because we just define two
+%D elements. When no second part is needed, we use a \type {-}:
\unexpanded\def\setinterfaceelement#1#2%
{\clf_setinterfaceelement{#1}{#2}%
@@ -820,15 +772,18 @@
\stopinterface
-%D So much for the basic multi||lingual interface commands. The
-%D macro's can be enhanced with more testing facilities, but
-%D for the moment they suffice.
+%D So much for the basic multi||lingual interface commands. The macro's can be
+%D enhanced with more testing facilities, but for the moment they suffice.
\ifdefined\zwnj \else \edef\zwnj{\directlua{utf.char(\number"200C)}} \fi % needed for cont-pe % maybe to char-utf.mkiv
\ifdefined\zwj \else \edef\zwj {\directlua{utf.char(\number"200D)}} \fi % needed for cont-pe % maybe to char-utf.mkiv
-%D Out of convenience we define the banners here. This might move
-%D to the \LUA\ end.
+
+%D \macros
+%D {contextversion, contextversionnumber, contextversionno,
+%D contextbanner, showcontextbanner, formatversion}
+%D
+%D Out of convenience we define the banners here. This might move to the \LUA\ end.
\def\contextbanner
{ConTeXt \space
@@ -837,28 +792,34 @@
int: \currentinterface/\currentresponses}
\unexpanded\def\showcontextbanner
- %{\writeline
- % \writestring\contextbanner
- % \writeline}
{\writestatus\m!system\empty
\writestatus\m!system\contextbanner
\writestatus\m!system\empty}
\edef\formatversion
- {\the\normalyear .\the\normalmonth.\the\normalday}
+ {\the\normalyear.\the\normalmonth.\the\normalday}
+
+\newcount\contextversionno
\ifx\contextversion\undefined
- \def\contextversion {unknown}
- \def\contextversionnumber{0}
-\else
- %\def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#2<10 0\fi#2\ifnum#3<10 0\fi#3 #4:#5}
- \def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#2<10 0\fi\purenumber{#2}\ifnum#3<10 0\fi\purenumber{#3} #4:#5}
- \edef\contextversionnumber{\expandafter\contextversionnumber\contextversion\relax\space\contextmark}
+ \edef\contextversion{\the\normalyear.\the\normalmonth.\the\normalday\space 00:00}
\fi
+% \def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#2<10 0\fi\purenumber{#2}\ifnum#3<10 0\fi\purenumber{#3} #4:#5}
+% \edef\contextversionnumber{\expandafter\contextversionnumber\contextversion\relax\space\contextmark}
+
+\unexpanded\def \contextversionnumber #1.#2.#3 #4:#5\relax{#1#2#3}
+ \contextversionno \expandafter\contextversionnumber\contextversion\relax
+ \edef \contextversionnumber {\the\contextversionno\space\contextmark}
+
+%D \macros
+%D {everydump}
+%D
+%D This one is only used when we generate the format.
+
\ifx\undefined\everydump
- \newtoks\everydump
- \def\dump{\the\everydump\normaldump}
+ \newtoks\everydump
+ \def\dump{\the\everydump\normaldump}
\fi
% \appendtoks \showcontextbanner \to \everydump