summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx69
1 files changed, 67 insertions, 2 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
index ca8a79b3227..0630ede3626 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3deprecation.dtx
@@ -41,7 +41,7 @@
% }^^A
% }
%
-% \date{Released 2018-04-30}
+% \date{Released 2018-05-12}
%
% \maketitle
%
@@ -73,7 +73,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \__kernel_deprecation_error:Nnn #1#2#3
{
- \etex_protected:D \tex_outer:D \tex_edef:D #1
+ \tex_protected:D \tex_outer:D \tex_edef:D #1
{
\exp_not:N \__kernel_msg_expandable_error:nnnnn
{ kernel } { deprecated-command }
@@ -176,6 +176,71 @@
% \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}