[latex3-commits] [git/LaTeX3-latex3-babel] main: In some cases the hyphenrules weren’t correctly set. (7256f9c)

Javier email at dante.de
Wed Jan 11 18:57:34 CET 2023


Repository : https://github.com/latex3/babel
On branch  : main
Link       : https://github.com/latex3/babel/commit/7256f9c2414ecbdcdb6d891f8896aace645132c7

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

commit 7256f9c2414ecbdcdb6d891f8896aace645132c7
Author: Javier <email at localhost>
Date:   Wed Jan 11 18:57:34 2023 +0100

    In some cases the hyphenrules weren’t correctly set.


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

7256f9c2414ecbdcdb6d891f8896aace645132c7
 README.md    |   3 ++-
 babel.dtx    |  60 ++++++++++++++++++++++++++++++-----------------------------
 babel.ins    |   2 +-
 babel.pdf    | Bin 906706 -> 906641 bytes
 bbcompat.dtx |   2 +-
 5 files changed, 35 insertions(+), 32 deletions(-)

diff --git a/README.md b/README.md
index e363e0f..d7c7e52 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.84.2976
+## Babel 3.84.2979
 
 (dev)
 
@@ -54,6 +54,7 @@ respective authors.
       * Font-dependent transforms (lua).
       * Fixes:
         - \babelprehyphenation was not applied with 'onchar'.
+        - In some rare cases the hyphenrules were not correctly set.
       
 3.84  2022-12-26
       * Automatic selection of encodings with \babelprovide and pdftex.
diff --git a/babel.dtx b/babel.dtx
index ef7937b..3a758d6 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2023/01/08 v3.84.2976 The Babel package]
+\ProvidesFile{babel.dtx}[2023/01/11 v3.84.2979 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -5246,8 +5246,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.84.2976>>
-%<<date=2023/01/08>>
+%<<version=3.84.2979>>
+%<<date=2023/01/11>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -9796,7 +9796,7 @@ help from Bernd Raichle, for which I am grateful.
   % \ifx\bbl at KVP@date\@nnil\else
   % \fi
   % ==
-  \let\bbl at lbkflag\relax % \@empty = do setup linebreak
+  \let\bbl at lbkflag\relax % \@empty = do setup linebreak, only in 3 cases:
   \ifcase\bbl at howloaded
     \let\bbl at lbkflag\@empty % new
   \else
@@ -9821,6 +9821,7 @@ help from Bernd Raichle, for which I am grateful.
       {}%
     \let\bbl at KVP@date\@empty
   \fi
+  \let\bbl at KVP@captions@@\bbl at KVP@captions % TODO. A dirty hack
   \ifx\bbl at KVP@captions\@nnil
     \let\bbl at KVP@captions\bbl at KVP@import
   \fi
@@ -10224,48 +10225,49 @@ help from Bernd Raichle, for which I am grateful.
     {}}
 %    \end{macrocode}
 %
-% The |hyphenrules| option is handled with an auxiliary macro.
+% The |hyphenrules| option is handled with an auxiliary macro. This
+% macro is called in three cases: when a language is first declared
+% with |\babelprovide|, with |hyphenrules| and with |import|.
 %
 %    \begin{macrocode}
 \def\bbl at provide@hyphens#1{%
-  \let\bbl at tempa\relax
+  \@tempcnta\m at ne  % a flag
   \ifx\bbl at KVP@hyphenrules\@nnil\else
     \bbl at replace\bbl at KVP@hyphenrules{ }{,}%
     \bbl at foreach\bbl at KVP@hyphenrules{%
-      \ifx\bbl at tempa\relax    %  if not yet found
+      \ifnum\@tempcnta=\m at ne   % if not yet found
         \bbl at ifsamestring{##1}{+}%  
-          {{\bbl at exp{\\\addlanguage\<l@##1>}}}%
+          {\bbl at carg\addlanguage{l@##1}}%
           {}%
-        \bbl at ifunset{l@##1}%
+        \bbl at ifunset{l@##1}% After a possible +
           {}%
-          {\bbl at exp{\let\bbl at tempa\<l@##1>}}%
+          {\@tempcnta\@nameuse{l@##1}}%
       \fi}%
-    \ifx\bbl at tempa\relax 
+    \ifnum\@tempcnta=\m at ne
       \bbl at warning{%
         Requested 'hyphenrules=' for '\languagename' not found.\\%
         Using the default value. Reported}%
     \fi
   \fi
-  \ifx\bbl at tempa\relax %         if no opt or no language in opt found
-    \ifx\bbl at KVP@import\@nnil
-      \ifx\bbl at initoload\relax\else
-        \bbl at exp{%               and hyphenrules is not empty
-          \\\bbl at ifblank{\bbl at cs{hyphr@#1}}%
-            {}%
-            {\let\\\bbl at tempa\<l@\bbl at cl{hyphr}>}}%
-      \fi 
-    \else % if importing
-      \bbl at exp{%                    and hyphenrules is not empty
-        \\\bbl at ifblank{\bbl at cs{hyphr@#1}}%
-          {}%
-          {\let\\\bbl at tempa\<l@\bbl at cl{hyphr}>}}%
+  \ifnum\@tempcnta=\m at ne          % if no opt or no language in opt found
+    \ifx\bbl at KVP@captions@@\@nnil % TODO. Hackish. See above.
+      \bbl at ifunset{bbl at hyphr@#1}{}% use value in ini, if exists
+        {\bbl at exp{\\\bbl at ifblank{\bbl at cs{hyphr@#1}}}%
+           {}%
+           {\bbl at ifunset{l@\bbl at cl{hyphr}}%
+             {}%                   if hyphenrules found:
+             {\@tempcnta\@nameuse{l@\bbl at cl{hyphr}}}}}%
     \fi
   \fi
-  \bbl at ifunset{bbl at tempa}%       ie, relax or undefined
-    {\bbl at ifunset{l@#1}%         no hyphenrules found - fallback
-       {\bbl at exp{\\\adddialect\<l@#1>\language}}%
-       {}}%                      so, l@<lang> is ok - nothing to do
-    {\bbl at exp{\\\adddialect\<l@#1>\bbl at tempa}}}% found in opt list or ini
+  \bbl at ifunset{l@#1}%
+    {\ifnum\@tempcnta=\m at ne
+       \bbl at carg\adddialect{l@#1}\language
+     \else
+       \bbl at carg\adddialect{l@#1}\@tempcnta
+     \fi}%
+    {\ifnum\@tempcnta=\m at ne\else
+       \global\bbl at carg\chardef{l@#1}\@tempcnta
+     \fi}}
 %    \end{macrocode}
 %
 % The reader of |babel-...tex| files. We reset temporarily some
diff --git a/babel.ins b/babel.ins
index 94f0407..d8382a3 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{2023/01/08}
+\def\filedate{2023/01/11}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index bec130c..262fb36 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index af222e5..8752dea 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2023/01/08 v3.84.2976]
+\ProvidesFile{bbcompat.dtx}[2023/01/11 v3.84.2979]
 %</dtx>
 %
 %% File 'bbcompat.dtx'





More information about the latex3-commits mailing list.