From f7836c00ede16e9ae6c768703b9f191570aba955 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 30 Nov 2022 20:32:56 +0000
Subject: babel (30nov22)

git-svn-id: svn://tug.org/texlive/trunk@65152 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/generic/babel/babel.sty | 80 +++++++++++----------------
 1 file changed, 32 insertions(+), 48 deletions(-)

(limited to 'Master/texmf-dist/tex/generic/babel/babel.sty')

diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty
index d8cfb4243a4..7a2f278811b 100644
--- a/Master/texmf-dist/tex/generic/babel/babel.sty
+++ b/Master/texmf-dist/tex/generic/babel/babel.sty
@@ -34,7 +34,7 @@
 %%
 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{babel}[2022/10/23 3.82 The Babel package]
+\ProvidesPackage{babel}[2022/11/30 3.83 The Babel package]
 \@ifpackagewith{babel}{debug}
   {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}%
    \let\bbl@debug\@firstofone
@@ -462,8 +462,8 @@
       \expandafter\@secondoftwo
     \fi}
 \fi
-\def\bbl@version{3.82}
-\def\bbl@date{2022/10/23}
+\def\bbl@version{3.83}
+\def\bbl@date{2022/11/30}
 \ifx\language\@undefined
   \csname newcount\endcsname\language
 \fi
@@ -1952,48 +1952,25 @@
       {\bbl@tolower\@empty}{\bbl@toupper\@empty}}%
     \gdef\bbl@tolower{\csname\languagename @bbl@lc\endcsname}%
     \gdef\bbl@toupper{\csname\languagename @bbl@uc\endcsname}}}
-\ifx\BabelCaseHack\@undefined
-\AtBeginDocument{%
-  \bbl@xin@{\string\@uclclist}%
-           {\bbl@carg\meaning{MakeUppercase }}%
-  \ifin@\else
-    \chardef\bbl@ulflag\z@
-    \bbl@ncarg\let\bbl@newuc{MakeUppercase }%
-    \protected\@namedef{MakeUppercase }#1{{%
-      \chardef\bbl@ulflag\@ne
-      \ifx\bbl@uclc\@undefined
-        \bbl@newuc{#1}%
-      \else
-        \bbl@ifunset{\languagename @bbl@uclc}%
-          {\bbl@newuc{#1}}%
-          {\def\reserved@a##1##2{\let##1##2\reserved@a}%
-           \bbl@uclc\reserved@a\reserved@b{\reserved@b\@gobble}%
-           \protected@edef\reserved@a{\bbl@newuc{#1}}% Pre-expand
-           \reserved@a}%
-      \fi}}%
-    \bbl@ncarg\let\bbl@newlc{MakeLowercase }%
-    \protected\@namedef{MakeLowercase }#1{{%
-      \chardef\bbl@ulflag\tw@
-      \ifx\bbl@uclc\@undefined
-        \bbl@newlc{#1}%
-      \else
-        \bbl@ifunset{\languagename @bbl@uclc}%
-          {\bbl@newlc{#1}}%
-          {\def\reserved@a##1##2{\let##2##1\reserved@a}%
-           \bbl@uclc\reserved@a\reserved@b{\reserved@b\@gobble}%
-           \protected@edef\reserved@a{\bbl@newlc{#1}}% Pre-expand
-           \reserved@a}%
-      \fi}}%
-  \def\bbl@cased{%
-    \ifcase\bbl@ulflag
-      \expandafter\@firstofone
-    \or
-      \expandafter\MakeUppercase
-    \or
-      \expandafter\MakeLowercase
-    \fi}%
-  \fi}
-\fi
+\def\BabelRestoreCase{%
+  \DeclareRobustCommand{\MakeUppercase}[1]{{%
+    \def\reserved@a####1####2{\let####1####2\reserved@a}%
+    \def\i{I}\def\j{J}%
+    \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{\uppercase{##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}}%
+    \reserved@a}}}
 \@onlypreamble\StartBabelCommands
 \def\StartBabelCommands{%
   \begingroup
@@ -3320,8 +3297,11 @@
   \fi
   \bbl@xin@{,\bbl@tempa,}{,figure,table,}%
   \ifin@
-    \toks@\expandafter{\bbl@toreplace}%
-    \bbl@exp{\gdef\<fnum@\bbl@tempa>{\the\toks@}}%
+    \global\bbl@csarg\let{\bbl@tempa fmt@#2}\bbl@toreplace
+    \bbl@exp{\gdef\<fnum@\bbl@tempa>{%
+      \\\bbl@ifunset{bbl@\bbl@tempa fmt@\\\languagename}%
+        {\[fnum@\bbl@tempa]}%
+        {\\\@nameuse{bbl@\bbl@tempa fmt@\\\languagename}}}}%
   \fi}
 \def\bbl@ini@captions@aux#1#2{%
   \bbl@trim@def\bbl@tempa{#1}%
@@ -4425,8 +4405,12 @@
 \ifx\bbl@opt@main\@nnil
   \edef\bbl@tempa{\@classoptionslist,\bbl@language@opts}
   \let\bbl@tempc\@empty
+  \edef\bbl@templ{,\bbl@loaded,}
+  \edef\bbl@templ{\expandafter\strip@prefix\meaning\bbl@templ}
   \bbl@for\bbl@tempb\bbl@tempa{%
-    \bbl@xin@{,\bbl@tempb,}{,\bbl@loaded,}%
+    \edef\bbl@tempd{,\bbl@tempb,}%
+    \edef\bbl@tempd{\expandafter\strip@prefix\meaning\bbl@tempd}%
+    \bbl@xin@{\bbl@tempd}{\bbl@templ}%
     \ifin@\edef\bbl@tempc{\bbl@tempb}\fi}
   \def\bbl@tempa#1,#2\@nnil{\def\bbl@tempb{#1}}
   \expandafter\bbl@tempa\bbl@loaded,\@nnil
-- 
cgit v1.2.3

