[latex3-commits] [latex3/latex3] main: Correct deprecation for \char_(thing)case:N (ba2605b33)

github at latex-project.org github at latex-project.org
Tue Nov 14 19:10:09 CET 2023


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

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

commit ba2605b3327bf080cb4c319f93e9b1dd6b5e68c0
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Nov 14 18:10:09 2023 +0000

    Correct deprecation for \char_(thing)case:N
    
    See #1333.


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

ba2605b3327bf080cb4c319f93e9b1dd6b5e68c0
 l3kernel/CHANGELOG.md       |   4 +-
 l3kernel/doc/l3obsolete.txt |   2 +
 l3kernel/l3deprecation.dtx  |  10 ++-
 l3kernel/l3token.dtx        | 154 --------------------------------------------
 4 files changed, 12 insertions(+), 158 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 2d9d04ee9..d5b52707f 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -384,8 +384,8 @@ this project uses date-based 'snapshot' version identifiers.
 
 ### Deprecated
 - `\char_to_nfd:N`, `\char_to_nfd:n`
-- `\char_foldcase:N`, `\char_lowercase:N`, `\char_uppercase:N`
-   and `str` variants
+- `\char_foldcase:N`, `\char_lowercase:N`, `\char_titlecase:N`,
+   `\char_uppercase:N` and `str` variants
 - `\char_to_utfviii_bytes:n`
 - `\str_foldcase:n`
 
diff --git a/l3kernel/doc/l3obsolete.txt b/l3kernel/doc/l3obsolete.txt
index 0b412d512..ea76ffdcb 100644
--- a/l3kernel/doc/l3obsolete.txt
+++ b/l3kernel/doc/l3obsolete.txt
@@ -19,6 +19,7 @@ Function                            Date deprecated
 \char_lower_case:N                       2020-01-03
 \char_lowercase:N                        2022-10-17
 \char_mixed_case:N                       2020-01-03
+\char_titlecase:N                        2022-10-17
 \char_upper_case:N                       2020-01-03
 \char_uppercase:N                        2022-10-17
 \char_str_fold_case:N                    2020-01-03
@@ -26,6 +27,7 @@ Function                            Date deprecated
 \char_str_lower_case:N                   2020-01-03
 \char_str_lowercase:N                    2022-10-17
 \char_str_mixed_case:N                   2020-01-03
+\char_str_titlecase:N                    2022-10-17
 \char_str_upper_case:N                   2020-01-03
 \char_str_uppercase:N                    2022-10-17
 \char_to_utfviii_bytes:n                 2022-10-09
diff --git a/l3kernel/l3deprecation.dtx b/l3kernel/l3deprecation.dtx
index 0caac652d..e47a655c1 100644
--- a/l3kernel/l3deprecation.dtx
+++ b/l3kernel/l3deprecation.dtx
@@ -679,9 +679,9 @@
 %
 % \begin{macro}[EXP]
 %   {
-%     \char_lowercase:N, \char_uppercase:N,
+%     \char_lowercase:N, \char_titlecase:N, \char_uppercase:N,
 %     \char_foldcase:N,
-%     \char_str_lowercase:N, \char_str_uppercase:N,
+%     \char_str_lowercase:N, \char_str_titlecase:N, \char_str_uppercase:N,
 %     \char_str_foldcase:N,
 %   }
 %    \begin{macrocode}
@@ -689,10 +689,16 @@
 \cs_gset:Npn \char_lowercase:N { \text_lowercase:n }
 \__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \text_uppercase:n }
 \cs_gset:Npn \char_uppercase:N { \text_uppercase:n }
+\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \text_titlecase_first:n }
+\cs_gset:Npn \char_titlecase:N { \text_titlecase_first:n }
 \__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_casefold:n }
 \cs_gset:Npn \char_foldcase:N { \str_casefold:n }
 \__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_lowercase:n }
 \cs_gset:Npn \char_str_lowercase:N { \str_lowercase:n }
