[latex3-commits] [git/LaTeX3-latex3-babel] main: (wip) Auto-select encoding with pdftex+provide. (310a48e)

Javier email at dante.de
Thu Dec 8 09:06:31 CET 2022


Repository : https://github.com/latex3/babel
On branch  : main
Link       : https://github.com/latex3/babel/commit/310a48ecf71c61d4ee22bc0131a9e48b8b8cb74e

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

commit 310a48ecf71c61d4ee22bc0131a9e48b8b8cb74e
Author: Javier <email at localhost>
Date:   Thu Dec 8 09:06:31 2022 +0100

    (wip) Auto-select encoding with pdftex+provide.


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

310a48ecf71c61d4ee22bc0131a9e48b8b8cb74e
 README.md                 |   2 +-
 babel.dtx                 | 110 +++++++++++++++++++++++++++++++---------------
 babel.ins                 |   2 +-
 babel.pdf                 | Bin 898435 -> 899537 bytes
 bbcompat.dtx              |   2 +-
 locale/ar/babel-ar-DZ.ini |   2 +-
 locale/ar/babel-ar-EG.ini |   2 +-
 locale/ar/babel-ar-IQ.ini |   2 +-
 locale/ar/babel-ar-JO.ini |   2 +-
 locale/ar/babel-ar-LB.ini |   2 +-
 locale/ar/babel-ar-MA.ini |   2 +-
 locale/ar/babel-ar-PS.ini |   2 +-
 locale/ar/babel-ar-SA.ini |   2 +-
 locale/ar/babel-ar-SY.ini |   2 +-
 locale/ar/babel-ar-TN.ini |   2 +-
 locale/ce/babel-ce.ini    |   2 +-
 locale/chr/babel-chr.ini  |   2 +-
 locale/fa/babel-fa.ini    |   2 +-
 locale/he/babel-he.ini    |   2 +-
 19 files changed, 92 insertions(+), 52 deletions(-)

diff --git a/README.md b/README.md
index 9174a7a..b51fbea 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.83.2940
+## Babel 3.83.2945
 
 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 707c724..db0462d 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2022/12/03 v3.83.2940 The Babel package]
+\ProvidesFile{babel.dtx}[2022/12/08 v3.83.2945 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -839,12 +839,6 @@ text
   |\begin{finnish}|).
 \end{note}
 
-\begin{note}
-  Actually, there may be another advantage in the ‘short’ syntax
-  |\text|\m{tag}, namely, it is not affected by |\MakeUppercase| (while
-  |\foreignlanguage| is).
-\end{note}
-
 \Describe{\babelensure}{|[include=|\m{commands}|,exclude=|\m{commands}%
   |,fontenc=|\m{encoding}|]|\marg{language}}
 
@@ -2987,7 +2981,7 @@ in an expandable way even if something went wrong (for example, the
 locale currently active is undefined). For these cases, |localeinfo*|
 just returns an empty string instead of raising an error. Bear in mind
 that \babel{}, following the CLDR, may leave the region unset, which
-means |\getlanguageproperty*|, described below, is the preferred
+means |\getlocaleproperty*|, described below, is the preferred
 command, so that the existence of a field can be checked before. This
 also means building a string with the language and the region with
 |\localeinfo*{language.tab.bcp47}|\allowbreak |-|\allowbreak
@@ -3500,7 +3494,7 @@ corresponding language tags as selector names with:
 (You can deactivate it with |off|.) So, if |dutch| is one of the
 package (or class) options, you can write |\selectlanguage{nl}|. Note
 the language name does not change (in this example is still |dutch|),
-but you can get it with |\localeinfo| or |\getlanguageproperty|. It
+but you can get it with |\localeinfo| or |\getlocaleproperty|. It
 must be turned on explicitly for similar reasons to those explained
 above.
 
