From 16559ce13a74c7a182875559b379cac00b07efda Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Thu, 9 Jun 2022 03:01:00 +0000
Subject: CTAN sync 202206090300

---
 macros/latex/base/ltfinal.dtx | 89 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 72 insertions(+), 17 deletions(-)

(limited to 'macros/latex/base/ltfinal.dtx')

diff --git a/macros/latex/base/ltfinal.dtx b/macros/latex/base/ltfinal.dtx
index 40017a205a..b1b8ff953b 100644
--- a/macros/latex/base/ltfinal.dtx
+++ b/macros/latex/base/ltfinal.dtx
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 1993-2021
+% Copyright (C) 1993-2022
 % The LaTeX Project and any individual authors listed elsewhere
 % in this file.
 %
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltfinal.dtx}
-             [2021/09/06 v2.2q LaTeX Kernel (Final Settings)]
+             [2022/06/02 v2.2u LaTeX Kernel (Final Settings)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltfinal.dtx}
@@ -57,11 +57,14 @@
 %
 %
 % \section{Final settings}
-% This section contains the final settings for \LaTeX.  It initializes
-% some debugging and typesetting parameters, sets the default
-% |\catcode|s and uc/lc codes, and inputs the hyphenation file.
 %
-% \StopEventually{}
+%    This section contains the final settings for \LaTeX.  It initializes
+%    some debugging and typesetting parameters, sets the default
+%    |\catcode|s and uc/lc codes, and inputs the hyphenation file.
+%
+%
+%
+% \MaybeStop{}
 %
 % \changes{v0.1a}{1994/03/07}{Initial version, split from latex.dtx}
 % \changes{v0.1a}{1994/03/07}{Remove oldcomments environment}
@@ -149,6 +152,34 @@
 %<*2ekernel>
 %    \end{macrocode}
 % \end{macro}
+%
+%
+%    
+%    Allocate 3 mark classes to be used in \cs{markboth} and
+%    \cs{markright}. Should be done earlier but for that definition of
+%    \cs{newmarks} needs moving (which it should I guess).
+% \changes{v2.2s}{2022/04/03}{Integration of new mark management interface}
+%    \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2022/06/01}%
+%<latexrelease>                 {2e-left}{Delayed legacy marks}%
+\NewMarkClass {2e-left}     
+\NewMarkClass {2e-right}     
+\NewMarkClass {2e-right-nonempty}
+%    \end{macrocode}
+%    No rollback really, the marks will remain.
+%    \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {2e-left}{Delayed legacy marks}%
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+%    \end{macrocode}
+
+
 %
 %\begin{macro}{\newXeTeXintercharclass}
 % \changes{v2.0a}{2014/12/30}{macro added}
@@ -242,9 +273,9 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{trace_stack_levels}
+% \begin{macro}{trace\string_stack\string_levels}
 %   Now define the Lua function to emulate \cs{tracingstacklevels} and
-%   install it in the \texttt{input_level_string} callback.
+%   install it in the |input_level_string| callback.
 %    \begin{macrocode}
 %</2ekernel>
 %<*2ekernel|latexrelease>
@@ -1033,11 +1064,16 @@
 %
 % \begin{macro}{\MakeUppercase}
 % \begin{macro}{\MakeUppercase}
+% \begin{macro}{\NoCaseChange}
+% \begin{macro}{\@uclclist}
+% \begin{macro}{\@expl@text@lowercase@@n}
+% \begin{macro}{\@expl@text@uppercase@@n}
 % \begin{macro}{\@uclclist}
 %
+%
 % \changes{v1.1a}{1997/10/20}{Removed \cs{aa} and \cs{AA} from
 %    \cs{@uclclist} as these are macros.}
-%
+% \changes{v2.2r}{2022/02/20}{use \cs{text_lowercase:n}}%
 %    And whilst we're doing things with uc/lc tables, here are two
 %    commands to upper- and lower-case a string.
 %
@@ -1048,6 +1084,24 @@
 %    mathematics, environment names, labels, etc.  A much better
 %    long-term solution is to use all-caps fonts, but these aren't
 %    generally available.
+%
+% Two wrappers around the L3 case changing functions.
+% |\protected| to make them mostly safe as replacements for |uppercase|
+% and |\lowercase|.  
+%    \begin{macrocode}
+\ExplSyntaxOn
+\protected\def\@expl@text@lowercase@@n{\text_lowercase:n}
+\protected\def\@expl@text@uppercase@@n{\text_uppercase:n}
+%    \end{macrocode}
+%
+% \changes{v2.2u}{2022/06/02}{Add \cs{NoCaseChange}}
+% |\NoCaseChange| protects its argument from the case change functions.
+%    \begin{macrocode}
+\tl_put_right:Nn \l_text_case_exclude_arg_tl  { \NoCaseChange }
+\cs_new_protected:Npn \NoCaseChange #1 {#1}
+\ExplSyntaxOff
+%    \end{macrocode}
+%
 %    \begin{macrocode}
 \DeclareRobustCommand{\MakeUppercase}[1]{{%
       \def\i{I}\def\j{J}%
@@ -1056,20 +1110,17 @@
 %    \end{macrocode}
 %    Tell UTF-8 processing to process chars even though we are in an \cs{protected@edef}.
 % \changes{v2.1h}{2019/09/14}{Expand UTF8 chars when case changing (github/177)}
+% \changes{v2.2r}{2022/02/20}
+%                {Use \cs{@expl@text@uppercase@@n}, removing local redefinition of \cs{UTF@two@octets@noexpand}}%
+% \changes{v2.2t}{2022/04/21}{Support \cs{noexpand} in argument of \cs{@expl@text@uppercase@@n}}
 %    \begin{macrocode}
-      \let\UTF@two@octets@noexpand\@empty
-      \let\UTF@three@octets@noexpand\@empty
-      \let\UTF@four@octets@noexpand\@empty
-      \protected@edef\reserved@a{\uppercase{#1}}%
+      \protected@edef\reserved@a{\@expl@text@uppercase@@n{\noexpand\unexpanded{#1}}}%
       \reserved@a
    }}
 \DeclareRobustCommand{\MakeLowercase}[1]{{%
       \def\reserved@a##1##2{\let##2##1\reserved@a}%
       \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
-      \let\UTF@two@octets@noexpand\@empty
-      \let\UTF@three@octets@noexpand\@empty
-      \let\UTF@four@octets@noexpand\@empty
-      \protected@edef\reserved@a{\lowercase{#1}}%
+      \protected@edef\reserved@a{\@expl@text@lowercase@@n{\noexpand\unexpanded{#1}}}%
       \reserved@a
    }}
 %    \end{macrocode}
@@ -1105,6 +1156,10 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %
 % \changes{v1.0h}{1994/05/13}{Added output enc stuff}
 % \changes{v1.0i}{1994/05/16}{moved output enc stuff to lfonts}
-- 
cgit v1.2.3

