summaryrefslogtreecommitdiff
path: root/tex/context/base/syst-prm.tex
blob: 9864dc5d4cc7eeea2c505ffb810ab6da3c3f9693 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
%D \module
%D   [       file=syst-prm,
%D        version=1999.03.17,
%D          title=\CONTEXT\ System Macros,
%D       subtitle=Primitive Behavior,
%D         author=Hans Hagen,
%D           date=\currentdate,
%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.

\unprotect

%D Saved primitives are preceded by \type {\normal}, as in:

\let\normalfmtversion\fmtversion

%D When applicable, we also load the \ETEX\ source and
%D definition files.

\bgroup \obeylines

\ifx\eTeXversion\undefined

  \long\gdef\beginETEX#1\endETEX%
    {}

  \gdef\beginTEX%
    {\bgroup\obeylines\dobeginTEX}

  \gdef\dobeginTEX#1
    {\egroup}

  \global\let\endTEX\relax

\else

  \long\gdef\beginTEX#1\endTEX%
    {}

  \gdef\beginETEX%
    {\bgroup\obeylines\dobeginETEX}

%   \gdef\dobeginETEX#1
%     {\egroup\immediate\write16%
%        {system (E-TEX) : [line \the\inputlineno] \detokenize{#1}}}

  \gdef\dobeginETEX#1
    {\egroup}

  \global\let\endETEX\relax

\fi

\ifx\OmegaVersion\undefined

  \long\gdef\beginOMEGA#1\endOMEGA%
    {}

\else

  \gdef\beginOMEGA%
    {\bgroup\obeylines\dobeginOMEGA}

  \ifx\detokenize\undefined

    \gdef\dobeginOMEGA#1
      {\egroup\immediate\write16%
         {system (OMEGA) : [line \the\inputlineno] \string#1 }} % we assume an argument

  \else

    \gdef\dobeginOMEGA#1
      {\egroup\immediate\write16%
         {system (OMEGA) : [line \the\inputlineno] \detokenize{#1}}} % we assume aleph

  \fi

  \global\let\endOMEGA\relax

\fi

\ifx\XeTeXversion\undefined

  \long\gdef\beginXETEX#1\endXETEX%
    {}

\else

  \gdef\beginXETEX%
    {\bgroup\obeylines\dobeginXETEX}

  \gdef\dobeginXETEX#1
    {\egroup\immediate\write16%
       {system (XETEX) : [line \the\inputlineno] \detokenize{#1}}}

  \global\let\endXETEX\relax

\fi

\egroup

%D Let's get rid of this one:

\def\wlog#1{}

%D Just for tracing purposes we set:

\tracingstats=1

%D We don't like outer commands, and we always want access
%D to the original \type {\input} primitive.

\let\normalouter = \outer  \let\outer\relax
\let\normalinput = \input

%D We need to make sure that we start up in \DVI\ mode, so,
%D after testing for running \PDFTEX, we default to \DVI.

\ifx\pdftexversion\undefined \newcount\pdfoutput \fi \pdfoutput=0

%D To circumvent dependencies, we can postpone certain
%D initializations to dumping time, by appending them to the
%D \type {\everydump} token register.

\newtoks \everydump

\let\normaldump \dump

\def\dump{\the\everydump\normaldump}

%D Ligature prevention (for instance, ec encoding has ligatures
%D in mono spaced fonts).

\ifx\noligatures\undefined
  \def\noligatures#1{}
\fi

\let\normalnoligatures\noligatures

\protect \endinput