@@ -5200,8 +5194,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.83.2940>>
-%<<date=2022/12/03>>
+%<<version=3.83.2945>>
+%<<date=2022/12/08>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -10098,6 +10092,9 @@ help from Bernd Raichle, for which I am grateful.
     \ifx\bbl at tempb\@empty\else
       ,variant=\bbl at tempb
     \fi}%
+  % == engine specific extensions ==
+  % Defined in XXXbabel.def
+  \bbl at provide@extra{#2}%
   % == require.babel in ini ==
   % To load or reaload the babel-*.tex, if require.babel in ini
   \ifx\bbl at beforestart\relax\else  % But not in doc aux or body
@@ -10129,19 +10126,7 @@ help from Bernd Raichle, for which I am grateful.
       {\bbl at post@fs}%
   \fi
   % == transforms ==
-  \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
+  % > luababel.def
   % == main ==
   \ifx\bbl at KVP@main\@nnil  % Restore only if not 'main'
     \let\languagename\bbl at savelangname
@@ -11714,9 +11699,9 @@ help from Bernd Raichle, for which I am grateful.
 %
 %    \begin{macrocode}
      \ifx\@mkboth\markboth
-       \def\bbl at tempc{\let\@mkboth\markboth}
+       \def\bbl at tempc{\let\@mkboth\markboth}%
      \else
-       \def\bbl at tempc{}
+       \def\bbl at tempc{}%
      \fi
      \bbl at ifunset{markboth }\bbl at redefine\bbl at redefinerobust
      \markboth#1#2{%
@@ -11729,7 +11714,7 @@ help from Bernd Raichle, for which I am grateful.
        \bbl at ifblank{#2}%
          {\@temptokena{}}%
          {\@temptokena\expandafter{\bbl at tempb{#2}}}%
-       \bbl at exp{\\\org at markboth{\the\toks@}{\the\@temptokena}}}
+       \bbl at exp{\\\org at markboth{\the\toks@}{\the\@temptokena}}}%
        \bbl at tempc
      \fi}  % end ifbbl at single, end \IfBabelLayout
 %    \end{macrocode}
@@ -13308,14 +13293,12 @@ help from Bernd Raichle, for which I am grateful.
 \AddBabelHook{babel-fontspec}{beforestart}{\bbl at ckeckstdfonts}
 \DisableBabelHook{babel-fontspec}
 <@Font selection@>
-\input txtbabel.def
+\def\bbl at provide@extra#1{}
 %</xetex>
 %    \end{macrocode}
 %
 % \subsection{Layout}
 %
-% \textit{In progress.}
-%
 % Note elements like headlines and margins can be modified easily with
 % packages like \textsf{fancyhdr}, \textsf{typearea} or
 % \textsf{titleps}, and \textsf{geometry}.
@@ -13329,12 +13312,12 @@ help from Bernd Raichle, for which I am grateful.
 % which is the bidi model in both \pdftex{} and \xetex{}.
 %
 %    \begin{macrocode}
-%<*texxet>
+%<*xetex|texxet>
 \providecommand\bbl at provide@intraspace{}
 \bbl at trace{Redefinitions for bidi layout}
 \def\bbl at sspre@caption{%
   \bbl at exp{\everyhbox{\\\bbl at textdir\bbl at cs{wdir@\bbl at main@language}}}}
-\ifx\bbl at opt@layout\@nnil\endinput\fi  % No layout
+\ifx\bbl at opt@layout\@nnil\else % if layout=.. 
 \def\bbl at startskip{\ifcase\bbl at thepardir\leftskip\else\rightskip\fi}
 \def\bbl at endskip{\ifcase\bbl at thepardir\rightskip\else\leftskip\fi}
 \ifx\bbl at beforeforeign\leavevmode % A poor test for bidi=
@@ -13411,6 +13394,49 @@ help from Bernd Raichle, for which I am grateful.
    \def\@roman#1{\babelsublr{\ensureascii{\bbl at asciiroman#1}}}%
    \let\bbl at asciiRoman=\@Roman
    \def\@Roman#1{\babelsublr{\ensureascii{\bbl at asciiRoman#1}}}}{}
+\fi % end if layout
+%</xetex|texxet>
+%    \end{macrocode}
+%
+% \subsection{8-bit TeX}
+%
+% Which start just above, because some code is shared with \xetex. Now,
+% 8-bit specific stuff.
+%
+%    \begin{macrocode}
+%<*texxet>
+\def\bbl at provide@extra#1{%
+  % == auto-select encoding == WIP. TODO: Consider main T2A -> T1
+  \bbl at ifunset{bbl at encoding@#1}%
+    {\def\@elt##1{,##1,}%
+     \edef\bbl at tempe{\expandafter\@gobbletwo\@fontenc at load@list}%
+     \count@\z@
+     \bbl at foreach\bbl at tempe{%
+       \def\bbl at tempd{##1}%  Save last declared
+       \advance\count@\@ne}%
+     \ifnum\count@>\@ne
+       \getlocaleproperty*\bbl at tempa{#1}{identification/encodings}%
+       \ifx\bbl at tempa\relax \let\bbl at tempa\@empty \fi
+       \bbl at replace\bbl at tempa{ }{,}%
+       \global\bbl at csarg\let{encoding@#1}\@empty
+       \bbl at xin@{,\bbl at tempd,}{,\bbl at tempa,}%
+       \ifin@\else % if main encoding included in ini, do nothing
+         \let\bbl at tempb\relax
+         \bbl at foreach\bbl at tempa{%
+           \ifx\bbl at tempb\relax
+             \bbl at xin@{,##1,}{,\bbl at tempe,}%
+             \ifin@\def\bbl at tempb{##1}\fi
+           \fi}%
+         \ifx\bbl at tempb\relax\else
+           \bbl at exp{\global\<bbl at add>\<extras#1>{\<bbl at encoding@#1>}%
+           \gdef\<bbl at encoding@#1>{%
+             \\\babel at save\\\f at encoding
+             \\\fontencoding{\bbl at tempb}%
+             \\\selectfont}}%
+         \fi
+       \fi
+     \fi}%
+ {}}
 %</texxet>
 %    \end{macrocode}
 %
@@ -14845,10 +14871,10 @@ end
           \bbl at add\normalfont{\bbl at eqnodir}%
           \ifnum\bbl at eqnpos=\@ne
             \def\@eqnnum{%
-             \setbox\z@\hbox{\bbl at eqnum}%
-             \hbox to0.01pt{\hss\hbox to\displaywidth{\box\z@\hss}}}%
+              \setbox\z@\hbox{\bbl at eqnum}%
+              \hbox to0.01pt{\hss\hbox to\displaywidth{\box\z@\hss}}}%
           \else
-             \let\@eqnnum\bbl at eqnum
+            \let\@eqnnum\bbl at eqnum
           \fi
         \fi}
       % Hack. YA luatex bug?:
@@ -14923,7 +14949,21 @@ end
       \fi
     \fi}
 \fi
+\def\bbl at provide@extra#1{%
+  % == 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.}{}%
+        \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}
 \ifx\bbl at opt@layout\@nnil\endinput\fi  % if no layout
+%
 \ifnum\bbl at bidimode>\z@
   \def\bbl at nextfake#1{%  non-local changes, use always inside a group!
     \bbl at exp{%
diff --git a/babel.ins b/babel.ins
index 10e3cb8..7c06e66 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/12/03}
+\def\filedate{2022/12/08}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 7e932cf..f5a979a 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 4118d37..221c9dc 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/12/03 v3.83.2940]
+\ProvidesFile{bbcompat.dtx}[2022/12/08 v3.83.2945]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/locale/ar/babel-ar-DZ.ini b/locale/ar/babel-ar-DZ.ini
index 02f07a1..6a128c8 100644
--- a/locale/ar/babel-ar-DZ.ini
+++ b/locale/ar/babel-ar-DZ.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ar/babel-ar-EG.ini b/locale/ar/babel-ar-EG.ini
index 26f4c31..4d0f7f1 100644
--- a/locale/ar/babel-ar-EG.ini
+++ b/locale/ar/babel-ar-EG.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ar/babel-ar-IQ.ini b/locale/ar/babel-ar-IQ.ini
index bf81451..15ba20f 100644
--- a/locale/ar/babel-ar-IQ.ini
+++ b/locale/ar/babel-ar-IQ.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ar/babel-ar-JO.ini b/locale/ar/babel-ar-JO.ini
index a3249a4..7a10683 100644
--- a/locale/ar/babel-ar-JO.ini
+++ b/locale/ar/babel-ar-JO.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ar/babel-ar-LB.ini b/locale/ar/babel-ar-LB.ini
index d80fd91..cf0933f 100644
--- a/locale/ar/babel-ar-LB.ini
+++ b/locale/ar/babel-ar-LB.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ar/babel-ar-MA.ini b/locale/ar/babel-ar-MA.ini
index b93c38d..fb74dd8 100644
--- a/locale/ar/babel-ar-MA.ini
+++ b/locale/ar/babel-ar-MA.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ar/babel-ar-PS.ini b/locale/ar/babel-ar-PS.ini
index dde90f0..84c6536 100644
--- a/locale/ar/babel-ar-PS.ini
+++ b/locale/ar/babel-ar-PS.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ar/babel-ar-SA.ini b/locale/ar/babel-ar-SA.ini
index 2a289e4..7c352cf 100644
--- a/locale/ar/babel-ar-SA.ini
+++ b/locale/ar/babel-ar-SA.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ar/babel-ar-SY.ini b/locale/ar/babel-ar-SY.ini
index ed70704..4170ec3 100644
--- a/locale/ar/babel-ar-SY.ini
+++ b/locale/ar/babel-ar-SY.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ar/babel-ar-TN.ini b/locale/ar/babel-ar-TN.ini
index 4e3d2cc..93f79cd 100644
--- a/locale/ar/babel-ar-TN.ini
+++ b/locale/ar/babel-ar-TN.ini
@@ -24,7 +24,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LAE
 derivate = no
 
 [captions]