+\__kernel_patch_deprecation:nnNNpn { 2022-10-17 }
+  { \tl_to_str:e { \text_titlecase_first:n } }
+\cs_gset:Npn \char_str_titlecase:N #1
+  { \tl_to_str:e { \text_titlecase_first:n {#1} } }
 \__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_uppercase:n }
 \cs_gset:Npn \char_str_uppercase:N { \str_uppercase:n }
 \__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_casefold:n }
diff --git a/l3kernel/l3token.dtx b/l3kernel/l3token.dtx
index 231581c72..ec7f32da5 100644
--- a/l3kernel/l3token.dtx
+++ b/l3kernel/l3token.dtx
@@ -1666,160 +1666,6 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}[EXP]
-%   {
-%     \char_lowercase:N, \char_uppercase:N,
-%     \char_titlecase:N, \char_foldcase:N
-%   }
-% \begin{macro}[EXP]{\@@_change_case:nN}
-% \begin{macro}[EXP]{\@@_change_case:nnnN}
-% \begin{macro}[EXP]{\@@_change_case_auxi:nN, \@@_change_case_auxii:nN}
-% \begin{macro}[EXP]{\@@_change_case_catcode:N}
-% \begin{macro}[EXP]
-%   {
-%     \char_str_lowercase:N, \char_str_uppercase:N,
-%     \char_str_titlecase:N, \char_str_foldcase:N
-%   }
-% \begin{macro}[EXP]{\@@_str_change_case:nN, \@@_str_change_case_aux:nN}
-% \begin{macro}[EXP]{\@@_str_change_case:nnnN}
-% \begin{macro}[EXP]{\@@_str_change_case:n}
-%   To ensure that the category codes produced are predictable, every character
-%   is re-generated even if it is otherwise unchanged.
-%    \begin{macrocode}
-\cs_new:Npn \char_lowercase:N
-  { \@@_change_case:nN { lowercase } }
-\cs_new:Npn \char_uppercase:N
-  { \@@_change_case:nN { uppercase } }
-\cs_new:Npn \char_titlecase:N
-  { \@@_change_case:nN { titlecase } }
-\cs_new:Npn \char_foldcase:N
-  { \@@_change_case:nN { casefold } }
-\cs_new:Npn \@@_change_case:nN #1#2
-  {
-    \int_compare:nNnTF {`#2} = { `\  }
-      { ~ }
-      {
-        \exp_args:Ne \@@_change_case_auxi:nN
-          { \__kernel_codepoint_case:nn {#1} {`#2} } #2
-      }
-  }
-\cs_new:Npn \@@_change_case_auxi:nN #1#2
-  { \use:e { \@@_change_case:nnnN #1 #2 } }
-\cs_new:Npn \@@_change_case:nnnN #1#2#3#4
-  {
-    \int_compare:nNnTF {#1} = {`#4}
-      { \exp_not:n {#4} }
-      {
-        \@@_change_case_auxii:nN {#1} {#4}
-        \tl_if_blank:nF {#2}
-          {
-            \@@_change_case_auxii:nN {#2} {#4}
-            \tl_if_blank:nF {#3}
-              { \@@_change_case_auxii:nN {#3} {#4} }
-          }
-      }
-  }
-\cs_new:Npn \@@_change_case_auxii:nN #1#2
-  {
-    \char_generate:nn {#1}
-      { \@@_change_case_catcode:N #2 }
-  }
-\bool_lazy_or:nnF
-  { \sys_if_engine_luatex_p: }
-  { \sys_if_engine_xetex_p: }
-  {
-    \cs_gset:Npn \@@_change_case_auxii:nN #1#2
-      {
-        \int_compare:nNnTF {#1} < { "80 }
-          {
-            \char_generate:nn {#1}
-              { \@@_change_case_catcode:N #2 }
-          }
-          { \exp_not:n {#2} }
-      }
-  }
-\cs_new:Npn \@@_change_case_catcode:N #1
-  {
-    \if_catcode:w \exp_not:N #1 \c_math_toggle_token
-      3
-    \else:
-      \if_catcode:w \exp_not:N #1 \c_alignment_token
-        4
-      \else:
-        \if_catcode:w \exp_not:N #1 \c_math_superscript_token
-          7
-        \else:
-          \if_catcode:w \exp_not:N #1 \c_math_subscript_token
-            8
-          \else:
-            \if_catcode:w \exp_not:N #1 \c_space_token
-              10
-            \else:
-             \if_catcode:w \exp_not:N #1 \c_catcode_letter_token
-               11
-             \else:
-               \if_catcode:w \exp_not:N #1 \c_catcode_other_token
-                 12
-               \else:
-                 13
-               \fi:
-             \fi:
-            \fi:
-          \fi:
-        \fi:
-      \fi:
-    \fi:
-  }
-%    \end{macrocode}
-%   Same story for the string version, except category code is easier
-%   to follow. This of course makes this version faster.
-%    \begin{macrocode}
-\cs_new:Npn \char_str_lowercase:N
-  { \@@_str_change_case:nN { lowercase } }
-\cs_new:Npn \char_str_uppercase:N
-  { \@@_str_change_case:nN { uppercase } }
-\cs_new:Npn \char_str_titlecase:N
-  { \@@_str_change_case:nN { titlecase } }
-\cs_new:Npn \char_str_foldcase:N
-  { \@@_str_change_case:nN { casefold } }
-\cs_new:Npn \@@_str_change_case:nN #1#2
-  {
-    \int_compare:nNnTF {`#2} = { `\  }
-      { ~ }
-      {
-        \exp_args:Ne \@@_str_change_case_aux:nN
-          { \__kernel_codepoint_case:nn {#1} {`#2} } #2
-      }
-  }
-\cs_new:Npn \@@_str_change_case_aux:nN #1#2
-  { \use:e { \@@_str_change_case:nnnN #1 #2 } }
-\cs_new:Npn \@@_str_change_case:nnnN #1#2#3#4
-  {
-    \int_compare:nNnTF {#1} = {`#4}
-      { \tl_to_str:n {#4} }
-      {
-        \@@_str_change_case:n {#1}
-        \tl_if_blank:nF {#2}
-          {
-            \@@_str_change_case:n {#2}
-            \tl_if_blank:nF {#3}
-              { \@@_str_change_case:n {#3} }
-          }
-      }
-  }
-\cs_new:Npn \@@_str_change_case:n #1
-  { \char_generate:nn {#1} { 12 } }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
 % \begin{variable}{\c_catcode_active_space_tl}
 %   While \cs{char_generate:nn} can produce active characters in some
 %   engines it cannot in general.  It would be possible to simply change





More information about the latex3-commits mailing list.