[latex3-commits] [latex3/latex3] main: Exclude \l_text_case_exclude_arg_tl entries from expansion (3070964cf)

github at latex-project.org github at latex-project.org
Fri Jun 9 08:48:24 CEST 2023


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/3070964cf97fb66f3cffd99a6a4bba2b70df8fe9

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

commit 3070964cf97fb66f3cffd99a6a4bba2b70df8fe9
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Jun 9 07:48:24 2023 +0100

    Exclude \l_text_case_exclude_arg_tl  entries from expansion
    
    See latex3/latex2e#904.


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

3070964cf97fb66f3cffd99a6a4bba2b70df8fe9
 l3kernel/CHANGELOG.md            |  4 ++++
 l3kernel/l3text.dtx              |  6 ++++--
 l3kernel/testfiles/m3text001.lvt | 10 ++++++++++
 l3kernel/testfiles/m3text001.tlg |  5 +++++
 4 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 2ad6244fb..e8074ec90 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,10 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Changed
+- Exclude entries in `\l_text_case_exclude_arg_tl` from expansion in `\text_expand:n`
+  (latex3/latex23\#904)
+
 ## [2023-06-05]
 
 ### Added
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index bcdfa869f..aa39025cc 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -58,7 +58,7 @@
 %
 % \section{Expanding text}
 %
-% \begin{function}[EXP, added = 2020-01-02, updated = 2023-02-07]
+% \begin{function}[EXP, added = 2020-01-02, updated = 2023-06-09]
 %   {\text_expand:n}
 %   \begin{syntax}
 %     \cs{text_expand:n} \Arg{text}
@@ -71,7 +71,8 @@
 %   in \cs{l_text_math_arg_tl}). Commands which are neither engine-
 %   nor \LaTeX{} protected are expanded exhaustively.
 %   Any commands listed in \cs{l_text_expand_exclude_tl} are excluded from
-%   expansion.
+%   expansion, as are those in \cs{l_text_case_exclude_arg_tl} and
+%   \cs{l_text_math_arg_tl}.
 % \end{function}
 %
 % \begin{function}[added = 2020-01-22]
@@ -1142,6 +1143,7 @@
           {
             \exp_not:V \l_text_math_arg_tl
             \exp_not:V \l_text_expand_exclude_tl
+            \exp_not:V \l_text_case_exclude_arg_tl
           }
         #1
       }
diff --git a/l3kernel/testfiles/m3text001.lvt b/l3kernel/testfiles/m3text001.lvt
index 50e513bfb..bd5ab125e 100644
--- a/l3kernel/testfiles/m3text001.lvt
+++ b/l3kernel/testfiles/m3text001.lvt
@@ -116,4 +116,14 @@
     \tl_show:x { \text_expand:n { \romannumeral 10 } }
   }
 
+\OMIT
+\cs_set:Npn \foo #1 {#1}
+\tl_put_right:Nn \l_text_case_exclude_arg_tl { \foo }
+\TIMO
+
+\TESTEXP { Case~functions }
+  {
+    \text_expand:n { \foo { abc } def }
+  }
+
 \END
diff --git a/l3kernel/testfiles/m3text001.tlg b/l3kernel/testfiles/m3text001.tlg
index fa51e5e8e..e4aca841e 100644
--- a/l3kernel/testfiles/m3text001.tlg
+++ b/l3kernel/testfiles/m3text001.tlg
@@ -103,3 +103,8 @@ TEST 11: Non-terminated \romannumeral
 <recently read> }
 l. ...  }
 ============================================================
+============================================================
+TEST 12: Case functions
+============================================================
+\foo {abc}def
+============================================================





More information about the latex3-commits mailing list.