summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/expl3/l3messages.sty
blob: aead4018e113d28ba230a7c55d7f639aa58805e3 (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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
%%
%% This is file `l3messages.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3messages.dtx  (with options: `package')
%% 
%% 
%% EXPERIMENTAL CODE
%% 
%% Do not distribute this file without also distributing the
%% source files specified above.
%% 
%% Do not distribute a modified version of this file.
%% 
%% 
%% File: l3messages.dtx Copyright (C) 1990-2006 LaTeX3 project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% This file is part of the ``expl3 bundle'' (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
%%
%% -----------------------------------------------------------------------
%%
%% The development version of the bundle can be found at
%%
%%    http://www.latex-project.org/cgi-bin/cvsweb.cgi/
%%
%% for those people who are interested.
%%
%%%%%%%%%%%
%% NOTE: %%
%%%%%%%%%%%
%%
%%   Snapshots taken from the repository represent work in progress and may
%%   not work or may contain conflicting material!  We therefore ask
%%   people _not_ to put them into distributions, archives, etc. without
%%   prior consultation with the LaTeX Project Team.
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
\RequirePackage{l3basics}
\RequirePackage{l3tlp}
\RequirePackage{l3expan}
\RequirePackage{l3num}
\RequirePackage{l3io}
\RequirePackage{l3int}
\RequirePackage{l3toks}
\GetIdInfo$Id: l3messages.dtx 573 2006-08-21 20:59:37Z morten $
          {L3 Experimental LaTeX Messages module}
\tlp_new:Nn \g_file_curr_name_tlp {no~file}
\let_new:NN \err_message:x \tex_errmessage:D
\def_new:Npn \text_put_sp: {~}
\def_new:Npn \text_put_four_sp: {\text_put_sp: \text_put_sp:
                                 \text_put_sp: \text_put_sp: }
\def:Npn\cmd_arg_list_build#1{
  \toks_clear:N\l_tmpb_toks
  \int_set:Nn \l_tmpa_int {#1}
  \int_while:nNnT \l_tmpa_int > \c_zero {
    \toks_put_left:No \l_tmpb_toks {\the_internal:D\l_tmpa_int}
    \toks_put_left:Nn \l_tmpb_toks {##}
    \int_decr:N\l_tmpa_int
  }
  \def:Npx\l_cmd_arg_list{\the_internal:D\l_tmpb_toks}
}
\def:Npn\cmd_declare:Nnn#1[#2]{
  \cmd_arg_list_build{#2}
  \exp_args:NNO\def:Npn#1\l_cmd_arg_list
}
\def_new:Npn \io_show_file_lineno:{
  on~line~\the_internal:D\tex_inputlineno:D\text_put_sp:~of~
  file~\g_file_curr_name_tlp}
\let:NwN \g_err_help_toks \tex_errhelp:D
\def_new:Npn \l_err_label_token {}
\int_set:Nn\tex_errorcontextlines:D\c_minus_one
\def_new:Npn \err_info:nn #1#2{
  \def:Npn\err_newline:{\iow_newline#2}
  \io_put_log:x {#1~\io_show_file_lineno:}}
\def_new:Npn \err_warn:nn #1#2{
  \def:Npn\err_newline:{\iow_newline#2}
  \io_put_term:x {#1~\io_show_file_lineno:}}
\def_new:Npn \err_info_noline:nn #1#2{
  \def:Npn\err_newline:{\iow_newline#2}
  \io_put_log:x {#1}}
\def_new:Npn \err_warn_noline:nn #1#2{
  \def:Npn\err_newline:{\iow_newline#2}
  \io_put_term:x {#1}}
\def_new:Npn \err_interrupt:NNw #1#2{\let:NwN \l_err_label_token #2
     \group_begin:
       \let:NwN \par\use_noop:
       \CodeStop
       \NamesStart:
       %\clearshortrefmaps
       \tex_input:D #1~\err_display_aux:w}
\def_new:Npn \err_fatal:nn #1#2{
  \def:Npn\err_newline:{\iow_newline#2}
  \io_put_term:x {#1~\io_show_file_lineno:}
  \tex_end:D
  }
\def_new:Npn \err_fatal_noline:nn #1#2{
  \def:Npn\err_newline:{\iow_newline#2}
  \io_put_term:x {#1}
  \tex_end:D
  }
\def_new:Npn \err_newline: {^^J}
\iow_new:N \c_iow_err_stream
\tlp_new:Nn \g_err_curr_fname{}
\def_new:Npn \err_file_new:Nn #1#2{
   \tlp_if_empty:NF\g_err_curr_fname
      {\err_latex_bug:x{Unclosed~error~file~`\g_err_curr_fname'}}
   \iow_open:Nn \c_iow_err_stream {#2}
   \err_kernel_info:n{Errorfile~`#2'~opened~for~output}
   \tlp_gset:Nn \g_err_curr_fname{#2}
   \tlp_new:Nn #1{#2}}
\def_new:Npn \err_file_close:N#1{
  \tlp_if_eq:NNF#1\g_err_curr_fname
     {\err_latex_bug:x{You~closed~the~wrong~error~file~`#1'.~
         Open~is~`\g_err_curr_fname'.}}
  \iow_long_unexpanded:Nn \c_iow_err_stream {\err_latex_bug:x{Didn't~find~the~
        correct~error~message~to~show.\iow_newline
        Was~searching~for~a~function~
        with~the~following~meaning:\iow_newline
          \token_to_string:N\token_to_meaning:N
          \token_to_string:N\l_err_label_token}
      \group_end:}
  \iow_close:N \c_iow_err_stream
  \err_kernel_info:n{Errorfile~`\g_err_curr_fname'~closed}
  \tlp_gset_eq:NN\g_err_curr_fname\c_empty_tlp
}
\def_new:Npn \err_interrupt_new:NNNnnn #1{
  \group_begin: \tex_catcode:D`\#\c_other_char_code
  \if_meaning:NN#1\g_err_curr_fname
  \else:
      \err_latex_bug:x{Error~text~goes~to~wrong~err~file:~
          `\g_err_curr_fname'~is~open~but~you~requested~
          `#1'}
  \fi:
  \err_interrupt_new_aux:w}
\def_long_new:Npn \err_interrupt_new_aux:w #1#2#3#4#5{
  \iow_long_unexpanded:Nn \c_iow_err_stream
        {\err_msgline_aux:NNnnn #1#2{#3}{#4}{#5}\use_noop:}
  \group_end:}
\def_new:Npn \err_msgline_aux:NNnnn #1#2#3#4#5{
  \if_meaning:NN#1\l_err_label_token
        \cmd_declare:Nnn\err_display_aux:w [#2]{
           \group_end:
           \toks_gset:Nx\g_err_help_toks{#4}
           \io_put_term:x{LaTeX~error~\io_show_file_lineno:.\iow_newline
               \text_put_sp:\text_put_four_sp: \text_put_sp:
               See~LaTeX~manual~for~explanation.\iow_newline
               \text_put_sp:\text_put_four_sp: \text_put_sp:
               Type~\text_put_sp: H~<return>~\text_put_sp: for~
               immediate~help.}
           \err_message:x{#3}
           #5}
        \tex_endinput:D
   \fi:}
\def_new:Npn \err_display_aux:w {}
\def_new:Npn \err_kernel_interrupt:Nw {\err_interrupt:NNw \c_kernel_err_tlp}
\def_new:Npn \err_kernel_interrupt_new:NNnnn {
        \err_interrupt_new:NNNnnn \c_kernel_err_tlp}
\def_new:Npn \err_kernel_info:n #1 {
  \err_info:nn {LaTeX~Info:~#1}
               {\text_put_four_sp:\text_put_four_sp:\text_put_four_sp:}
  }
\def_new:Npn \err_kernel_warn:n #1 {
  \err_warn:nn {LaTeX~Warning:~#1}
               {\text_put_sp:\text_put_sp:\text_put_sp:
                \text_put_four_sp:\text_put_four_sp:\text_put_four_sp:}
  }
\def_new:Npn \err_kernel_fatal:n #1 {
  \err_fatal:nn {LaTeX~Fatal:~#1}
                {\text_put_sp:
                 \text_put_four_sp:\text_put_four_sp:\text_put_four_sp:}
  }
\def_new:Npn \err_kernel_info_noline:n #1 {
  \err_info_noline:nn {LaTeX~Info:~#1}
               {\text_put_four_sp:\text_put_four_sp:\text_put_four_sp:}
  }
\def_new:Npn \err_kernel_warn_noline:n #1 {
  \err_warn_noline:nn {LaTeX~Warning:~#1}
               {\text_put_sp:\text_put_sp:\text_put_sp:
                \text_put_four_sp:\text_put_four_sp:\text_put_four_sp:}
  }
\def_new:Npn \err_kernel_fatal_noline:n #1 {
  \err_fatal_noline:nn {LaTeX~Fatal:~#1}
                {\text_put_sp:
                 \text_put_four_sp:\text_put_four_sp:\text_put_four_sp:}
  }
\err_file_new:Nn \c_kernel_err_tlp {l3in2e.err}
\def:Npn\err_help_ignored: {
  Your~command~was~ignored.\iow_newline
  Type \text_put_sp: I~<command>~<return>
  \text_put_sp: to~replace~it~with~another~command,\iow_newline
  or~\text_put_sp: <return> \text_put_sp: to~continue~without~it.}

\def:Npn\err_help_textlost: {
  You've~lost~some~text.\text_put_sp: \err_help_return_or_X:}

\def:Npn\err_help_return_or_X: {
  Try~typing\text_put_sp: <return>
  \text_put_sp: to~proceed.\iow_newline
  If~that~doesn't~work,~type
  \text_put_sp: X~<return>\text_put_sp: to~quit.}

\def:Npn\err_help_trouble: {
  You're~ in~ trouble~ here.
  \text_put_sp:\err_help_return_or_X:}

\err_kernel_interrupt_new:NNnnn\cs_free_p:N{1}
   {Command~name~`\tex_string:D#1'~already~used}
   {You~tried~to~define~a~command~which~already~has~
     a~meaning.\iow_newline
     If~you~really~want~to~redefine~it~try~
     \token_to_string:N\cmd_declare:Nnn\text_put_sp:
     next~time.\iow_newline
     For~this~run~I~will~ignore~your~definition.}
   {}

\err_kernel_interrupt_new:NNnnn\newline{0}
   {There's~no~line~here~to~end}
   {You~tried~to~end~a~line~at~a~place~where~I~thought~
     we~were~already~between~paragraphs.}
   {}

\err_kernel_interrupt_new:NNnnn\newcnt{0}
   {No~such~counter}
   {The~counter~name~mentioned~in~the~operation~is~not~
     known~to~me.\iow_newline
     Check~the~spelling.}
   {}

\err_kernel_interrupt_new:NNnnn\nodocument{0}
    {Missing~\token_to_string:N\begin{document}}
    {\err_help_trouble:}
    {}

\err_kernel_interrupt_new:NNnnn\badmath{0}
    {Bad~math~environment~delimiter}
    {\err_help_ignored:}
    {}

\err_kernel_interrupt_new:NNnnn\toodeep{0}
    {Too~deeply~nested}
    {\err_help_trouble:}
    {}

\err_kernel_interrupt_new:NNnnn\badpoptabs{0}
    {\token_to_string:N\pushtabs \text_put_sp:
      and~\token_to_string:N\poptabs
      \text_put_sp: don't~match}
    {\err_help_trouble:}
    {}

\err_kernel_interrupt_new:NNnnn\badtab{0}
    {Undefined~tab~position}
    {\err_help_trouble:}
    {}

\err_kernel_interrupt_new:NNnnn\preamerr{}
    {\if_case:w #1~Illegal~character\or:
      Missing~@-exp\or: Missing~p-arg\fi:\text_put_sp:
      in~array~arg}
    {\err_help_trouble:}
    {}

\err_kernel_interrupt_new:NNnnn\badlinearg{}
    {Bad~\token_to_string:N\line
      \text_put_sp: or~\token_to_string:N\vector
      \text_put_sp: argument}
    {\err_help_textlost:}
    {}

\err_kernel_interrupt_new:NNnnn\parmoderr{0}
    {Not~in~outer~par~mode}
    {\err_help_textlost:}
    {}

\err_kernel_interrupt_new:NNnnn\fltovf{0}
    {Too~many~unprocessed~floats}
    {\err_help_textlost:}
    {}

\err_kernel_interrupt_new:NNnnn\badcrerr{0}
    {Bad~use~of~\token_to_string:N\\}
    {\err_help_return_or_X:}
    {}

\err_kernel_interrupt_new:NNnnn\noitemerr{0}
    {Something's~wrong--perhaps~a~missing~
      \token_to_string:N\item}
    {\err_help_return_or_X:}
    {}

\err_kernel_interrupt_new:NNnnn\notprerr{0}
    {Can~be~used~only~in~preamble}
    {\err_help_ignored:}
    {}

\err_file_close:N\c_kernel_err_tlp

%% 
%%
%% End of file `l3messages.sty'.