summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
blob: 60294abcc830374b6d06fb5d0cb7a615054538ce (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
% \iffalse meta-comment
%
%% File: l3deprecation.dtx (C) Copyright 2017-2018 The 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
%
%    https://www.latex-project.org/lppl.txt
%
% This file is part of the "l3kernel bundle" (The Work in LPPL)
% and all files in that bundle must be distributed together.
%
% -----------------------------------------------------------------------
%
% The development version of the bundle can be found at
%
%    https://github.com/latex3/latex3
%
% for those people who are interested.
%
%<*driver>
\documentclass[full,kernel]{l3doc}
\begin{document}
  \DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \title{^^A
%   The \pkg{l3deprecation} package\\ Deprecation errors^^A
% }
%
% \author{^^A
%  The \LaTeX3 Project\thanks
%    {^^A
%      E-mail:
%        \href{mailto:latex-team@latex-project.org}
%          {latex-team@latex-project.org}^^A
%    }^^A
% }
%
% \date{Released 2018-09-24}
%
% \maketitle
%
% \begin{documentation}
%
% \section{\pkg{l3deprecation} documentation}
%
% A few commands have had to be deprecated over the years.  This module
% defines deprecated and deleted commands to produce an error.
%
% \end{documentation}
%
% \begin{implementation}
%
% \section{\pkg{l3deprecation} implementation}
%
%    \begin{macrocode}
%<*initex|package>
%    \end{macrocode}
%
%    \begin{macrocode}
%<@@=deprecation>
%    \end{macrocode}
%
% \begin{macro}{\__kernel_deprecation_error:Nnn}
%   The \tn{outer} definition here ensures the command cannot appear
%   in an argument.  Use this auxiliary on all commands that have been
%   removed since 2015.
%    \begin{macrocode}
\cs_new_protected:Npn \__kernel_deprecation_error:Nnn #1#2#3
  {
    \tex_protected:D \tex_outer:D \tex_edef:D #1
      {
        \exp_not:N \__kernel_msg_expandable_error:nnnnn
          { kernel } { deprecated-command }
          { \tl_to_str:n {#3} } { \token_to_str:N #1 } { \tl_to_str:n {#2} }
        \exp_not:N \__kernel_msg_error:nnxxx
          { kernel } { deprecated-command }
          { \tl_to_str:n {#3} } { \token_to_str:N #1 } { \tl_to_str:n {#2} }
      }
  }
\__kernel_deprecation_error:Nnn \file_if_exist_input:nT
  { \file_if_exist:nT and~ \file_input:n } { 2018-03-05 }
\__kernel_deprecation_error:Nnn \file_if_exist_input:nTF
  { \file_if_exist:nT and~ \file_input:n } { 2018-03-05 }
\__kernel_deprecation_error:Nnn \c_job_name_tl
  { \c_sys_jobname_str } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \dim_case:nnn
  { \dim_case:nnF } { 2015-07-14 }
\__kernel_deprecation_error:Nnn \int_case:nnn
  { \int_case:nnF } { 2015-07-14 }
\__kernel_deprecation_error:Nnn \int_from_binary:n
  { \int_from_bin:n } { 2016-01-05 }
\__kernel_deprecation_error:Nnn \int_from_hexadecimal:n
  { \int_from_hex:n } { 2016-01-05 }
\__kernel_deprecation_error:Nnn \int_from_octal:n
  { \int_from_oct:n } { 2016-01-05 }
\__kernel_deprecation_error:Nnn \int_to_binary:n
  { \int_to_bin:n } { 2016-01-05 }
\__kernel_deprecation_error:Nnn \int_to_hexadecimal:n
  { \int_to_hex:n } { 2016-01-05 }
\__kernel_deprecation_error:Nnn \int_to_octal:n
  { \int_to_oct:n } { 2016-01-05 }
\__kernel_deprecation_error:Nnn \ior_get_str:NN
  { \ior_str_get:NN } { 2018-03-05 }
\__kernel_deprecation_error:Nnn \luatex_if_engine_p:
  { \sys_if_engine_luatex_p: } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \luatex_if_engine:F
  { \sys_if_engine_luatex:F } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \luatex_if_engine:T
  { \sys_if_engine_luatex:T } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \luatex_if_engine:TF
  { \sys_if_engine_luatex:TF } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \pdftex_if_engine_p:
  { \sys_if_engine_pdftex_p: } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \pdftex_if_engine:F
  { \sys_if_engine_pdftex:F } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \pdftex_if_engine:T
  { \sys_if_engine_pdftex:T } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \pdftex_if_engine:TF
  { \sys_if_engine_pdftex:TF } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \prop_get:cn
  { \prop_item:cn } { 2016-01-05 }
\__kernel_deprecation_error:Nnn \prop_get:Nn
  { \prop_item:Nn } { 2016-01-05 }
\__kernel_deprecation_error:Nnn \quark_if_recursion_tail_break:N
  { } { 2015-07-14 }
\__kernel_deprecation_error:Nnn \quark_if_recursion_tail_break:n
  { } { 2015-07-14 }
\__kernel_deprecation_error:Nnn \scan_align_safe_stop:
  { protected~commands } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \str_case:nnn
  { \str_case:nnF } { 2015-07-14 }
\__kernel_deprecation_error:Nnn \str_case:onn
  { \str_case:onF } { 2015-07-14 }
\__kernel_deprecation_error:Nnn \str_case_x:nnn
  { \str_case_e:nnF } { 2015-07-14 }
\__kernel_deprecation_error:Nnn \tl_case:cnn
  { \tl_case:cnF } { 2015-07-14 }
\__kernel_deprecation_error:Nnn \tl_case:Nnn
  { \tl_case:NnF } { 2015-07-14 }
\__kernel_deprecation_error:Nnn \tl_to_lowercase:n
  { \tex_lowercase:D } { 2018-03-05 }
\__kernel_deprecation_error:Nnn \tl_to_uppercase:n
  { \tex_uppercase:D } { 2018-03-05 }
\__kernel_deprecation_error:Nnn \xetex_if_engine_p:
  { \sys_if_engine_xetex_p: } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \xetex_if_engine:F
  { \sys_if_engine_xetex:F } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \xetex_if_engine:T
  { \sys_if_engine_xetex:T } { 2017-01-01 }
\__kernel_deprecation_error:Nnn \xetex_if_engine:TF
  { \sys_if_engine_xetex:TF } { 2017-01-01 }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[deprecated = 2018-12-31]{\__cs_generate_variant_loop_warning:nnxxxx}
%   This is left-over from \pkg{l3expan}.  It cannot be done there
%   because \pkg{l3tl} is not loaded at that time.  Of course what's
%   deprecated is actually some combinations of variants; see
%   \pkg{l3expan}.
%    \begin{macrocode}
\__kernel_deprecation_code:nn
  {
    \cs_set_protected:Npn \__cs_generate_variant_loop_warning:nnxxxx
      { \__kernel_msg_error:nnxxxx }
  }
  {
    \cs_set_protected:Npn \__cs_generate_variant_loop_warning:nnxxxx
      { \__kernel_msg_warning:nnxxxx }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[deprecated = 2019-12-31]{\etex_beginL:D}
% \begin{macro}{\@@_primitive:NN, \@@_primitive:w}
%   We renamed all primitives to \cs[no-index]{tex_\ldots{}:D} so all
%   others are deprecated.  In \pkg{l3names}, \cs{__kernel_primitives:}
%   is defined to contain \cs{__kernel_primitive:NN} \cs{beginL}
%   \cs{etex_beginL:D} and so on, one for each deprecated primitive.  We
%   apply \cs{exp_not:N} to the second argument of
%   \cs{__kernel_primitive:NN} because it may be outer (both when doing
%   and undoing deprecation actually), then \cs{@@_primitive:NN} uses
%   \cs{tex_let:D} to change the meaning of this potentially outer
%   token.  Then, either turn it into an error or make it equal to the
%   primitive~|#1|.  To be more precise, |#1| may not be defined, so try
%   a \cs[no-index]{tex_\ldots{}:D} command as well.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_primitive:NN #1#2 { }
\exp_last_unbraced:NNNNo
  \cs_new:Npn \@@_primitive:w #1 { \token_to_str:N _ } { }
\__kernel_deprecation_code:nn
  {
    \cs_set_protected:Npn \__kernel_primitive:NN #1
      {
        \exp_after:wN \@@_primitive:NN
        \exp_after:wN #1
        \exp_not:N
      }
    \cs_set_protected:Npn \@@_primitive:NN #1#2
      {
        \tex_let:D #2 \scan_stop:
        \exp_args:NNx \__kernel_deprecation_error:Nnn #2
          {
            \iow_char:N \\
            \cs_if_exist:NTF #1
              { \cs_to_str:N #1 }
              {
                tex_
                \exp_last_unbraced:Nf
                \@@_primitive:w { \cs_to_str:N #2 }
              }
          }
          { 2019-12-31 }
      }
    \__kernel_primitives:
  }
  {
    \cs_set_protected:Npn \__kernel_primitive:NN #1
      {
        \exp_after:wN \@@_primitive:NN
        \exp_after:wN #1
        \exp_not:N
      }
    \cs_set_protected:Npn \@@_primitive:NN #1#2
      {
        \tex_let:D #2 #1
        \cs_if_exist:cT { tex_ \cs_to_str:N #1 :D }
          {
            \exp_args:NNc \cs_set_eq:NN #2
              { tex_ \cs_to_str:N #1 :D }
          }
      }
    \__kernel_primitives:
  }
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%    \begin{macrocode}
%</initex|package>
%    \end{macrocode}
%
% \end{implementation}
%
% \PrintIndex