[latex3-commits] [git/LaTeX3-latex3-babel] main: A safer hack for #189. (04d9bb4)

Javier email at dante.de
Sat Oct 8 14:25:06 CEST 2022


Repository : https://github.com/latex3/babel
On branch  : main
Link       : https://github.com/latex3/babel/commit/04d9bb47f0d303508b5f27f061bfc522fbf4946b

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

commit 04d9bb47f0d303508b5f27f061bfc522fbf4946b
Author: Javier <email at localhost>
Date:   Sat Oct 8 14:25:06 2022 +0200

    A safer hack for #189.


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

04d9bb47f0d303508b5f27f061bfc522fbf4946b
 README.md    |   4 +--
 babel.dtx    | 104 +++++++++++++++++++++++++++++++++++------------------------
 babel.ins    |   2 +-
 babel.pdf    | Bin 886601 -> 886587 bytes
 bbcompat.dtx |   2 +-
 5 files changed, 66 insertions(+), 46 deletions(-)

diff --git a/README.md b/README.md
index dc16395..a1eb085 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-## Babel 3.81.2883
+## Babel 3.81.2884
 
-2022-10-04
+**Development**
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages. Many
diff --git a/babel.dtx b/babel.dtx
index 5476a19..e679914 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2022/10/07 v3.81.2883 The Babel package]
+\ProvidesFile{babel.dtx}[2022/10/08 v3.81.2884 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -5176,8 +5176,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.81.2883>>
-%<<date=2022/10/07>>
+%<<version=3.81.2884>>
+%<<date=2022/10/08>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -7058,7 +7058,7 @@ help from Bernd Raichle, for which I am grateful.
 \def\bbl at redefine@long#1{%
   \edef\bbl at tempa{\bbl at stripslash#1}%
   \expandafter\let\csname org@\bbl at tempa\endcsname#1%
-  \expandafter\long\expandafter\def\csname\bbl at tempa\endcsname}
+  \long\expandafter\def\csname\bbl at tempa\endcsname}
 \@onlypreamble\bbl at redefine@long
 %    \end{macrocode}
 %
