[latex3-commits] [git/LaTeX3-latex3-latex3] unicode-data: Deprecate \str_foldcase:n in. favor of \str_casefold:n (427686071)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Oct 17 10:59:14 CEST 2022
Repository : https://github.com/latex3/latex3
On branch : unicode-data
Link : https://github.com/latex3/latex3/commit/4276860714055f8974e6781e8b171b124355548a
>---------------------------------------------------------------
commit 4276860714055f8974e6781e8b171b124355548a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Oct 17 08:22:58 2022 +0100
Deprecate \str_foldcase:n in. favor of \str_casefold:n
Naming is then aligned with e.g. Python and reflects the fact
that folding is not a case, but is rather removal of case.
>---------------------------------------------------------------
4276860714055f8974e6781e8b171b124355548a
l3experimental/CHANGELOG.md | 3 +++
l3experimental/l3graphics/l3graphics.dtx | 2 +-
l3kernel/CHANGELOG.md | 2 ++
l3kernel/doc/l3obsolete.txt | 2 ++
l3kernel/l3color.dtx | 2 +-
l3kernel/l3deprecation.dtx | 18 ++++++++++++++----
l3kernel/l3fp-parse.dtx | 2 +-
l3kernel/l3str.dtx | 28 +++++++++++++++++++---------
l3kernel/l3text.dtx | 2 +-
l3kernel/testfiles-backend/m3color003.lvt | 2 +-
l3kernel/testfiles/m3str002.lvt | 24 ++++++++++++------------
11 files changed, 57 insertions(+), 30 deletions(-)
diff --git a/l3experimental/CHANGELOG.md b/l3experimental/CHANGELOG.md
index 42cf589e7..76be02927 100644
--- a/l3experimental/CHANGELOG.md
+++ b/l3experimental/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Changed
+- Track `expl3` core changes
+
## [2022-04-20]
### Fixed
diff --git a/l3experimental/l3graphics/l3graphics.dtx b/l3experimental/l3graphics/l3graphics.dtx
index 0a3556c5b..4549aed4b 100644
--- a/l3experimental/l3graphics/l3graphics.dtx
+++ b/l3experimental/l3graphics/l3graphics.dtx
@@ -532,7 +532,7 @@
\@@_include_auxi:e
{
\exp_args:Ne \str_tail:n
- { \str_foldcase:V \l_@@_ext_str }
+ { \str_casefold:V \l_@@_ext_str }
}
}
{ \@@_include_auxi:e { \l_@@_type_str } }
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index a8d47c9f9..c30bc50d8 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -11,6 +11,7 @@ this project uses date-based 'snapshot' version identifiers.
- `\codepoint_to_bytes:n`
- `\codepoint_to_nfd:n`
- `\codepoint_str_generate:n`
+- `\str_casefold:n`
### Changed
- Usage of `\exp_not:n`/`\exp_not:N` in `\peek_analysis_map_inline:n` output
@@ -24,6 +25,7 @@ this project uses date-based 'snapshot' version identifiers.
### Deprecated
- `\char_to_nfd:N`, `\char_to_nfd:n`
- `\char_to_utfviii_bytes:n`
+- `\str_foldcase:n`
## [2022-09-28]
diff --git a/l3kernel/doc/l3obsolete.txt b/l3kernel/doc/l3obsolete.txt
index 0b229ddfe..a40080770 100644
--- a/l3kernel/doc/l3obsolete.txt
+++ b/l3kernel/doc/l3obsolete.txt
@@ -36,6 +36,8 @@ Function Date deprecated
\str_declare_eight_bit_encoding:nnn 2020-08-20
\str_fold_case:n 2020-01-03
\str_fold_case:V 2020-01-03
+\str_foldcase:N 2022-10-17
+\str_foldcase:V 2022-10-17
\str_lower_case:f 2020-01-03
\str_lower_case:n 2020-01-03
\str_upper_case:f 2020-01-03
diff --git a/l3kernel/l3color.dtx b/l3kernel/l3color.dtx
index a40f5fd38..1c4c3e477 100644
--- a/l3kernel/l3color.dtx
+++ b/l3kernel/l3color.dtx
@@ -2146,7 +2146,7 @@
{
\exp_args:Nee \@@_model_new:nnn
{ \tl_to_str:n {#1} }
- { \str_foldcase:n {#2} } {#3}
+ { \str_casefold:n {#2} } {#3}
}
\cs_new_protected:Npn \@@_model_new:nnn #1#2#3
{
diff --git a/l3kernel/l3deprecation.dtx b/l3kernel/l3deprecation.dtx
index dc0c7c5dc..429ba1419 100644
--- a/l3kernel/l3deprecation.dtx
+++ b/l3kernel/l3deprecation.dtx
@@ -468,10 +468,20 @@
\cs_gset:Npn \str_upper_case:n { \str_uppercase:n }
\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_uppercase:f }
\cs_gset:Npn \str_upper_case:f { \str_uppercase:f }
-\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_foldcase:n }
-\cs_gset:Npn \str_fold_case:n { \str_foldcase:n }
-\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_foldcase:V }
-\cs_gset:Npn \str_fold_case:V { \str_foldcase:V }
+\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_casefold:n }
+\cs_gset:Npn \str_fold_case:n { \str_casefold:n }
+\__kernel_patch_deprecation:nnNNpn { 2020-01-03 } { \str_casefold:V }
+\cs_gset:Npn \str_fold_case:V { \str_casefold:V }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]
+% {\str_foldcase:n, \str_foldcase:V}
+% \begin{macrocode}
+\__kernel_patch_deprecation:nnNNpn { 2020-10-17 } { \str_casefold:n }
+\cs_gset:Npn \str_foldcase:n { \str_casefold:n }
+\__kernel_patch_deprecation:nnNNpn { 2022-10-17 } { \str_casefold:V }
+\cs_gset:Npn \str_foldcase:V { \str_casefold:V }
% \end{macrocode}
% \end{macro}
%
diff --git a/l3kernel/l3fp-parse.dtx b/l3kernel/l3fp-parse.dtx
index 75e61a6f2..c035fc94c 100644
--- a/l3kernel/l3fp-parse.dtx
+++ b/l3kernel/l3fp-parse.dtx
@@ -1023,7 +1023,7 @@
\cs_if_exist_use:cF { @@_parse_word_#2:N }
{
\cs_if_exist_use:cF
- { @@_parse_caseless_ \str_foldcase:n {#2} :N }
+ { @@_parse_caseless_ \str_casefold:n {#2} :N }
{
\msg_expandable_error:nnn
{ fp } { unknown-fp-word } {#2}
diff --git a/l3kernel/l3str.dtx b/l3kernel/l3str.dtx
index 1239c2b07..986e1202f 100644
--- a/l3kernel/l3str.dtx
+++ b/l3kernel/l3str.dtx
@@ -744,7 +744,7 @@
%
% These functions should \emph{not} be used for
% \begin{itemize}
-% \item Caseless comparisons: use \cs{str_foldcase:n} for this
+% \item Caseless comparisons: use \cs{str_casefold:n} for this
% situation (case folding is distinct from lower casing).
% \item Case changing text for typesetting: see the
% \cs[index=text_lowercase:n]{text_lowercase:n(n)},
@@ -755,10 +755,10 @@
% \end{itemize}
% \end{function}
%
-% \begin{function}[EXP, added = 2019-11-26]
-% {\str_foldcase:n, \str_foldcase:V}
+% \begin{function}[EXP, added = 2022-10-16]
+% {\str_casefold:n, \str_casefold:V}
% \begin{syntax}
-% \cs{str_foldcase:n} \Arg{tokens}
+% \cs{str_casefold:n} \Arg{tokens}
% \end{syntax}
% Converts the input \meta{tokens} to their string representation, as
% described for \cs{tl_to_str:n}, and then folds the case of the resulting
@@ -766,7 +766,7 @@
% left in the input stream.
%
% String folding is a process used for material such as identifiers rather
-% than for \enquote{text}. The folding provided by \cs{str_foldcase:n}
+% than for \enquote{text}. The folding provided by \cs{str_casefold:n}
% follows the mappings provided by the \href{http://www.unicode.org}^^A
% {Unicode Consortium}, who
% \href{http://www.unicode.org/faq/casemap_charprop.html#2}{state}:
@@ -779,7 +779,7 @@
% should be used solely for internal processing and generally should not be
% stored or displayed to the end user.
% \end{quote}
-% The folding approach implemented by \cs{str_foldcase:n} follows the
+% The folding approach implemented by \cs{str_casefold:n} follows the
% \enquote{full} scheme defined by the Unicode Consortium
% (\emph{e.g.}~\SS folds to \texttt{SS}). As case-folding is
% a language-insensitive process, there is no special treatment of
@@ -843,6 +843,16 @@
% code and so should only be used for short-term storage.
% \end{variable}
%
+% \section{Deprecated functions}
+%
+% \begin{function}[EXP, added = 2019-11-26]
+% {\str_foldcase:n, \str_foldcase:V}
+% \begin{syntax}
+% \cs{str_foldcase:n} \Arg{tokens}
+% \end{syntax}
+% A previous name for the functionally-identical \cs{str_casefold:n}.
+% \end{function}
+%
% \end{documentation}
%
% \begin{implementation}
@@ -1896,7 +1906,7 @@
%
% \begin{macro}[EXP]
% {
-% \str_foldcase:n, \str_foldcase:V,
+% \str_casefold:n, \str_casefold:V,
% \str_lowercase:n, \str_lowercase:f,
% \str_uppercase:n, \str_uppercase:f
% }
@@ -1920,10 +1930,10 @@
% with text-based case changing. Similarly, for $8$-bit engines the
% multi-byte information is shared.
% \begin{macrocode}
-\cs_new:Npn \str_foldcase:n #1 { \@@_change_case:nn {#1} { casefold } }
+\cs_new:Npn \str_casefold:n #1 { \@@_change_case:nn {#1} { casefold } }
\cs_new:Npn \str_lowercase:n #1 { \@@_change_case:nn {#1} { lowercase } }
\cs_new:Npn \str_uppercase:n #1 { \@@_change_case:nn {#1} { uppercase } }
-\cs_generate_variant:Nn \str_foldcase:n { V }
+\cs_generate_variant:Nn \str_casefold:n { V }
\cs_generate_variant:Nn \str_lowercase:n { f }
\cs_generate_variant:Nn \str_uppercase:n { f }
\cs_new:Npn \@@_change_case:nn #1
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index faaf1cbf2..0c3ea223e 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -119,7 +119,7 @@
% Importantly, notice that these functions are intended for working with
% user \emph{text for typesetting}. For case changing programmatic data see
% the \pkg{l3str} module and discussion there of \cs{str_lowercase:n},
-% \cs{str_uppercase:n} and \cs{str_foldcase:n}.
+% \cs{str_uppercase:n} and \cs{str_casefold:n}.
%
% Case changing does not take place within math mode material so for example
% \begin{verbatim}
diff --git a/l3kernel/testfiles-backend/m3color003.lvt b/l3kernel/testfiles-backend/m3color003.lvt
index 5047a5df5..9307f9b81 100644
--- a/l3kernel/testfiles-backend/m3color003.lvt
+++ b/l3kernel/testfiles-backend/m3color003.lvt
@@ -160,7 +160,7 @@
\exp_args:Nnnx \color_model_new:nnn { BarTone #1 } { Separation }
{
name = BarTone~555~GN ,
- alternative-model = \str_foldcase:n {#1} ,
+ alternative-model = \str_casefold:n {#1} ,
alternative-values = {#2}
}
\color_set:nnn { foo #1 } { BarTone #1 } { 0.5 }
diff --git a/l3kernel/testfiles/m3str002.lvt b/l3kernel/testfiles/m3str002.lvt
index dcd598c2d..3de71b8b2 100644
--- a/l3kernel/testfiles/m3str002.lvt
+++ b/l3kernel/testfiles/m3str002.lvt
@@ -13,11 +13,11 @@
\TESTEXP { Simple~Latin~case~folding }
{
- " \str_foldcase:n { ABC ~ 123 ~ abc ~ !@ } "
+ " \str_casefold:n { ABC ~ 123 ~ abc ~ !@ } "
\NEWLINE
- " \str_foldcase:n { ~ ABC ~ 123 ~ abc ~ !@ ~ } "
+ " \str_casefold:n { ~ ABC ~ 123 ~ abc ~ !@ ~ } "
\NEWLINE
- " \str_foldcase:n { Some~$&#~odd~text~{~}~ } "
+ " \str_casefold:n { Some~$&#~odd~text~{~}~ } "
}
\TEST { Checking~category~codes }
@@ -25,12 +25,12 @@
\OMIT
\tl_set:Nn \l_tmpa_tl { abc~123 }
\TIMO
- \tl_set:Nx \l_tmpb_tl{ \str_foldcase:n { ABC~123 } }
+ \tl_set:Nx \l_tmpb_tl{ \str_casefold:n { ABC~123 } }
\tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl \ERROR \FALSE
\OMIT
\tl_set:Nx \l_tmpa_tl { \tl_to_str:n { abc~123 } }
\TIMO
- \tl_set:Nx \l_tmpb_tl{ \str_foldcase:n { ABC~123 } }
+ \tl_set:Nx \l_tmpb_tl{ \str_casefold:n { ABC~123 } }
\tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl \TRUE \ERROR
}
\sys_if_engine_ptex:T { \END }
@@ -38,21 +38,21 @@
{
" \str_uppercase:n { Café } "
\NEWLINE
- " \str_foldcase:n { ĆėƊṐṑ } "
+ " \str_casefold:n { ĆėƊṐṑ } "
\NEWLINE
- " \str_foldcase:n { ᾪωΝ } "
+ " \str_casefold:n { ᾪωΝ } "
\NEWLINE
- " \str_foldcase:n { ΰῢst } "
+ " \str_casefold:n { ΰῢst } "
\NEWLINE
- " \str_foldcase:n { Ꚉ ꚇ} "
+ " \str_casefold:n { Ꚉ ꚇ} "
\NEWLINE
- " \str_foldcase:n { ZꝎⓍ } "
+ " \str_casefold:n { ZꝎⓍ } "
}
\TEST { Characters~with~context-sensitive~Unicode~behaviour }
{
- \tl_set:Nx \l_tmpa_tl { \str_foldcase:n { όσος } }
- \tl_set:Nx \l_tmpb_tl { \str_foldcase:n { ΌΣΟΣ } }
+ \tl_set:Nx \l_tmpa_tl { \str_casefold:n { όσος } }
+ \tl_set:Nx \l_tmpb_tl { \str_casefold:n { ΌΣΟΣ } }
\tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl \TRUE \FALSE
}
More information about the latex3-commits
mailing list.