[latex3-commits] [git/LaTeX3-latex3-babel] main: Fix: hebrew and a few other languages didn’t recognize provide=. (2472382)
Javier
email at dante.de
Mon Dec 13 19:18:45 CET 2021
Repository : https://github.com/latex3/babel
On branch : main
Link : https://github.com/latex3/babel/commit/2472382472c331233774b050ab46b0878088bed0
>---------------------------------------------------------------
commit 2472382472c331233774b050ab46b0878088bed0
Author: Javier <email at localhost>
Date: Mon Dec 13 19:18:45 2021 +0100
Fix: hebrew and a few other languages didn’t recognize provide=.
* The language loader has been refactored.
>---------------------------------------------------------------
2472382472c331233774b050ab46b0878088bed0
README.md | 10 ++-
babel.dtx | 166 +++++++++++++++++++++----------------------------
babel.ins | 2 +-
babel.pdf | Bin 858700 -> 859641 bytes
bbcompat.dtx | 2 +-
locale/bn/babel-bn.ini | 0
6 files changed, 83 insertions(+), 97 deletions(-)
diff --git a/README.md b/README.md
index bfb72cd..71dea36 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
-## Babel 3.67
+## Babel 3.67.2585
+
+(*Development.*)
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -46,6 +48,12 @@ respective authors.
### Summary of Latest changes
```
+3.68 2021-12-?? (dev)
+ * Fixes:
+ - Assamese, Bengali, Gujarati set incorrectly prehyphenchar.
+ - The syntax provide=* didn’t work with Hebrew and a few other
+ languages.
+
3.67 2021-11-29
* \IfBabelSelectorTF executes code conditionally based on the
selector type (select, foreign, etc.).
diff --git a/babel.dtx b/babel.dtx
index 666c1b1..66daa1b 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2021/11/29 v3.67 The Babel package]
+\ProvidesFile{babel.dtx}[2021/12/13 v3.67.2585 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -5118,8 +5118,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.67>>
-%<<date=2021/11/29>>
+%<<version=3.67.2585>>
+%<<date=2021/12/13>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -5896,16 +5896,6 @@ help from Bernd Raichle, for which I am grateful.
\fi
% \end{macrocode}
%
-% Make sure the language set with `main` is the last one.
-%
-% \begin{macrocode}
-\ifx\bbl at opt@main\@nnil\else
- \edef\bbl at language@opts{%
- \ifx\bbl at language@opts\@empty\else\bbl at language@opts,\fi
- \bbl at opt@main}
-\fi
-% \end{macrocode}
-%
% For |layout| an auxiliary macro is provided, available for packages
% and language styles. Optimization: if there is no |layout|, just do
% nothing.
@@ -10213,8 +10203,8 @@ help from Bernd Raichle, for which I am grateful.
\ifeof\bbl at readstream
\bbl at error
{There is no ini file for the requested language\\%
- (#1). Perhaps you misspelled it or your installation\\%
- is not complete.}%
+ (#1: \languagename). Perhaps you misspelled it or your\\%
+ installation is not complete.}%
{Fix the name or reinstall babel.}%
\else
% == Store ini data in \bbl at inidata ==
@@ -12133,102 +12123,87 @@ help from Bernd Raichle, for which I am grateful.
\fi
% \end{macrocode}
%
-%
% Recognizing global options in packages not having a closed set of
% them is not trivial, as for them to be processed they must be
% defined explicitly. So, package options not yet taken into
% account and stored in |bbl at language@opts| are assumed to be
% languages (note this list also contains the language given with
% |main|). If not declared above, the names of the option and the
-% file are the same.
+% file are the same. We first pre-process the class and package options
+% to determine the main language, which is processed in the third
+% ‘main’ pass, \textit{except} if all files are ldf \textit{and} there
+% is no |main| key. In the latter case, the traditional way to set the
+% main language is kept — the last loaded is the main language
+% (|\bbl at opt@main| is |\@nnil|.
%
% \begin{macrocode}
-\let\bbl at tempc\relax
-\bbl at foreach\bbl at language@opts{%
- \ifcase\bbl at iniflag % Default
- \bbl at ifunset{ds@#1}%
- {\DeclareOption{#1}{\bbl at load@language{#1}}}%
- {}%
- \or % provide=*
- \@gobble % case 2 same as 1
- \or % provide+=*
- \bbl at ifunset{ds@#1}%
- {\IfFileExists{#1.ldf}{}%
- {\IfFileExists{babel-#1.tex}{}{\@namedef{ds@#1}{}}}}%
- {}%
- \bbl at ifunset{ds@#1}%
- {\def\bbl at tempc{#1}%
- \DeclareOption{#1}{%
- \ifnum\bbl at iniflag>\@ne
- \bbl at ldfinit
- \babelprovide[import]{#1}%
- \bbl at afterldf{}%
- \else
- \bbl at load@language{#1}%
- \fi}}%
- {}%
- \or % provide*=*
- \def\bbl at tempc{#1}%
- \bbl at ifunset{ds@#1}%
- {\DeclareOption{#1}{%
- \bbl at ldfinit
- \babelprovide[import]{#1}%
- \bbl at afterldf{}}}%
- {}%
- \fi}
+\ifx\bbl at opt@main\@nnil
+ \ifnum\bbl at iniflag>\z@ % if all ldf's: set implicitly, no main pass
+ \let\bbl at tempb\@empty
+ \edef\bbl at tempa{\@classoptionslist,\bbl at language@opts}%
+ \bbl at foreach\bbl at tempa{\edef\bbl at tempb{#1,\bbl at tempb}}%
+ \bbl at foreach\bbl at tempb{% \bbl at tempb is a reversed list
+ \ifx\bbl at opt@main\@nnil % ie, if not yet assigned
+ \ifodd\bbl at iniflag % = *=
+ \IfFileExists{babel-#1.tex}{\def\bbl at opt@main{#1}}{}%
+ \else % n +=
+ \IfFileExists{#1.ldf}{\def\bbl at opt@main{#1}}{}%
+ \fi
+ \fi}%
+ \fi
+\fi
% \end{macrocode}
%
-% Now, we make sure an option is explicitly declared for any language
-% set as global option, by checking if an |ldf| exists. The previous
-% step was, in fact, somewhat redundant, but that way we minimize
-% accessing the file system just to see if the option could be a
-% language.
+% A few languages are still defined explicitly. They are stored in case
+% they are needed in the ‘main’ pass (the value can be |\relax|).
%
% \begin{macrocode}
-\let\bbl at tempb\@nnil
-\let\bbl at clsoptlst\@classoptionslist
-\bbl at foreach\@classoptionslist{%
+\ifx\bbl at opt@main\@nnil\else
+ \bbl at csarg\let{loadmain\expandafter}\csname ds@\bbl at opt@main\endcsname
+ \expandafter\let\csname ds@\bbl at opt@main\endcsname\relax
+\fi
+% \end{macrocode}
+%
+% Now define the corresponding loaders. With package options,
+% assume the language exists. With class options, check if the
+% option is a language.
+%
+%
+% \begin{macrocode}
+\bbl at foreach\bbl at language@opts{%
\bbl at ifunset{ds@#1}%
- {\IfFileExists{#1.ldf}%
- {\def\bbl at tempb{#1}%
+ {\ifnum\bbl at iniflag<\tw@ % 0 ø (other = ldf)
+ \DeclareOption{#1}{\bbl at load@language{#1}}%
+ \else % + * (other = ini)
\DeclareOption{#1}{%
- \ifnum\bbl at iniflag>\@ne
- \bbl at ldfinit
- \babelprovide[import]{#1}%
- \bbl at afterldf{}%
- \else
- \bbl at load@language{#1}%
- \fi}}%
- {\IfFileExists{babel-#1.tex}%
- {\def\bbl at tempb{#1}%
- \ifnum\bbl at iniflag>\z@
- \DeclareOption{#1}{%
- \ifnum\bbl at iniflag>\@ne
- \bbl at ldfinit
- \babelprovide[import]{#1}%
- \bbl at afterldf{}%
- \fi}%
- \fi}%
- {}}}%
+ \bbl at ldfinit
+ \babelprovide[import]{#1}%
+ \bbl at afterldf{}}%
+ \fi}%
{}}
+\bbl at foreach\@classoptionslist{%
+ \bbl at ifunset{ds@#1}%
+ {\ifnum\bbl at iniflag<\tw@ % 0 ø (other = ldf)
+ \IfFileExists{#1.ldf}%
+ {\DeclareOption{#1}{\bbl at load@language{#1}}}%
+ {}%
+ \else % + * (other = ini)
+ \IfFileExists{babel-#1.tex}%
+ {\DeclareOption{#1}{%
+ \bbl at ldfinit
+ \babelprovide[import]{#1}%
+ \bbl at afterldf{}}}%
+ {}%
+ \fi}%
+ {}}
% \end{macrocode}
%
-% If a main language has been set, store it for the third pass.
+% If a main language has been set, disable it here and delay it to the
+% ’main’ pass.
%
% \begin{macrocode}
-\ifnum\bbl at iniflag=\z@\else
- \ifx\bbl at opt@main\@nnil
- \ifx\bbl at tempc\relax
- \let\bbl at opt@main\bbl at tempb
- \else
- \let\bbl at opt@main\bbl at tempc
- \fi
- \fi
-\fi
\ifx\bbl at opt@main\@nnil\else
- \expandafter
- \let\expandafter\bbl at loadmain\csname ds@\bbl at opt@main\endcsname
- \expandafter\let\csname ds@\bbl at opt@main\endcsname\@empty
+ \DeclareOption{\bbl at opt@main}{}
\fi
% \end{macrocode}
%
@@ -12237,7 +12212,7 @@ help from Bernd Raichle, for which I am grateful.
% ignored.
%
% The options have to be processed in the order in which the user
-% specified them (except, of course, global options, which \LaTeX{}
+% specified them (except, of course, class options, which \LaTeX{}
% processes before):
%
% \begin{macrocode}
@@ -12291,8 +12266,11 @@ help from Bernd Raichle, for which I am grateful.
\fi
\bbl at afterldf{}%
\else % case 0,2
- \chardef\bbl at iniflag\z@ % Force ldf
- \expandafter\let\csname ds@\bbl at opt@main\endcsname\bbl at loadmain
+ \ifx\bbl at loadmain\relax
+ \DeclareOption{\bbl at opt@main}{\bbl at load@language{\bbl at opt@main}}
+ \else
+ \DeclareOption{\bbl at opt@main}{\bbl at loadmain}
+ \fi
\ExecuteOptions{\bbl at opt@main}
\DeclareOption*{}%
\ProcessOptions*
diff --git a/babel.ins b/babel.ins
index 1be32b2..b29dc22 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{2021/11/29}
+\def\filedate{2021/12/13}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/babel.pdf b/babel.pdf
index bf2f691..491402b 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 0b0d1c2..03e0c4a 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2021/11/29 v3.67]
+\ProvidesFile{bbcompat.dtx}[2021/12/13 v3.67.2585]
%</dtx>
%
%% File 'bbcompat.dtx'
More information about the latex3-commits
mailing list.