[latex3-commits] [git/LaTeX3-latex3-latex3] main: Tighen up text case exclusions (1b8412899)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Jun 2 08:27:35 CEST 2022


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/1b84128994eed1403c2c8fdc96f620ed81b0e372

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

commit 1b84128994eed1403c2c8fdc96f620ed81b0e372
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Jun 2 07:26:36 2022 +0100

    Tighen up text case exclusions


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

1b84128994eed1403c2c8fdc96f620ed81b0e372
 l3kernel/CHANGELOG.md    |  6 +++++-
 l3kernel/l3text-case.dtx | 11 ++++++++++-
 l3kernel/l3text.dtx      | 18 ++++++++++++------
 3 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 3178c3297..254e78a67 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,7 +7,11 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
-## [2022-05-30]
+### Changed
+- Exclude only first mandatory argument of entries in
+  `\l_text_case_exclude_arg_tl` from case changing
+
+`## [2022-05-30]
 
 ### Added
 - Add `\lua_load_module:n`
diff --git a/l3kernel/l3text-case.dtx b/l3kernel/l3text-case.dtx
index 155bcd5bd..9de6e2b6d 100644
--- a/l3kernel/l3text-case.dtx
+++ b/l3kernel/l3text-case.dtx
@@ -458,7 +458,16 @@
   { \@@_change_case_exclude:nnNnn {#1} {#2} {#3} {#4} }
 \cs_new:Npn \@@_change_case_exclude:nnNnn #1#2#3#4#5
   {
-    \@@_change_case_store:n { #3#4 {#5} }
+    \tl_if_blank:nTF {#4}
+       { \@@_change_case_store:n { #3 {#5} } }
+       {
+        \@@_change_case_store:o
+          {
+            \exp_after:wN #3
+              \exp:w \@@_change_case_auxii:nnn {#4} {#1} {#2}
+              {#5}
+          }
+      }
     \@@_change_case_loop:nnw {#1} {#2}
   }
 %    \end{macrocode}
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index 090ed9942..0bfbeb492 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -129,8 +129,9 @@
 %     SOME TEXT $y = mx + c$ WITH {BRACES}
 %   \end{verbatim}
 %
-%   The arguments of commands listed in \cs{l_text_case_exclude_arg_tl}
-%   are excluded from case changing; the latter are entirely non-textual
+%   The first maandatory argument of commands listed in
+%   \cs{l_text_case_exclude_arg_tl}
+%   is excluded from case changing; the latter are entirely non-textual
 %   content (such as labels).
 %
 %   As is generally true for \pkg{expl3}, these functions are designed to
@@ -259,8 +260,8 @@
 % \end{variable}
 %
 % \begin{variable}{\l_text_case_exclude_arg_tl}
-%   Lists commands which are excluded from case changing. This protection
-%   includes everything up to and including their first braced argument.
+%   Lists commands where the first mandatory argument is excluded from
+%   case changing.
 % \end{variable}
 %
 % \begin{variable}{\l_text_expand_exclude_tl}
@@ -548,10 +549,15 @@
 % \end{variable}
 %
 % \begin{variable}{\l_text_case_exclude_arg_tl}
-%   Non-text arguments.
+%   Non-text arguments, including covering the case of \tn{protected at edef}
+%   applied to \cs{cite}.
 %    \begin{macrocode}
 \tl_new:N \l_text_case_exclude_arg_tl
-\tl_set:Nn \l_text_case_exclude_arg_tl { \begin \cite \end \label \ref }
+\tl_set:Nx \l_text_case_exclude_arg_tl
+  {
+    \exp_not:n { \begin \cite \end \label \ref }
+    \exp_not:c { cite ~ }
+  }
 %    \end{macrocode}
 % \end{variable}
 %





More information about the latex3-commits mailing list.