summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3text.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3text.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3text.dtx22
1 files changed, 19 insertions, 3 deletions
diff --git a/macros/latex/contrib/l3kernel/l3text.dtx b/macros/latex/contrib/l3kernel/l3text.dtx
index 893c43da59..9ab4ae6ef5 100644
--- a/macros/latex/contrib/l3kernel/l3text.dtx
+++ b/macros/latex/contrib/l3kernel/l3text.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-10-27}
+% \date{Released 2020-12-03}
%
% \maketitle
%
@@ -634,6 +634,8 @@
% \begin{macro}[EXP]{\@@_expand_protect:N}
% \begin{macro}[EXP]{\@@_expand_protect:nN}
% \begin{macro}[EXP]{\@@_expand_protect:Nw}
+% \begin{macro}[EXP]{\@@_expand_testopt:N}
+% \begin{macro}[EXP]{\@@_expand_testopt:NNn}
% \begin{macro}[EXP]{\@@_expand_replace:N}
% \begin{macro}[EXP]{\@@_expand_replace:n}
% \begin{macro}[EXP]{\@@_expand_cs_expand:N}
@@ -917,7 +919,8 @@
% \LaTeXe{}'s \cs{protect} makes life interesting. Where possible, we
% simply remove it and replace with the \enquote{parent} command; of course,
% the \cs{protect} might be explicit, in which case we need to leave it alone
-% if it's required.
+% if it's required. There is also the case of a straight \tn{@protected@testopt}
+% to cover.
% \begin{macrocode}
\cs_new:Npx \@@_expand_cs:N #1
{
@@ -927,7 +930,7 @@
\bool_lazy_and:nnTF
{ \cs_if_exist_p:N \fmtname }
{ \str_if_eq_p:Vn \fmtname { LaTeX2e } }
- { \exp_not:N \@@_expand_encoding:N #1 }
+ { \exp_not:N \@@_expand_testopt:N #1 }
{ \exp_not:N \@@_expand_replace:N #1 }
}
}
@@ -949,6 +952,17 @@
{ \@@_expand_store:n { \protect #1 } }
\@@_expand_loop:w
}
+\cs_new:Npn \@@_expand_testopt:N #1
+ {
+ \str_if_eq:nnTF {#1} { \@protected@testopt }
+ { \@@_expand_testopt:NNn }
+ { \@@_expand_encoding:N #1 }
+ }
+\cs_new:Npn \@@_expand_testopt:NNn #1#2#3
+ {
+ \@@_expand_store:n {#1}
+ \@@_expand_loop:w
+ }
% \end{macrocode}
% Deal with encoding-specific commands
% \begin{macrocode}
@@ -1036,6 +1050,8 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}
% {