[latex3-commits] [git/LaTeX3-latex3-babel] main: Fix: transforms can now be activated at a second \babelprovide. (95cab36)
Javier
email at dante.de
Fri Oct 7 17:14:15 CEST 2022
Repository : https://github.com/latex3/babel
On branch : main
Link : https://github.com/latex3/babel/commit/95cab36d3e4a688a3d9483b36fdd6401880bdd3a
>---------------------------------------------------------------
commit 95cab36d3e4a688a3d9483b36fdd6401880bdd3a
Author: Javier <email at localhost>
Date: Fri Oct 7 17:14:15 2022 +0200
Fix: transforms can now be activated at a second \babelprovide.
>---------------------------------------------------------------
95cab36d3e4a688a3d9483b36fdd6401880bdd3a
README.md | 6 ++++-
babel.dtx | 83 +++++++++++++++++++++++++++++++++--------------------------
babel.ins | 2 +-
babel.pdf | Bin 885961 -> 886601 bytes
bbcompat.dtx | 2 +-
5 files changed, 54 insertions(+), 39 deletions(-)
diff --git a/README.md b/README.md
index 173be37..20dc86a 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.81
+## Babel 3.81.2883
**Development**
@@ -48,6 +48,10 @@ respective authors.
### Summary of latest changes
```
+3.82 (dev)
+ * Predefined transforms can be activated after the first
+ \babelprovide.
+
3.81 2022-10-04
* Tibetan line breaking and justification (lines padded with
trailing tshegs).
diff --git a/babel.dtx b/babel.dtx
index 3d8eddc..5476a19 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2022/10/04 v3.81 The Babel package]
+\ProvidesFile{babel.dtx}[2022/10/07 v3.81.2883 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>>
-%<<date=2022/10/04>>
+%<<version=3.81.2883>>
+%<<date=2022/10/07>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -5202,6 +5202,10 @@ help from Bernd Raichle, for which I am grateful.
{\def#1{#2}}%
{\expandafter\def\expandafter#1\expandafter{#1#2}}}
\def\bbl at xin@{\@expandtwoargs\in@}
+\def\bbl at carg#1#2{\expandafter#1\csname#2\endcsname}%
+\def\bbl at ncarg#1#2#3{\expandafter#1\expandafter#2\csname#3\endcsname}%
+\def\bbl at ccarg#1#2#3{%
+ \expandafter#1\csname#2\expandafter\endcsname\csname#3\endcsname}%
\def\bbl at csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}%
\def\bbl at cs#1{\csname bbl@#1\endcsname}
\def\bbl at cl#1{\csname bbl@#1@\languagename\endcsname}
@@ -10104,8 +10108,19 @@ help from Bernd Raichle, for which I am grateful.
{\bbl at pre@fs}%
{\bbl at post@fs}%
\fi
- % == Release saved transforms ==
- \bbl at release@transforms\relax % \relax closes the last item.
+ % == 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.
+ \fi
% == main ==
\ifx\bbl at KVP@main\@nnil % Restore only if not 'main'
\let\languagename\bbl at savelangname
@@ -10911,44 +10926,40 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\let\bbl at release@transforms\@empty
-\@namedef{bbl at inikv@transforms.prehyphenation}{%
- \bbl at transforms\babelprehyphenation}
-\@namedef{bbl at inikv@transforms.posthyphenation}{%
- \bbl at transforms\babelposthyphenation}
+\bbl at csarg\let{inikv at transforms.prehyphenation}\bbl at inikv
+\bbl at csarg\let{bbl at inikv@transforms.posthyphenation}\bbl at inikv
\def\bbl at transforms@aux#1#2#3#4,#5\relax{%
#1[#2]{#3}{#4}{#5}}
\begingroup % A hack. TODO. Don't require an specific order
\catcode`\%=12
\catcode`\&=14
\gdef\bbl at transforms#1#2#3{&%
- \ifx\bbl at KVP@transforms\@nnil\else
- \directlua{
- local str = [==[#2]==]
- str = str:gsub('%.%d+%.%d+$', '')
- tex.print([[\def\string\babeltempa{]] .. str .. [[}]])
- }&%
- \bbl at xin@{,\babeltempa,}{,\bbl at KVP@transforms,}&%
+ \directlua{
+ local str = [==[#2]==]
+ str = str:gsub('%.%d+%.%d+$', '')
+ tex.print([[\def\string\babeltempa{]] .. str .. [[}]])
+ }&%
+ \bbl at xin@{,\babeltempa,}{,\bbl at KVP@transforms,}&%
+ \ifin@
+ \in@{.0$}{#2$}&%
\ifin@
- \in@{.0$}{#2$}&%
- \ifin@
- \directlua{
- local str = string.match([[\bbl at KVP@transforms]],
- '%(([^%(]-)%)[^%)]-\babeltempa')
- if str == nil then
- tex.print([[\def\string\babeltempb{}]])
- else
- tex.print([[\def\string\babeltempb{,attribute=]] .. str .. [[}]])
- end
- }
- \toks@{#3}&%
- \bbl at exp{&%
- \\\g at addto@macro\\\bbl at release@transforms{&%
- \relax &% Closes previous \bbl at transforms@aux
- \\\bbl at transforms@aux
- \\#1{label=\babeltempa\babeltempb}{\languagename}{\the\toks@}}}&%
- \else
- \g at addto@macro\bbl at release@transforms{, {#3}}&%
- \fi
+ \directlua{% (\attribute) syntax
+ local str = string.match([[\bbl at KVP@transforms]],
+ '%(([^%(]-)%)[^%)]-\babeltempa')
+ if str == nil then
+ tex.print([[\def\string\babeltempb{}]])
+ else
+ tex.print([[\def\string\babeltempb{,attribute=]] .. str .. [[}]])
+ end
+ }
+ \toks@{#3}&%
+ \bbl at exp{&%
+ \\\g at addto@macro\\\bbl at release@transforms{&%
+ \relax &% Closes previous \bbl at transforms@aux
+ \\\bbl at transforms@aux
+ \\#1{label=\babeltempa\babeltempb}{\languagename}{\the\toks@}}}&%
+ \else
+ \g at addto@macro\bbl at release@transforms{, {#3}}&%
\fi
\fi}
\endgroup
diff --git a/babel.ins b/babel.ins
index a40cfd7..944c206 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/04}
+\def\filedate{2022/10/07}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/babel.pdf b/babel.pdf
index c667f52..11e1a6f 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 0bc850a..a874c0a 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/10/04 v3.81]
+\ProvidesFile{bbcompat.dtx}[2022/10/07 v3.81.2883]
%</dtx>
%
%% File 'bbcompat.dtx'
More information about the latex3-commits
mailing list.