@@ -7635,7 +7635,7 @@ help from Bernd Raichle, for which I am grateful.
   \bbl at csarg\edef{normal@#2}{%
     \noexpand\active at prefix\noexpand#1%
     \expandafter\noexpand\csname normal at char#2\endcsname}%
-  \expandafter\let\expandafter#1\csname bbl at normal@#2\endcsname
+  \bbl at ncarg\let#1{bbl at normal@#2}%
 %    \end{macrocode}
 %
 %    The next level of the code checks whether a user has defined a
@@ -8022,10 +8022,8 @@ help from Bernd Raichle, for which I am grateful.
          \@notshorthand{#2}%
        \else
          \initiate at active@char{#2}%
-         \expandafter\let\csname active at char\string#2\expandafter\endcsname
-           \csname active at char\string#1\endcsname
-         \expandafter\let\csname normal at char\string#2\expandafter\endcsname
-           \csname normal at char\string#1\endcsname
+         \bbl at ccarg\let{active at char\string#2}{active at char\string#1}%
+         \bbl at ccarg\let{normal at char\string#2}{normal at char\string#1}%
          \bbl at activate{#2}%
        \fi
      \fi}%
@@ -8718,20 +8716,44 @@ help from Bernd Raichle, for which I am grateful.
 % A temporary hack:
 \ifx\BabelCaseHack\@undefined
 \AtBeginDocument{%
-  \bbl at exp{%
-    \\\in@{\string\@uclclist}%
-          {\expandafter\meaning\csname MakeUppercase \endcsname}}%
+  \bbl at xin@{\string\@uclclist}%
+           {\bbl at carg\meaning{MakeUppercase }}%
   \ifin@\else
-    \expandafter\let\expandafter\bbl at newuc\csname MakeUppercase \endcsname
+    \chardef\bbl at ulflag\z@
+    \bbl at ncarg\let\bbl at newuc{MakeUppercase }%
     \protected\@namedef{MakeUppercase }#1{{%
-      \def\reserved at a##1##2{\let##1##2\reserved at a}%
-      \expandafter\reserved at a\@uclclist\reserved at b{\reserved at b\@gobble}%
-      \protected at edef\reserved at a{\bbl at newuc{#1}}\reserved at a}}%
-    \expandafter\let\expandafter\bbl at newlc\csname MakeLowercase \endcsname
+      \chardef\bbl at ulflag\@ne
+      \ifx\bbl at uclc\@undefined
+        \bbl at newuc{#1}%
+      \else
+        \bbl at ifunset{\languagename @bbl at uclc}%
+          {\bbl at newuc{#1}}%
+          {\def\reserved at a##1##2{\let##1##2\reserved at a}%
+           \bbl at uclc\reserved at a\reserved at b{\reserved at b\@gobble}%
+           \protected at edef\reserved at a{\bbl at newuc{#1}}% Pre-expand
+           \reserved at a}%
+      \fi}}%
+    \bbl at ncarg\let\bbl at newlc{MakeLowercase }%
     \protected\@namedef{MakeLowercase }#1{{%
-      \def\reserved at a##1##2{\let##2##1\reserved at a}%
-      \expandafter\reserved at a\@uclclist\reserved at b{\reserved at b\@gobble}%
-      \protected at edef\reserved at a{\bbl at newlc{#1}}\reserved at a}}%
+      \chardef\bbl at ulflag\tw@
+      \ifx\bbl at uclc\@undefined
+        \bbl at newlc{#1}%
+      \else
+        \bbl at ifunset{\languagename @bbl at uclc}%
+          {\bbl at newlc{#1}}%
+          {\def\reserved at a##1##2{\let##2##1\reserved at a}%
+           \bbl at uclc\reserved at a\reserved at b{\reserved at b\@gobble}%
+           \protected at edef\reserved at a{\bbl at newlc{#1}}% Pre-expand
+           \reserved at a}%
+      \fi}}%
+  \def\bbl at cased{%
+    \ifcase\bbl at ulflag
+      \expandafter\@firstofone
+    \or
+      \expandafter\MakeUppercase
+    \or
+      \expandafter\MakeLowercase
+    \fi}%
   \fi}   
 \fi  
 %    \end{macrocode}
@@ -9016,12 +9038,9 @@ help from Bernd Raichle, for which I am grateful.
   \newcommand\SetCase[3][]{%
     \bbl at patchuclc
     \bbl at forlang\bbl at tempa{%
-      \expandafter\bbl at encstring
-        \csname\bbl at tempa @bbl at uclc\endcsname{\bbl at tempa##1}%
-      \expandafter\bbl at encstring
-        \csname\bbl at tempa @bbl at uc\endcsname{##2}%
-      \expandafter\bbl at encstring
-        \csname\bbl at tempa @bbl at lc\endcsname{##3}}}%
+      \bbl at carg\bbl at encstring{\bbl at tempa @bbl at uclc}{\bbl at tempa##1}%
+      \bbl at carg\bbl at encstring{\bbl at tempa @bbl at uc}{##2}%
+      \bbl at carg\bbl at encstring{\bbl at tempa @bbl at lc}{##3}}}%
 %<</Macros local to BabelCommands>>
 %    \end{macrocode}
 %
@@ -9524,7 +9543,7 @@ help from Bernd Raichle, for which I am grateful.
 %    \begin{macrocode}
 \def\umlauthigh{%
   \def\bbl at umlauta##1{\leavevmode\bgroup%
-      \expandafter\accent\csname\f at encoding dqpos\endcsname
+      \accent\csname\f at encoding dqpos\endcsname
       ##1\bbl at allowhyphens\egroup}%
   \let\bbl at umlaute\bbl at umlauta}
 \def\umlautlow{%
@@ -9570,10 +9589,10 @@ help from Bernd Raichle, for which I am grateful.
   \leavevmode\bgroup
     \U at D 1ex%
     {\setbox\z@\hbox{%
-      \expandafter\char\csname\f at encoding dqpos\endcsname}%
+      \char\csname\f at encoding dqpos\endcsname}%
       \dimen@ -.45ex\advance\dimen@\ht\z@
       \ifdim 1ex<\dimen@ \fontdimen5\font\dimen@ \fi}%
-    \expandafter\accent\csname\f at encoding dqpos\endcsname
+    \accent\csname\f at encoding dqpos\endcsname
     \fontdimen5\font\U at D #1%
   \egroup}
 %    \end{macrocode}
@@ -10109,17 +10128,18 @@ help from Bernd Raichle, for which I am grateful.
       {\bbl at post@fs}%
   \fi
   % == transforms ==
-  \ifx\bbl at KVP@transforms\@nnil\else
-    \def\bbl at elt##1##2##3{%
-      \in@{$transforms.}{$##1}%
-      \ifin@
-        \def\bbl at tempa{##1}%
-        \bbl at replace\bbl at tempa{transforms.}{}%
-        \expandafter
-        \bbl at transforms\csname babel\bbl at tempa\endcsname{##2}{##3}%
-      \fi}%
-    \csname bbl at inidata@\languagename\endcsname
-    \bbl at release@transforms\relax % \relax closes the last item.
+  \ifodd\bbl at engine
+    \ifx\bbl at KVP@transforms\@nnil\else
+      \def\bbl at elt##1##2##3{%
+        \in@{$transforms.}{$##1}%
+        \ifin@
+          \def\bbl at tempa{##1}%
+          \bbl at replace\bbl at tempa{transforms.}{}%
+          \bbl at carg\bbl at transforms{babel\bbl at tempa}{##2}{##3}%
+        \fi}%
+      \csname bbl at inidata@\languagename\endcsname
+      \bbl at release@transforms\relax % \relax closes the last item.
+    \fi
   \fi
   % == main ==
   \ifx\bbl at KVP@main\@nnil  % Restore only if not 'main'
@@ -10943,7 +10963,7 @@ help from Bernd Raichle, for which I am grateful.
     \ifin@
       \in@{.0$}{#2$}&%
       \ifin@
-        \directlua{% (\attribute) syntax
+        \directlua{&% (\attribute) syntax
           local str = string.match([[\bbl at KVP@transforms]],
                         '%(([^%(]-)%)[^%)]-\babeltempa')
           if str == nil then
@@ -12380,7 +12400,7 @@ help from Bernd Raichle, for which I am grateful.
 %
 %    \begin{macrocode}
 \ifx\bbl at opt@main\@nnil\else
-  \bbl at csarg\let{loadmain\expandafter}\csname ds@\bbl at opt@main\endcsname
+  \bbl at ncarg\let\bbl at loadmain{ds@\bbl at opt@main}%
   \expandafter\let\csname ds@\bbl at opt@main\endcsname\relax
 \fi
 %    \end{macrocode}
diff --git a/babel.ins b/babel.ins
index 944c206..87642c4 100644
--- a/babel.ins
+++ b/babel.ins
@@ -26,7 +26,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %%
-\def\filedate{2022/10/07}
+\def\filedate{2022/10/08}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 11e1a6f..deae23b 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index a874c0a..07673a8 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/10/07 v3.81.2883]
+\ProvidesFile{bbcompat.dtx}[2022/10/08 v3.81.2884]
 %</dtx>
 %
 %% File 'bbcompat.dtx'





More information about the latex3-commits mailing list.