diff --git a/locale/ce/babel-ce.ini b/locale/ce/babel-ce.ini
index 081fa85..12960f7 100644
--- a/locale/ce/babel-ce.ini
+++ b/locale/ce/babel-ce.ini
@@ -22,7 +22,7 @@ script.name = Cyrillic
 script.tag.bcp47 = Cyrl
 script.tag.opentype = cyrl
 level = 1
-encodings = 
+encodings = T2A
 derivate = no
 
 [captions]
diff --git a/locale/chr/babel-chr.ini b/locale/chr/babel-chr.ini
index 109ac13..203fee1 100644
--- a/locale/chr/babel-chr.ini
+++ b/locale/chr/babel-chr.ini
@@ -22,7 +22,7 @@ script.name = Cherokee
 script.tag.bcp47 = Cher
 script.tag.opentype = cher
 level = 1
-encodings = 
+encodings = LCH
 derivate = no
 
 [captions]
diff --git a/locale/fa/babel-fa.ini b/locale/fa/babel-fa.ini
index 2e9e078..2c8618a 100644
--- a/locale/fa/babel-fa.ini
+++ b/locale/fa/babel-fa.ini
@@ -23,7 +23,7 @@ script.name = Arabic
 script.tag.bcp47 = Arab
 script.tag.opentype = arab
 level = 1
-encodings = 
+encodings = LFE
 derivate = no
 
 [captions]
diff --git a/locale/he/babel-he.ini b/locale/he/babel-he.ini
index d377bfd..ab9d470 100644
--- a/locale/he/babel-he.ini
+++ b/locale/he/babel-he.ini
@@ -23,7 +23,7 @@ script.name = Hebrew
 script.tag.bcp47 = Hebr
 script.tag.opentype = hebr
 level = 1
-encodings = 
+encodings = LHE H8
 derivate = no
 
 [captions]





More information about the latex3-commits mailing list.