[latex3-commits] [git/LaTeX3-latex3-latex3] master: ø (72c65cdfe)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Nov 4 23:06:46 CET 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/72c65cdfe8b6e5180a57609749e64d4202af648a

>---------------------------------------------------------------

commit 72c65cdfe8b6e5180a57609749e64d4202af648a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Nov 4 22:06:46 2020 +0000

    ø


>---------------------------------------------------------------

72c65cdfe8b6e5180a57609749e64d4202af648a
 l3kernel/CHANGELOG.md |  3 +++
 l3kernel/l3text.dtx   | 20 ++++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index cfca3155d..f932918cf 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Unchanged
+- Extend `\text_expand:n` to cover `\@protected at testopt`
+
 ## [2020-10-27]
 
 ### Added
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index 893c43da5..8da343040 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -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 at 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 at 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}
 %   {





More information about the latex3-commits mailing list.