texlive[56531] Master/texmf-dist: babel (3oct20)

commits+karl at tug.org commits+karl at tug.org
Sat Oct 3 23:50:00 CEST 2020


Revision: 56531
          http://tug.org/svn/texlive?view=revision&revision=56531
Author:   karl
Date:     2020-10-03 23:50:00 +0200 (Sat, 03 Oct 2020)
Log Message:
-----------
babel (3oct20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/babel/README.md
    trunk/Master/texmf-dist/doc/latex/babel/babel.pdf
    trunk/Master/texmf-dist/source/latex/babel/babel.dtx
    trunk/Master/texmf-dist/source/latex/babel/babel.ins
    trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx
    trunk/Master/texmf-dist/source/latex/babel/locale.zip
    trunk/Master/texmf-dist/tex/generic/babel/babel.def
    trunk/Master/texmf-dist/tex/generic/babel/babel.sty
    trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg
    trunk/Master/texmf-dist/tex/generic/babel/locale/km/babel-km.ini
    trunk/Master/texmf-dist/tex/generic/babel/locale/lo/babel-lo.ini
    trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-th.ini
    trunk/Master/texmf-dist/tex/generic/babel/luababel.def
    trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
    trunk/Master/texmf-dist/tex/generic/babel/xebabel.def

Modified: trunk/Master/texmf-dist/doc/latex/babel/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/babel/README.md	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/doc/latex/babel/README.md	2020-10-03 21:50:00 UTC (rev 56531)
@@ -1,4 +1,4 @@
-## Babel 3.48
+## Babel 3.49
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -7,11 +7,11 @@
 
 The latest stable version is available on <https://ctan.org/pkg/babel>.
 
-Changes in version 3.48 are described in:
+Changes in version 3.49 are described in:
 
-https://github.com/latex3/babel/wiki/What's-new-in-babel-3.48
+https://github.com/latex3/babel/wiki/What's-new-in-babel-3.49
 
-Included is a set of ini files for about 200 languages. 
+Included is a set of ini files for about 250 languages. 
 
 The best way to install and/or update it is with the help of package
 managers.
@@ -42,8 +42,14 @@
 respective authors.
 
 ### Latest changes
-
 ```
+3.49   2020-10-03
+       - Allow standard LaTeX syntax to recognize locales based on ini
+         files in the most common cases.
+       - frenchspacing is set with ini files.
+       - Fixes:
+         - layout.lists=off didn't work (#94)
+       
 3.48   2020-09-01
        - New (tentative) tools to customize some labels (like chapters
          in CJK and Hungarian). 
@@ -53,6 +59,7 @@
          - \babelshorthand didn't work with some dialects (#91).
          - \selectlanguage and otherlanguage raised an error inside
            tabular.
+https://github.com/latex3/babel/wiki/What's-new-in-babel-3.48       
 
 3.47   2020-07-13
        - Fixes:

Modified: trunk/Master/texmf-dist/doc/latex/babel/babel.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/babel/babel.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/babel.dtx	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.dtx	2020-10-03 21:50:00 UTC (rev 56531)
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2020/09/01 v3.48 The Babel package]
+\ProvidesFile{babel.dtx}[2020/10/03 v3.49 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -256,7 +256,7 @@
 free to fork it and make pull requests. If you are the author of a
 package, send to me a few test files which I'll add to mine, so that
 possible issues can be caught in the development phase.
-  
+
 \item[\sffamily\color{messages}It doesn't work for me!] You can ask for
 help in some forums like \textsf{tex.stackexchange}, but if you have
 found a bug, I strongly beg you to report it in
@@ -272,7 +272,7 @@
 The alternative way based on |ini| files, which complements the
 previous one (it does \textit{not} replace it, although it is still
 necessary in some languages), is described below; go to \ref{inifiles}.
-  
+
 \item[\sffamily\color{messages}I don’t like manuals. I prefer sample
   files.] This manual contains lots of examples and tips, but in GitHub
   there are many
@@ -287,9 +287,14 @@
 In most cases, a single language is required, and then all you need in
 \LaTeX{} is to load the package using its standard mechanism for this
 purpose, namely, passing that language as an optional argument. In
-addition, you may want to set the font and input encodings.
+addition, you may want to set the font and input encodings. 
 
-Many languages are compatible with \textsf{xetex} and \textsf{luatex}.
+Another approach is making the language a global option in order to let
+other packages detect and use it. This is the standard way in \LaTeX{}
+for an option – in this case a language – to be recognized by several
+packages.
+
+Many languages are compatible with \textsf{xetex} and \textsf{luatex},.
 With them you can use \babel{} to localize the documents. When these
 engines are used, the Latin script is covered by default in current
 \LaTeX{} (provided the document encoding is UTF-8), because the font
@@ -319,6 +324,15 @@
 
 \end{document}
 \end{verbatim}
+
+Now consider something like:
+\begin{verbatim}
+_\documentclass[french]{article}_
+\usepackage{babel}
+\usepackage{varioref}
+\end{verbatim}
+With this setting, the package \texttt{varioref} will also see
+the option |french| and will be able to use it.
 \end{example}
 
 \begin{example}
@@ -330,11 +344,11 @@
 
 \setengine{luatex/xetex}
 \begin{verbatim}
-\documentclass{article}
+_\documentclass[russian]{article}_
 
-_\usepackage[russian]{babel}_
+\usepackage{babel}
 
-\babelfont{rm}{DejaVu Serif}
+_\babelfont{rm}{DejaVu Serif}_
 
 \begin{document}
 
@@ -363,17 +377,6 @@
 Make sure you set the encoding actually used by your editor.
 \end{troubleshooting}
 
-Another approach is making the language (\Lopt{french} in the example)
-a global option in order to let other packages detect and use it:
-\begin{verbatim}
-_\documentclass[french]{article}_
-\usepackage{babel}
-\usepackage{varioref}
-\end{verbatim}
-
-In this last example, the package \texttt{varioref} will also see
-the option and will be able to use it.
-
 \begin{note}
   Because of the way \babel{} has evolved, ``language'' can refer to
   (1) a set of hyphenation patterns as preloaded into the format, (2)
@@ -547,8 +550,8 @@
   A trivial document is:
 \setengine{luatex/xetex}
 \begin{verbatim}
-\documentclass{article}
-\usepackage[english]{babel}
+\documentclass[english]{article}
+\usepackage{babel}
 
 \babelfont[russian]{rm}{FreeSerif}
 
@@ -1301,9 +1304,8 @@
 Most of them set the date, and many also the captions (Unicode and
 LICR). They will be evolving with the time to add more features
 (something to keep in mind if backward compatibility is important). The
-following section shows how to make use of them currently (by means of
-|\babelprovide|), but a higher interface, based on package options, in
-under study. In other words, |\babelprovide| is mainly meant
+following section shows how to make use of them by means of
+|\babelprovide|. In other words, |\babelprovide| is mainly meant
 for auxiliary tasks, and as alternative when the |ldf|, for some
 reason, does work as expected.
 
@@ -1319,7 +1321,7 @@
 \usepackage{babel}
 _\babelprovide[import, main]{georgian}_
 
-\babelfont{rm}{DejaVu Sans}
+\babelfont{rm}[Renderer=Harfbuzz]{DejaVu Sans}
 
 \begin{document}
 
@@ -1334,6 +1336,36 @@
 \endgroup
 \end{example}
 
+\New{3.49} Alternatively, you can tell babel to load all or some
+languages passed as options with |\babelprovide| and not from the |ldf|
+file in a few few typical cases. Thus, |provide=*| means ‘load the main
+language with the |\babelprovide| mechanism instead of the |ldf| file’
+applying the basic features, which in this case means |import,| |main|.
+There are (currently) three options:
+\begin{itemize}
+\item |provide=*| is the option just explained, for the main language;
+\item |provide+=*| is the same for additional languages (the main
+  language is still the |ldf| file);
+\item |provide*=*| is the same for all languages, ie, main and
+  additional.
+\end{itemize}
+
+\begin{example}
+  The preamble in the previous example can be more compactly written
+  as:
+\begin{verbatim}
+\documentclass{book}
+\usepackage[_georgian, provide=*_]{babel}
+\babelfont{rm}[Renderer=Harfbuzz]{DejaVu Sans}
+\end{verbatim}
+Or also:
+\begin{verbatim}
+\documentclass[_georgian_]{book}
+\usepackage[_provide=*_]{babel}
+\babelfont{rm}[Renderer=Harfbuzz]{DejaVu Sans}
+\end{verbatim}
+\end{example}
+
 \begin{note}
   The \texttt{ini} files just define and set some parameters, but the
   corresponding behavior is not always implemented. Also, there are
@@ -1389,8 +1421,8 @@
   be used in conjunction with the |ldf| for |japanese|, because the
   following piece of code loads \textsf{luatexja}:
 \begin{verbatim}
-\documentclass{ltjbook}
-\usepackage[japanese]{babel}
+\documentclass[japanese]{ltjbook}
+\usepackage{babel}
 \end{verbatim}
 \item[Latin, Greek, Cyrillic] Combining chars with the default
  \luatex{} font renderer might be wrong; on then other hand, with the
@@ -4744,8 +4776,8 @@
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.48>>
-%<<date=2020/09/01>>
+%<<version=3.49>>
+%<<date=2020/10/03>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -4895,12 +4927,15 @@
 %
 % \begin{macro}{\bbl at ifblank}
 %   A tool from \textsf{url}, by Donald Arseneau, which tests if a
-%   string is empty or space.
+%   string is empty or space. The companion macros tests if a macro is
+%   defined with some `real' value, ie, not |\relax| and not empty,
 %
 %    \begin{macrocode}
 \def\bbl at ifblank#1{%
   \bbl at ifblank@i#1\@nil\@nil\@secondoftwo\@firstoftwo\@nil}
 \long\def\bbl at ifblank@i#1#2\@nil#3#4#5\@nil{#4}
+\def\bbl at ifset#1#2#3{% 
+  \bbl at ifunset{#1}{#3}{\bbl at exp{\\\bbl at ifblank{#1}}{#3}{#2}}}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -5040,6 +5075,25 @@
   \else
     \let\bbl at esphack\@empty
   \fi}
+%    \end{macrocode}
+%
+% Another hackish tool, to apply case changes inside a protected
+% macros. It's based on the internal |\let|'s made by |\MakeUppercase|
+% and |\MakeLowercase| between things like |\oe| and |\OE|.
+%
+%    \begin{macrocode}
+\def\bbl at cased{%
+  \ifx\oe\OE
+    \expandafter\in@\expandafter
+      {\expandafter\OE\expandafter}\expandafter{\oe}%
+    \ifin@
+      \bbl at afterelse\expandafter\MakeUppercase
+    \else  
+      \bbl at afterfi\expandafter\MakeLowercase
+    \fi  
+  \else
+    \expandafter\@firstofone
+  \fi}
 %<</Basic macros>>
 %    \end{macrocode}
 %
@@ -5273,17 +5327,24 @@
 %    \begin{macrocode}
 \bbl at trace{key=value and another general options}
 \bbl at csarg\let{tempa\expandafter}\csname opt at babel.sty\endcsname
-\def\bbl at tempb#1.#2{%
+\def\bbl at tempb#1.#2{%  Remove trailing dot
    #1\ifx\@empty#2\else,\bbl at afterfi\bbl at tempb#2\fi}%
-\def\bbl at tempd#1.#2\@nnil{%
+\def\bbl at tempd#1.#2\@nnil{%  TODO. Refactor lists?
   \ifx\@empty#2%
     \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1}%
   \else
-    \in@{=}{#1}\ifin@
-      \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1.#2}%
+    \in@{,provide,}{,#1,}%
+    \ifin@
+      \edef\bbl at tempc{%
+        \ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1.\bbl at tempb#2}%
     \else
-      \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1}%
-      \bbl at csarg\edef{mod@#1}{\bbl at tempb#2}%
+      \in@{=}{#1}%
+      \ifin@
+        \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1.#2}%
+      \else    
+        \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1}%
+        \bbl at csarg\edef{mod@#1}{\bbl at tempb#2}%
+      \fi
     \fi
   \fi}
 \let\bbl at tempc\@empty
@@ -5307,9 +5368,17 @@
 \DeclareOption{silent}{}
 \DeclareOption{mono}{}
 \DeclareOption{shorthands=off}{\bbl at tempa shorthands=\bbl at tempa}
+\chardef\bbl at iniflag\z@
+\DeclareOption{provide=*}{\chardef\bbl at iniflag\@ne}    % main -> +1
+\DeclareOption{provide+=*}{\chardef\bbl at iniflag\tw@}   % add = 2
+\DeclareOption{provide*=*}{\chardef\bbl at iniflag\thr@@} % add + main
 % Don't use. Experimental. TODO.
 \newif\ifbbl at single
 \DeclareOption{selectors=off}{\bbl at singletrue}
+\DeclareOption{provide@=*}{} % autoload with cat @=letter
+\makeatother
+\DeclareOption{provide@=*}{} % autoload with cat @=other
+\makeatletter
 <@More package options@>
 %    \end{macrocode}
 %
@@ -6278,7 +6347,7 @@
       \AtEndOfPackage{%
         \EnableBabelHook{babel-bidi}%
         \ifx\fontspec\@undefined
-          \usepackage{fontspec}% bidi needs fontspec
+          \bbl at loadfontspec % bidi needs fontspec
         \fi
         \usepackage#1{bidi}}%
     \fi}
@@ -6287,10 +6356,8 @@
       \bbl at tentative{bidi=bidi}
       \bbl at loadxebidi{}
     \or
-      \bbl at tentative{bidi=bidi-r}
       \bbl at loadxebidi{[rldocument]}
     \or
-      \bbl at tentative{bidi=bidi-l}
       \bbl at loadxebidi{}
     \fi
   \fi
@@ -6566,7 +6633,7 @@
     {\bbl at error{%
        Unknown option `\CurrentOption'. Either you misspelled it\\%
        or the language definition file \CurrentOption.ldf was not found}{%
-       Valid options are: shorthands=, KeepShorthandsActive,\\%
+       Valid options are, among others: shorthands=, KeepShorthandsActive,\\%
        activeacute, activegrave, noconfigs, safe=, main=, math=\\%
        headfoot=, strings=, config=, hyphenmap=, or a language name.}}}
 %    \end{macrocode}
@@ -6578,9 +6645,9 @@
 %
 %    \begin{macrocode}
 \def\bbl at try@load at lang#1#2#3{%
-    \IfFileExists{\CurrentOption.ldf}%
-      {\bbl at load@language{\CurrentOption}}%
-      {#1\bbl at load@language{#2}#3}}
+  \IfFileExists{\CurrentOption.ldf}%
+    {\bbl at load@language{\CurrentOption}}%
+    {#1\bbl at load@language{#2}#3}}
 \DeclareOption{afrikaans}{\bbl at try@load at lang{}{dutch}{}}
 \DeclareOption{hebrew}{%
   \input{rlbabel.def}%
@@ -6631,28 +6698,64 @@
 % file are the same.
 %
 %    \begin{macrocode}
-\bbl at for\bbl at tempa\bbl at language@opts{%
-  \bbl at ifunset{ds@\bbl at tempa}%
-    {\edef\bbl at tempb{%
-       \noexpand\DeclareOption
-         {\bbl at tempa}%
-         {\noexpand\bbl at load@language{\bbl at tempa}}}%
-     \bbl at tempb}%
-     \@empty}
+\let\bbl at tempc\relax
+\bbl at foreach\bbl at language@opts{%
+  \ifcase\bbl at iniflag
+    \bbl at ifunset{ds@#1}%
+      {\DeclareOption{#1}{\bbl at load@language{#1}}}%
+      {}%
+  \or
+    \@gobble % case 2 same as 1
+  \or
+    \bbl at ifunset{ds@#1}%
+      {\IfFileExists{#1.ldf}{}%
+        {\IfFileExists{babel-#1.tex}{}{\DeclareOption{#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
+    \def\bbl at tempc{#1}%
+    \bbl at ifunset{ds@#1}%
+      {\DeclareOption{#1}{%
+         \bbl at ldfinit
+         \babelprovide[import]{#1}%
+         \bbl at afterldf{}}}%
+      {}%
+  \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 accesing the file system just to see if the
+% that way we minimize accessing the file system just to see if the
 % option could be a language.
 %
 %    \begin{macrocode}
+\let\bbl at tempb\@nnil
 \bbl at foreach\@classoptionslist{%
   \bbl at ifunset{ds@#1}%
-    {\IfFileExists{#1.ldf}%
-      {\DeclareOption{#1}{\bbl at load@language{#1}}}%
-      {}}%
+    {\IfFileExists{#1.ldf}{}%
+      {\IfFileExists{babel-#1.tex}{}{\DeclareOption{#1}{}}}}%
+    {}%
+  \bbl at ifunset{ds@#1}%
+    {\def\bbl at tempb{#1}%
+     \DeclareOption{#1}{%
+       \ifnum\bbl at iniflag>\@ne
+         \bbl at ldfinit
+         \babelprovide[import]{#1}%
+         \bbl at afterldf{}%
+       \else
+         \bbl at load@language{#1}%
+       \fi}}%
     {}}
 %    \end{macrocode}
 %
@@ -6659,10 +6762,19 @@
 %    If a main language has been set, store it for the third 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
-  \DeclareOption{\bbl at opt@main}{}
+  \expandafter\let\csname ds@\bbl at opt@main\endcsname\@empty
 \fi
 %    \end{macrocode}
 %
@@ -6708,10 +6820,17 @@
       option. Reported}%
   \fi
 \else
-  \DeclareOption{\bbl at opt@main}{\bbl at loadmain}
-  \ExecuteOptions{\bbl at opt@main}
-  \DeclareOption*{}
-  \ProcessOptions*
+  \ifodd\bbl at iniflag  % case 1,3
+    \bbl at ldfinit
+    \let\CurrentOption\bbl at opt@main
+    \bbl at exp{\\\babelprovide[import,main]{\bbl at opt@main}}
+    \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
+    \DeclareOption*{}%
+    \ProcessOptions*
+  \fi
 \fi
 \def\AfterBabelLanguage{%
   \bbl at error
@@ -7229,7 +7348,7 @@
       \let\bbl at select@type\z@
       \expandafter\bbl at switch\expandafter{\languagename}%
     \fi}}
-\def\babel at aux#1#2{%
+\def\babel at aux#1#2{% TODO. See how to avoid undefined nil's
   \select at language{#1}%
   \bbl at foreach\BabelContentsFiles{%
     \@writefile{##1}{\babel at toc{#1}{#2}}}}% %% TODO - ok in plain?
@@ -8757,7 +8876,8 @@
 %    A user level command to change the language from which shorthands
 %    are used. Unfortunately, \babel{} currently does not keep track
 %    of defined groups, and therefore there is no way to catch a
-%    possible change in casing [TODO. Unclear].
+%    possible change in casing to fix it in the same way languages names
+%    are fixed. [TODO].
 %
 %    \begin{macrocode}
 \def\languageshorthands#1{\def\language at group{#1}}
@@ -9218,6 +9338,12 @@
     \let\bbl at nonfrenchspacing\nonfrenchspacing
   \fi}
 \let\bbl at nonfrenchspacing\nonfrenchspacing
+%
+\let\bbl at elt\relax
+\edef\bbl at fs@chars{%
+  \bbl at elt{\string.}\@m{3000}\bbl at elt{\string?}\@m{3000}%
+  \bbl at elt{\string!}\@m{3000}\bbl at elt{\string:}\@m{2000}%
+  \bbl at elt{\string;}\@m{1500}\bbl at elt{\string,}\@m{1250}}
 %    \end{macrocode}
 %
 %  \end{macro}
@@ -9643,13 +9769,12 @@
 % order as defined.  Finally, the string is set.
 %
 %    \begin{macrocode}
-\def\bbl at setstring#1#2{%
+\def\bbl at setstring#1#2{% eg, \prefacename{<string>}
   \bbl at forlang\bbl at tempa{%
     \edef\bbl at LC{\bbl at tempa\bbl at stripslash#1}%
     \bbl at ifunset{\bbl at LC}% eg, \germanchaptername
-      {\global\expandafter  % TODO - con \bbl at exp ?
-       \bbl at add\csname\bbl at G\bbl at tempa\expandafter\endcsname\expandafter
-         {\expandafter\bbl at scset\expandafter#1\csname\bbl at LC\endcsname}}%
+      {\bbl at exp{%
+         \global\\\bbl at add\<\bbl at G\bbl at tempa>{\\\bbl at scset\\#1\<\bbl at LC>}}}%
       {}%
     \def\BabelString{#2}%
     \bbl at usehooks{stringprocess}{}%
@@ -10625,47 +10750,6 @@
   \fi}
 %    \end{macrocode}
 %
-% A tool to define the macros for native digits from the list provided 
-% in the |ini| file. Somewhat convoluted because there are 10 digits, 
-% but only 9 arguments in \TeX. Non-digits characters are kept. The
-% first macro is the generic “localized” command.
-%
-%    \begin{macrocode}
-% TODO. Merge with \localenumeral:
-% \newcommand\localedigits{\@nameuse{\languagename digits}}
-\def\bbl at setdigits#1#2#3#4#5{%
-  \bbl at exp{%
-    \def\<\languagename digits>####1{%       ie, \langdigits
-      \<bbl at digits@\languagename>####1\\\@nil}%
-    \let\<bbl at cntr@digits@\languagename>\<\languagename digits>%
-    \def\<\languagename counter>####1{%      ie, \langcounter
-      \\\expandafter\<bbl at counter@\languagename>%
-      \\\csname c@####1\endcsname}%
-    \def\<bbl at counter@\languagename>####1{% ie, \bbl at counter@lang
-      \\\expandafter\<bbl at digits@\languagename>%
-      \\\number####1\\\@nil}}%
-  \def\bbl at tempa##1##2##3##4##5{%
-    \bbl at exp{%    Wow, quite a lot of hashes! :-(
-      \def\<bbl at digits@\languagename>########1{%
-       \\\ifx########1\\\@nil              % ie, \bbl at digits@lang
-       \\\else
-         \\\ifx0########1#1%
-         \\\else\\\ifx1########1#2%
-         \\\else\\\ifx2########1#3%
-         \\\else\\\ifx3########1#4%
-         \\\else\\\ifx4########1#5%
-         \\\else\\\ifx5########1##1%
-         \\\else\\\ifx6########1##2%
-         \\\else\\\ifx7########1##3%
-         \\\else\\\ifx8########1##4%
-         \\\else\\\ifx9########1##5%
-         \\\else########1%
-         \\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi
-         \\\expandafter\<bbl at digits@\languagename>%
-       \\\fi}}}%
-  \bbl at tempa}
-%    \end{macrocode}
-%
 % Depending on whether or not the language exists, we define two macros.
 %
 %    \begin{macrocode}
@@ -10702,14 +10786,43 @@
     \fi
   \bbl at endcommands
   \bbl at load@basic{#1}%
+  % == hyphenmins == (only if new)
   \bbl at exp{%
     \gdef\<#1hyphenmins>{%
       {\bbl at ifunset{bbl at lfthm@#1}{2}{\bbl at cs{lfthm@#1}}}%
       {\bbl at ifunset{bbl at rgthm@#1}{3}{\bbl at cs{rgthm@#1}}}}}%
+  % == hyphenrules ==
   \bbl at provide@hyphens{#1}%
+  % == frenchspacing == (only if new)
+  \bbl at ifunset{bbl at frspc@#1}{}%
+    {\edef\bbl at tempa{\bbl at cl{frspc}}%
+     \edef\bbl at tempa{\expandafter\@car\bbl at tempa\@nil}%
+     \if u\bbl at tempa          % do nothing
+     \else\if n\bbl at tempa     % non french
+       \expandafter\bbl at add\csname extras#1\endcsname{%
+         \let\bbl at elt\bbl at fs@elt at i
+         \bbl at fs@chars}%
+     \else\if y\bbl at tempa     % french
+       \expandafter\bbl at add\csname extras#1\endcsname{%
+         \let\bbl at elt\bbl at fs@elt at ii
+         \bbl at fs@chars}%
+     \fi\fi\fi}%
+  %
   \ifx\bbl at KVP@main\@nil\else
      \expandafter\main at language\expandafter{#1}%
   \fi}
+% A couple of macros used above, to avoid hashes #######...
+\def\bbl at fs@elt at i#1#2#3{%
+  \ifnum\sfcode`#1=#2\relax
+    \babel at savevariable{\sfcode`#1}%
+    \sfcode`#1=#3\relax
+  \fi}%
+\def\bbl at fs@elt at ii#1#2#3{%
+  \ifnum\sfcode`#1=#3\relax
+    \babel at savevariable{\sfcode`#1}%
+    \sfcode`#1=#2\relax
+  \fi}%
+%
 \def\bbl at provide@renew#1{%
   \ifx\bbl at KVP@captions\@nil\else
     \StartBabelCommands*{#1}{captions}%
@@ -10730,6 +10843,16 @@
 % more), while captions and dates are left out. But it may happen some
 % data has been loaded before automatically, so we first discard the
 % saved values.
+\def\bbl at linebreak@export{%
+  \bbl at exportkey{lnbrk}{typography.linebreaking}{h}%
+  \bbl at exportkey{hyphr}{typography.hyphenrules}{}%
+  \bbl at exportkey{lfthm}{typography.lefthyphenmin}{2}%
+  \bbl at exportkey{rgthm}{typography.righthyphenmin}{3}%         
+  \bbl at exportkey{prehc}{typography.prehyphenchar}{}%
+  \bbl at exportkey{hyotl}{typography.hyphenate.other.locale}{}%
+  \bbl at exportkey{hyots}{typography.hyphenate.other.script}{}%
+  \bbl at exportkey{intsp}{typography.intraspace}{}%
+  \bbl at exportkey{chrng}{characters.ranges}{}}
 \def\bbl at load@basic#1{%
   \bbl at ifunset{bbl at inidata@\languagename}{}%
     {\getlocaleproperty\bbl at tempa{\languagename}{identification/load.level}%
@@ -10739,21 +10862,12 @@
   \bbl at ifunset{bbl at lname@#1}% 
     {\def\BabelBeforeIni##1##2{%
        \begingroup
-         \catcode`\[=12 \catcode`\]=12 \catcode`\==12
-         \catcode`\;=12 \catcode`\|=12 \catcode`\%=14
          \let\bbl at ini@captions at aux\@gobbletwo
          \def\bbl at inidate ####1.####2.####3.####4\relax ####5####6{}%
          \bbl at read@ini{##1}0%
-         \bbl at exportkey{prehc}{typography.prehyphenchar}{}%
-         \bbl at exportkey{lnbrk}{typography.linebreaking}{h}%
-         \bbl at exportkey{lfthm}{typography.lefthyphenmin}{2}%
-         \bbl at exportkey{rgthm}{typography.righthyphenmin}{3}%         
-         \bbl at exportkey{hyphr}{typography.hyphenrules}{}%
-         \bbl at exportkey{hyotl}{typography.hyphenate.other.locale}{}%
-         \bbl at exportkey{hyots}{typography.hyphenate.other.script}{}%
-         \bbl at exportkey{intsp}{typography.intraspace}{}%
-         \bbl at exportkey{chrng}{characters.ranges}{}%
+         \bbl at linebreak@export
          \bbl at exportkey{dgnat}{numbers.digits.native}{}%
+         \bbl at exportkey{frspc}{typography.frenchspacing}{u}% unset
          \ifx\bbl at initoload\relax\endinput\fi
        \endgroup}%
      \begingroup       % boxed, to avoid extra spaces:
@@ -10831,8 +10945,10 @@
          \\\bbl at elt{\bbl at section}{\bbl at tempa}{\the\toks@}}}%
      \expandafter\bbl at inireader\bbl at tempa=#2\@@}%
     {}}%
-\def\bbl at read@ini#1#2{%
-  \bbl at csarg\edef{lini@\languagename}{#1}%
+\def\bbl at fetch@ini#1#2{%
+  \bbl at exp{\def\\\bbl at inidata{%
+    \\\bbl at elt{identification}{tag.ini}{#1}%
+    \\\bbl at elt{identification}{load.level}{#2}}}%
   \openin\bbl at readstream=babel-#1.ini
   \ifeof\bbl at readstream
     \bbl at error
@@ -10841,14 +10957,8 @@
        is not complete.}%
       {Fix the name or reinstall babel.}%
   \else
-    \bbl at exp{\def\\\bbl at inidata{%
-      \\\bbl at elt{identification}{tag.ini}{#1}%
-      \\\bbl at elt{identification}{load.level}{#2}}}%
-    \let\bbl at section\@empty
-    \let\bbl at savestrings\@empty
-    \let\bbl at savetoday\@empty
-    \let\bbl at savedate\@empty
-    \let\bbl at inireader\bbl at iniskip
+    \catcode`\[=12 \catcode`\]=12 \catcode`\==12
+    \catcode`\;=12 \catcode`\|=12 \catcode`\%=14
     \bbl at info{Importing
                 \ifcase#2 \or font and identification \or basic \fi
                 data for \languagename\\%
@@ -10862,18 +10972,26 @@
         \expandafter\bbl at iniline\bbl at line\bbl at iniline
       \fi
     \repeat
-    \bbl at foreach\bbl at renewlist{%
-      \bbl at ifunset{bbl at renew@##1}{}{\bbl at inisec[##1]\@@}}%
-    \global\let\bbl at renewlist\@empty
-    % Ends last section. See \bbl at inisec
-    \def\bbl at elt##1##2{\bbl at inireader##1=##2\@@}%
-    \bbl at cs{renew@\bbl at section}%
-    \global\bbl at csarg\let{renew@\bbl at section}\relax
-    \bbl at cs{secpost@\bbl at section}%  
-    \bbl at csarg{\global\expandafter\let}{inidata@\languagename}\bbl at inidata
-    \bbl at exp{\\\bbl at add@list\\\bbl at ini@loaded{\languagename}}%
-    \bbl at toglobal\bbl at ini@loaded
   \fi}
+\def\bbl at read@ini#1#2{%
+  \bbl at csarg\edef{lini@\languagename}{#1}%
+  \let\bbl at section\@empty
+  \let\bbl at savestrings\@empty
+  \let\bbl at savetoday\@empty
+  \let\bbl at savedate\@empty
+  \let\bbl at inireader\bbl at iniskip
+  \bbl at fetch@ini{#1}{#2}%
+  \bbl at foreach\bbl at renewlist{%
+    \bbl at ifunset{bbl at renew@##1}{}{\bbl at inisec[##1]\@@}}%
+  \global\let\bbl at renewlist\@empty
+  % Ends last section. See \bbl at inisec
+  \def\bbl at elt##1##2{\bbl at inireader##1=##2\@@}%
+  \bbl at cs{renew@\bbl at section}%
+  \global\bbl at csarg\let{renew@\bbl at section}\relax
+  \bbl at cs{secpost@\bbl at section}%  
+  \bbl at csarg{\global\expandafter\let}{inidata@\languagename}\bbl at inidata
+  \bbl at exp{\\\bbl at add@list\\\bbl at ini@loaded{\languagename}}%
+  \bbl at toglobal\bbl at ini@loaded}
 \def\bbl at iniline#1\bbl at iniline{%
   \@ifnextchar[\bbl at inisec{\@ifnextchar;\bbl at iniskip\bbl at inipreread}#1\@@}% ]
 %    \end{macrocode}
@@ -10880,10 +10998,9 @@
 %
 % The special cases for comment lines and sections are handled by the
 % two following commands. In sections, we provide the posibility to
-% take extra actions at the end or at the start (TODO - but note the last
-% section is not ended). By default, key=val pairs are ignored. The
-% |secpost| ``hook'' is used only by `identification', while |secpre|
-% only by |date.gregorian.licr|.
+% take extra actions at the end or at the start. By default, key=val
+% pairs are ignored. The |secpost| ``hook'' is used only by
+% `identification', while |secpre| only by |date.gregorian.licr|.
 %
 %    \begin{macrocode}
 \def\bbl at iniskip#1\@@{}%      if starts with ;
@@ -11023,18 +11140,10 @@
     \bbl at csarg{\global\expandafter\let}{cntr@#1@\languagename}\bbl at tempa
   \fi}
 \def\bbl at after@ini{%
-  \bbl at exportkey{lfthm}{typography.lefthyphenmin}{2}%
-  \bbl at exportkey{rgthm}{typography.righthyphenmin}{3}%
-  \bbl at exportkey{prehc}{typography.prehyphenchar}{}%
-  \bbl at exportkey{lnbrk}{typography.linebreaking}{h}%
-  \bbl at exportkey{hyphr}{typography.hyphenrules}{}%
-  \bbl at exportkey{hyotl}{typography.hyphenate.other.locale}{}%
-  \bbl at exportkey{hyots}{typography.hyphenate.other.script}{}%
-  \bbl at exportkey{intsp}{typography.intraspace}{}%
-  \bbl at exportkey{jstfy}{typography.justify}{w}%
-  \bbl at exportkey{chrng}{characters.ranges}{}%
+  \bbl at linebreak@export
   \bbl at exportkey{dgnat}{numbers.digits.native}{}%
   \bbl at exportkey{rqtex}{identification.require.babel}{}%
+  \bbl at exportkey{frspc}{typography.frenchspacing}{u}% unset
   \bbl at toglobal\bbl at savetoday
   \bbl at toglobal\bbl at savedate}
 %    \end{macrocode}
@@ -11227,18 +11336,6 @@
 % Arguments are _not_ protected.
 \let\bbl at calendar\@empty
 \DeclareRobustCommand\localedate[1][]{\bbl at localedate{#1}}
-\def\bbl at cased{%  TODO. Move
-  \ifx\oe\OE
-    \expandafter\in@\expandafter
-      {\expandafter\OE\expandafter}\expandafter{\oe}%
-    \ifin@
-      \bbl at afterelse\expandafter\MakeUppercase
-    \else  
-      \bbl at afterfi\expandafter\MakeLowercase
-    \fi  
-  \else
-    \expandafter\@firstofone
-  \fi}
 \def\bbl at localedate#1#2#3#4{%
   \begingroup
     \ifx\@empty#1\@empty\else
@@ -11374,8 +11471,6 @@
         \fi}}%
   \fi
   \bbl at csarg\bbl at toglobal{lsys@#1}}
-\def\bbl at ifset#1#2#3{%   TODO. Move to the correct place.
-  \bbl at ifunset{#1}{#3}{\bbl at exp{\\\bbl at ifblank{#1}}{#3}{#2}}}
 \def\bbl at xenohyph@d{%
   \bbl at ifset{bbl at prehc@\languagename}%
     {\ifnum\hyphenchar\font=\defaulthyphenchar
@@ -11410,8 +11505,6 @@
   \def\BabelBeforeIni##1##2{%
     \begingroup
       \bbl at add\bbl at secpost@identification{\closein\bbl at readstream }%
-      \catcode`\[=12 \catcode`\]=12 \catcode`\==12
-      \catcode`\;=12 \catcode`\|=12 \catcode`\%=14
       \bbl at read@ini{##1}1%    
       \endinput          % babel- .tex may contain onlypreamble's
     \endgroup}%            boxed, to avoid extra spaces:
@@ -11418,6 +11511,45 @@
   {\bbl at input@texini{#1}}}
 %    \end{macrocode}
 %
+% A tool to define the macros for native digits from the list provided 
+% in the |ini| file. Somewhat convoluted because there are 10 digits, 
+% but only 9 arguments in \TeX. Non-digits characters are kept. The
+% first macro is the generic “localized” command.
+%
+%    \begin{macrocode}
+\def\bbl at setdigits#1#2#3#4#5{%
+  \bbl at exp{%
+    \def\<\languagename digits>####1{%       ie, \langdigits
+      \<bbl at digits@\languagename>####1\\\@nil}%
+    \let\<bbl at cntr@digits@\languagename>\<\languagename digits>%
+    \def\<\languagename counter>####1{%      ie, \langcounter
+      \\\expandafter\<bbl at counter@\languagename>%
+      \\\csname c@####1\endcsname}%
+    \def\<bbl at counter@\languagename>####1{% ie, \bbl at counter@lang
+      \\\expandafter\<bbl at digits@\languagename>%
+      \\\number####1\\\@nil}}%
+  \def\bbl at tempa##1##2##3##4##5{%
+    \bbl at exp{%    Wow, quite a lot of hashes! :-(
+      \def\<bbl at digits@\languagename>########1{%
+       \\\ifx########1\\\@nil              % ie, \bbl at digits@lang
+       \\\else
+         \\\ifx0########1#1%
+         \\\else\\\ifx1########1#2%
+         \\\else\\\ifx2########1#3%
+         \\\else\\\ifx3########1#4%
+         \\\else\\\ifx4########1#5%
+         \\\else\\\ifx5########1##1%
+         \\\else\\\ifx6########1##2%
+         \\\else\\\ifx7########1##3%
+         \\\else\\\ifx8########1##4%
+         \\\else\\\ifx9########1##5%
+         \\\else########1%
+         \\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi
+         \\\expandafter\<bbl at digits@\languagename>%
+       \\\fi}}}%
+  \bbl at tempa}
+%    \end{macrocode}
+%
 % Alphabetic counters must be converted from a space separated list to
 % an |\ifcase| structure.
 %
@@ -11594,7 +11726,7 @@
   \bbl at adjust@layout{\let\@tabular\bbl at OL@@tabular}}
 \@namedef{bbl at ADJ@layout.lists at on}{%
   \bbl at adjust@layout{\let\list\bbl at NL@list}}
-\@namedef{bbl at ADJ@layout.lists at on}{%
+\@namedef{bbl at ADJ@layout.lists at off}{%
   \bbl at adjust@layout{\let\list\bbl at OL@list}}
 \@namedef{bbl at ADJ@hyphenation.extra at on}{%
   \bbl at activateposthyphen}
@@ -12051,9 +12183,35 @@
 % |bbl at font| replaces hardcoded font names inside |\..family| by the
 % corresponding macro |\..default|.
 %
+% At the time of this writing, \textsf{fontspec} shows a warning about
+% there are languages not available, which some people think refers to
+% \babel{}, even if there is nothing wrong. Here is hack to patch
+% \textsf{fontspec} to avoid the misleading message, which is replaced
+% ba a more explanatory one.
+%
 %    \begin{macrocode}
 %<<*Font selection>>
 \bbl at trace{Font handling with fontspec}
+\ifx\ExplSyntaxOn\@undefined\else
+  \ExplSyntaxOn
+  \catcode`\ =10
+  \def\bbl at loadfontspec{%
+    \usepackage{fontspec}%
+    \expandafter
+    \def\csname msg~text~>~fontspec/language-not-exist\endcsname##1##2##3##4{%
+      Font '\l_fontspec_fontname_tl' is using the\\%
+      default features for language '##1'.\\%
+      That's usually fine, because many languages\\%
+      require no specific features, but if the output is\\%
+      not as expected, consider selecting another font.}
+    \expandafter
+    \def\csname msg~text~>~fontspec/no-script\endcsname##1##2##3##4{%
+      Font '\l_fontspec_fontname_tl' is using the\\%
+      default features for script '##2'.\\%
+      That's not always wrong, but if the output is\\%
+      not as expected, consider selecting another font.}}
+  \ExplSyntaxOff
+\fi
 \@onlypreamble\babelfont
 \newcommand\babelfont[2][]{%  1=langs/scripts 2=fam
   \bbl at foreach{#1}{%
@@ -12065,7 +12223,7 @@
   \edef\bbl at tempa{#1}%
   \def\bbl at tempb{#2}%  Used by \bbl at bblfont
   \ifx\fontspec\@undefined
-    \usepackage{fontspec}%
+    \bbl at loadfontspec
   \fi
   \EnableBabelHook{babel-fontspec}% Just calls \bbl at switchfont
   \bbl at bblfont}
@@ -12210,7 +12368,7 @@
   \let\bbl at mapselect\relax
   \let\bbl at temp@fam#4%       eg, '\rmfamily', to be restored below
   \let#4\@empty      %       Make sure \renewfontfamily is valid
-  \bbl at exp{% 
+  \bbl at exp{%
     \let\\\bbl at temp@pfam\<\bbl at stripslash#4\space>% eg, '\rmfamily '
     \<keys_if_exist:nnF>{fontspec-opentype}{Script/\bbl at cl{sname}}%
       {\\\newfontscript{\bbl at cl{sname}}{\bbl at cl{sotf}}}%
@@ -13729,6 +13887,9 @@
       if not u.find(patt, '()', nil, true) then
         patt = '()' .. patt .. '()'
       end
+      patt = string.gsub(patt, '%(%)%^', '^()')
+      patt = string.gsub(patt, '%$%(%)', '()$')
+      texio.write('***************' .. patt)
       patt = u.gsub(patt, '{(.)}', 
                 function (n)
                   return '%' .. (tonumber(n) and (tonumber(n)+1) or n)

Modified: trunk/Master/texmf-dist/source/latex/babel/babel.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/babel.ins	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.ins	2020-10-03 21:50:00 UTC (rev 56531)
@@ -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{2020/09/01}
+\def\filedate{2020/10/03}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 

Modified: trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2020-10-03 21:50:00 UTC (rev 56531)
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2020/09/01 v3.48]
+\ProvidesFile{bbcompat.dtx}[2020/10/03 v3.49]
 %</dtx>
 %
 %% File 'bbcompat.dtx'

Modified: trunk/Master/texmf-dist/source/latex/babel/locale.zip
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.def	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.def	2020-10-03 21:50:00 UTC (rev 56531)
@@ -39,7 +39,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{babel.def}[2020/09/01 3.48 Babel common definitions]
+\ProvidesFile{babel.def}[2020/10/03 3.49 Babel common definitions]
 \ifx\AtBeginDocument\@undefined  % TODO. change test.
     % == Code for plain ==
 \def\@empty{}
@@ -397,8 +397,8 @@
 \fi
 \countdef\last at language=19  % TODO. why? remove?
 \def\addlanguage{\csname newlanguage\endcsname}
-\def\bbl at version{3.48}
-\def\bbl at date{2020/09/01}
+\def\bbl at version{3.49}
+\def\bbl at date{2020/10/03}
 \def\adddialect#1#2{%
   \global\chardef#1#2\relax
   \bbl at usehooks{adddialect}{{#1}{#2}}%
@@ -614,7 +614,7 @@
       \let\bbl at select@type\z@
       \expandafter\bbl at switch\expandafter{\languagename}%
     \fi}}
-\def\babel at aux#1#2{%
+\def\babel at aux#1#2{% TODO. See how to avoid undefined nil's
   \select at language{#1}%
   \bbl at foreach\BabelContentsFiles{%
     \@writefile{##1}{\babel at toc{#1}{#2}}}}% %% TODO - ok in plain?
@@ -950,6 +950,8 @@
 \def\bbl at ifblank#1{%
   \bbl at ifblank@i#1\@nil\@nil\@secondoftwo\@firstoftwo\@nil}
 \long\def\bbl at ifblank@i#1#2\@nil#3#4#5\@nil{#4}
+\def\bbl at ifset#1#2#3{%
+  \bbl at ifunset{#1}{#3}{\bbl at exp{\\\bbl at ifblank{#1}}{#3}{#2}}}
 \def\bbl at forkv#1#2{%
   \def\bbl at kvcmd##1##2##3{#2}%
   \bbl at kvnext#1,\@nil,}
@@ -1038,6 +1040,18 @@
   \else
     \let\bbl at esphack\@empty
   \fi}
+\def\bbl at cased{%
+  \ifx\oe\OE
+    \expandafter\in@\expandafter
+      {\expandafter\OE\expandafter}\expandafter{\oe}%
+    \ifin@
+      \bbl at afterelse\expandafter\MakeUppercase
+    \else
+      \bbl at afterfi\expandafter\MakeLowercase
+    \fi
+  \else
+    \expandafter\@firstofone
+  \fi}
 \bbl at trace{Compatibility with language.def}
 \ifx\bbl at languages\@undefined
   \ifx\directlua\@undefined
@@ -1685,6 +1699,11 @@
     \let\bbl at nonfrenchspacing\nonfrenchspacing
   \fi}
 \let\bbl at nonfrenchspacing\nonfrenchspacing
+\let\bbl at elt\relax
+\edef\bbl at fs@chars{%
+  \bbl at elt{\string.}\@m{3000}\bbl at elt{\string?}\@m{3000}%
+  \bbl at elt{\string!}\@m{3000}\bbl at elt{\string:}\@m{2000}%
+  \bbl at elt{\string;}\@m{1500}\bbl at elt{\string,}\@m{1250}}
 \bbl at trace{Short tags}
 \def\babeltags#1{%
   \edef\bbl at tempa{\zap at space#1 \@empty}%
@@ -1928,13 +1947,12 @@
   \endgroup
   \bbl at scafter}
 \let\bbl at endcommands\EndBabelCommands
-\def\bbl at setstring#1#2{%
+\def\bbl at setstring#1#2{% eg, \prefacename{<string>}
   \bbl at forlang\bbl at tempa{%
     \edef\bbl at LC{\bbl at tempa\bbl at stripslash#1}%
     \bbl at ifunset{\bbl at LC}% eg, \germanchaptername
-      {\global\expandafter  % TODO - con \bbl at exp ?
-       \bbl at add\csname\bbl at G\bbl at tempa\expandafter\endcsname\expandafter
-         {\expandafter\bbl at scset\expandafter#1\csname\bbl at LC\endcsname}}%
+      {\bbl at exp{%
+         \global\\\bbl at add\<\bbl at G\bbl at tempa>{\\\bbl at scset\\#1\<\bbl at LC>}}}%
       {}%
     \def\BabelString{#2}%
     \bbl at usehooks{stringprocess}{}%
@@ -2504,37 +2522,6 @@
     \let\languagename\bbl at savelangname
     \chardef\localeid\bbl at savelocaleid\relax
   \fi}
-\def\bbl at setdigits#1#2#3#4#5{%
-  \bbl at exp{%
-    \def\<\languagename digits>####1{%       ie, \langdigits
-      \<bbl at digits@\languagename>####1\\\@nil}%
-    \let\<bbl at cntr@digits@\languagename>\<\languagename digits>%
-    \def\<\languagename counter>####1{%      ie, \langcounter
-      \\\expandafter\<bbl at counter@\languagename>%
-      \\\csname c@####1\endcsname}%
-    \def\<bbl at counter@\languagename>####1{% ie, \bbl at counter@lang
-      \\\expandafter\<bbl at digits@\languagename>%
-      \\\number####1\\\@nil}}%
-  \def\bbl at tempa##1##2##3##4##5{%
-    \bbl at exp{%    Wow, quite a lot of hashes! :-(
-      \def\<bbl at digits@\languagename>########1{%
-       \\\ifx########1\\\@nil              % ie, \bbl at digits@lang
-       \\\else
-         \\\ifx0########1#1%
-         \\\else\\\ifx1########1#2%
-         \\\else\\\ifx2########1#3%
-         \\\else\\\ifx3########1#4%
-         \\\else\\\ifx4########1#5%
-         \\\else\\\ifx5########1##1%
-         \\\else\\\ifx6########1##2%
-         \\\else\\\ifx7########1##3%
-         \\\else\\\ifx8########1##4%
-         \\\else\\\ifx9########1##5%
-         \\\else########1%
-         \\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi
-         \\\expandafter\<bbl at digits@\languagename>%
-       \\\fi}}}%
-  \bbl at tempa}
 \def\bbl at provide@new#1{%
   \@namedef{date#1}{}% marks lang exists - required by \StartBabelCommands
   \@namedef{extras#1}{}%
@@ -2568,14 +2555,41 @@
     \fi
   \bbl at endcommands
   \bbl at load@basic{#1}%
+  % == hyphenmins == (only if new)
   \bbl at exp{%
     \gdef\<#1hyphenmins>{%
       {\bbl at ifunset{bbl at lfthm@#1}{2}{\bbl at cs{lfthm@#1}}}%
       {\bbl at ifunset{bbl at rgthm@#1}{3}{\bbl at cs{rgthm@#1}}}}}%
+  % == hyphenrules ==
   \bbl at provide@hyphens{#1}%
+  % == frenchspacing == (only if new)
+  \bbl at ifunset{bbl at frspc@#1}{}%
+    {\edef\bbl at tempa{\bbl at cl{frspc}}%
+     \edef\bbl at tempa{\expandafter\@car\bbl at tempa\@nil}%
+     \if u\bbl at tempa          % do nothing
+     \else\if n\bbl at tempa     % non french
+       \expandafter\bbl at add\csname extras#1\endcsname{%
+         \let\bbl at elt\bbl at fs@elt at i
+         \bbl at fs@chars}%
+     \else\if y\bbl at tempa     % french
+       \expandafter\bbl at add\csname extras#1\endcsname{%
+         \let\bbl at elt\bbl at fs@elt at ii
+         \bbl at fs@chars}%
+     \fi\fi\fi}%
+  %
   \ifx\bbl at KVP@main\@nil\else
      \expandafter\main at language\expandafter{#1}%
   \fi}
+\def\bbl at fs@elt at i#1#2#3{%
+  \ifnum\sfcode`#1=#2\relax
+    \babel at savevariable{\sfcode`#1}%
+    \sfcode`#1=#3\relax
+  \fi}%
+\def\bbl at fs@elt at ii#1#2#3{%
+  \ifnum\sfcode`#1=#3\relax
+    \babel at savevariable{\sfcode`#1}%
+    \sfcode`#1=#2\relax
+  \fi}%
 \def\bbl at provide@renew#1{%
   \ifx\bbl at KVP@captions\@nil\else
     \StartBabelCommands*{#1}{captions}%
@@ -2592,6 +2606,16 @@
   \fi
   % == hyphenrules ==
   \bbl at provide@hyphens{#1}}
+\def\bbl at linebreak@export{%
+  \bbl at exportkey{lnbrk}{typography.linebreaking}{h}%
+  \bbl at exportkey{hyphr}{typography.hyphenrules}{}%
+  \bbl at exportkey{lfthm}{typography.lefthyphenmin}{2}%
+  \bbl at exportkey{rgthm}{typography.righthyphenmin}{3}%
+  \bbl at exportkey{prehc}{typography.prehyphenchar}{}%
+  \bbl at exportkey{hyotl}{typography.hyphenate.other.locale}{}%
+  \bbl at exportkey{hyots}{typography.hyphenate.other.script}{}%
+  \bbl at exportkey{intsp}{typography.intraspace}{}%
+  \bbl at exportkey{chrng}{characters.ranges}{}}
 \def\bbl at load@basic#1{%
   \bbl at ifunset{bbl at inidata@\languagename}{}%
     {\getlocaleproperty\bbl at tempa{\languagename}{identification/load.level}%
@@ -2601,21 +2625,12 @@
   \bbl at ifunset{bbl at lname@#1}%
     {\def\BabelBeforeIni##1##2{%
        \begingroup
-         \catcode`\[=12 \catcode`\]=12 \catcode`\==12
-         \catcode`\;=12 \catcode`\|=12 \catcode`\%=14
          \let\bbl at ini@captions at aux\@gobbletwo
          \def\bbl at inidate ####1.####2.####3.####4\relax ####5####6{}%
          \bbl at read@ini{##1}0%
-         \bbl at exportkey{prehc}{typography.prehyphenchar}{}%
-         \bbl at exportkey{lnbrk}{typography.linebreaking}{h}%
-         \bbl at exportkey{lfthm}{typography.lefthyphenmin}{2}%
-         \bbl at exportkey{rgthm}{typography.righthyphenmin}{3}%
-         \bbl at exportkey{hyphr}{typography.hyphenrules}{}%
-         \bbl at exportkey{hyotl}{typography.hyphenate.other.locale}{}%
-         \bbl at exportkey{hyots}{typography.hyphenate.other.script}{}%
-         \bbl at exportkey{intsp}{typography.intraspace}{}%
-         \bbl at exportkey{chrng}{characters.ranges}{}%
+         \bbl at linebreak@export
          \bbl at exportkey{dgnat}{numbers.digits.native}{}%
+         \bbl at exportkey{frspc}{typography.frenchspacing}{u}% unset
          \ifx\bbl at initoload\relax\endinput\fi
        \endgroup}%
      \begingroup       % boxed, to avoid extra spaces:
@@ -2681,8 +2696,10 @@
          \\\bbl at elt{\bbl at section}{\bbl at tempa}{\the\toks@}}}%
      \expandafter\bbl at inireader\bbl at tempa=#2\@@}%
     {}}%
-\def\bbl at read@ini#1#2{%
-  \bbl at csarg\edef{lini@\languagename}{#1}%
+\def\bbl at fetch@ini#1#2{%
+  \bbl at exp{\def\\\bbl at inidata{%
+    \\\bbl at elt{identification}{tag.ini}{#1}%
+    \\\bbl at elt{identification}{load.level}{#2}}}%
   \openin\bbl at readstream=babel-#1.ini
   \ifeof\bbl at readstream
     \bbl at error
@@ -2691,14 +2708,8 @@
        is not complete.}%
       {Fix the name or reinstall babel.}%
   \else
-    \bbl at exp{\def\\\bbl at inidata{%
-      \\\bbl at elt{identification}{tag.ini}{#1}%
-      \\\bbl at elt{identification}{load.level}{#2}}}%
-    \let\bbl at section\@empty
-    \let\bbl at savestrings\@empty
-    \let\bbl at savetoday\@empty
-    \let\bbl at savedate\@empty
-    \let\bbl at inireader\bbl at iniskip
+    \catcode`\[=12 \catcode`\]=12 \catcode`\==12
+    \catcode`\;=12 \catcode`\|=12 \catcode`\%=14
     \bbl at info{Importing
                 \ifcase#2 \or font and identification \or basic \fi
                 data for \languagename\\%
@@ -2712,18 +2723,26 @@
         \expandafter\bbl at iniline\bbl at line\bbl at iniline
       \fi
     \repeat
-    \bbl at foreach\bbl at renewlist{%
-      \bbl at ifunset{bbl at renew@##1}{}{\bbl at inisec[##1]\@@}}%
-    \global\let\bbl at renewlist\@empty
-    % Ends last section. See \bbl at inisec
-    \def\bbl at elt##1##2{\bbl at inireader##1=##2\@@}%
-    \bbl at cs{renew@\bbl at section}%
-    \global\bbl at csarg\let{renew@\bbl at section}\relax
-    \bbl at cs{secpost@\bbl at section}%
-    \bbl at csarg{\global\expandafter\let}{inidata@\languagename}\bbl at inidata
-    \bbl at exp{\\\bbl at add@list\\\bbl at ini@loaded{\languagename}}%
-    \bbl at toglobal\bbl at ini@loaded
   \fi}
+\def\bbl at read@ini#1#2{%
+  \bbl at csarg\edef{lini@\languagename}{#1}%
+  \let\bbl at section\@empty
+  \let\bbl at savestrings\@empty
+  \let\bbl at savetoday\@empty
+  \let\bbl at savedate\@empty
+  \let\bbl at inireader\bbl at iniskip
+  \bbl at fetch@ini{#1}{#2}%
+  \bbl at foreach\bbl at renewlist{%
+    \bbl at ifunset{bbl at renew@##1}{}{\bbl at inisec[##1]\@@}}%
+  \global\let\bbl at renewlist\@empty
+  % Ends last section. See \bbl at inisec
+  \def\bbl at elt##1##2{\bbl at inireader##1=##2\@@}%
+  \bbl at cs{renew@\bbl at section}%
+  \global\bbl at csarg\let{renew@\bbl at section}\relax
+  \bbl at cs{secpost@\bbl at section}%
+  \bbl at csarg{\global\expandafter\let}{inidata@\languagename}\bbl at inidata
+  \bbl at exp{\\\bbl at add@list\\\bbl at ini@loaded{\languagename}}%
+  \bbl at toglobal\bbl at ini@loaded}
 \def\bbl at iniline#1\bbl at iniline{%
   \@ifnextchar[\bbl at inisec{\@ifnextchar;\bbl at iniskip\bbl at inipreread}#1\@@}% ]
 \def\bbl at iniskip#1\@@{}%      if starts with ;
@@ -2842,18 +2861,10 @@
     \bbl at csarg{\global\expandafter\let}{cntr@#1@\languagename}\bbl at tempa
   \fi}
 \def\bbl at after@ini{%
-  \bbl at exportkey{lfthm}{typography.lefthyphenmin}{2}%
-  \bbl at exportkey{rgthm}{typography.righthyphenmin}{3}%
-  \bbl at exportkey{prehc}{typography.prehyphenchar}{}%
-  \bbl at exportkey{lnbrk}{typography.linebreaking}{h}%
-  \bbl at exportkey{hyphr}{typography.hyphenrules}{}%
-  \bbl at exportkey{hyotl}{typography.hyphenate.other.locale}{}%
-  \bbl at exportkey{hyots}{typography.hyphenate.other.script}{}%
-  \bbl at exportkey{intsp}{typography.intraspace}{}%
-  \bbl at exportkey{jstfy}{typography.justify}{w}%
-  \bbl at exportkey{chrng}{characters.ranges}{}%
+  \bbl at linebreak@export
   \bbl at exportkey{dgnat}{numbers.digits.native}{}%
   \bbl at exportkey{rqtex}{identification.require.babel}{}%
+  \bbl at exportkey{frspc}{typography.frenchspacing}{u}% unset
   \bbl at toglobal\bbl at savetoday
   \bbl at toglobal\bbl at savedate}
 \ifcase\bbl at engine
@@ -3012,18 +3023,6 @@
 \fi
 \let\bbl at calendar\@empty
 \DeclareRobustCommand\localedate[1][]{\bbl at localedate{#1}}
-\def\bbl at cased{%  TODO. Move
-  \ifx\oe\OE
-    \expandafter\in@\expandafter
-      {\expandafter\OE\expandafter}\expandafter{\oe}%
-    \ifin@
-      \bbl at afterelse\expandafter\MakeUppercase
-    \else
-      \bbl at afterfi\expandafter\MakeLowercase
-    \fi
-  \else
-    \expandafter\@firstofone
-  \fi}
 \def\bbl at localedate#1#2#3#4{%
   \begingroup
     \ifx\@empty#1\@empty\else
@@ -3142,8 +3141,6 @@
         \fi}}%
   \fi
   \bbl at csarg\bbl at toglobal{lsys@#1}}
-\def\bbl at ifset#1#2#3{%   TODO. Move to the correct place.
-  \bbl at ifunset{#1}{#3}{\bbl at exp{\\\bbl at ifblank{#1}}{#3}{#2}}}
 \def\bbl at xenohyph@d{%
   \bbl at ifset{bbl at prehc@\languagename}%
     {\ifnum\hyphenchar\font=\defaulthyphenchar
@@ -3167,12 +3164,41 @@
   \def\BabelBeforeIni##1##2{%
     \begingroup
       \bbl at add\bbl at secpost@identification{\closein\bbl at readstream }%
-      \catcode`\[=12 \catcode`\]=12 \catcode`\==12
-      \catcode`\;=12 \catcode`\|=12 \catcode`\%=14
       \bbl at read@ini{##1}1%
       \endinput          % babel- .tex may contain onlypreamble's
     \endgroup}%            boxed, to avoid extra spaces:
   {\bbl at input@texini{#1}}}
+\def\bbl at setdigits#1#2#3#4#5{%
+  \bbl at exp{%
+    \def\<\languagename digits>####1{%       ie, \langdigits
+      \<bbl at digits@\languagename>####1\\\@nil}%
+    \let\<bbl at cntr@digits@\languagename>\<\languagename digits>%
+    \def\<\languagename counter>####1{%      ie, \langcounter
+      \\\expandafter\<bbl at counter@\languagename>%
+      \\\csname c@####1\endcsname}%
+    \def\<bbl at counter@\languagename>####1{% ie, \bbl at counter@lang
+      \\\expandafter\<bbl at digits@\languagename>%
+      \\\number####1\\\@nil}}%
+  \def\bbl at tempa##1##2##3##4##5{%
+    \bbl at exp{%    Wow, quite a lot of hashes! :-(
+      \def\<bbl at digits@\languagename>########1{%
+       \\\ifx########1\\\@nil              % ie, \bbl at digits@lang
+       \\\else
+         \\\ifx0########1#1%
+         \\\else\\\ifx1########1#2%
+         \\\else\\\ifx2########1#3%
+         \\\else\\\ifx3########1#4%
+         \\\else\\\ifx4########1#5%
+         \\\else\\\ifx5########1##1%
+         \\\else\\\ifx6########1##2%
+         \\\else\\\ifx7########1##3%
+         \\\else\\\ifx8########1##4%
+         \\\else\\\ifx9########1##5%
+         \\\else########1%
+         \\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi\\\fi
+         \\\expandafter\<bbl at digits@\languagename>%
+       \\\fi}}}%
+  \bbl at tempa}
 \def\bbl at buildifcase#1 {% Returns \bbl at tempa, requires \toks@={}
   \ifx\\#1%             % \\ before, in case #1 is multiletter
     \bbl at exp{%
@@ -3308,7 +3334,7 @@
   \bbl at adjust@layout{\let\@tabular\bbl at OL@@tabular}}
 \@namedef{bbl at ADJ@layout.lists at on}{%
   \bbl at adjust@layout{\let\list\bbl at NL@list}}
-\@namedef{bbl at ADJ@layout.lists at on}{%
+\@namedef{bbl at ADJ@layout.lists at off}{%
   \bbl at adjust@layout{\let\list\bbl at OL@list}}
 \@namedef{bbl at ADJ@hyphenation.extra at on}{%
   \bbl at activateposthyphen}

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2020-10-03 21:50:00 UTC (rev 56531)
@@ -33,7 +33,7 @@
 %%
 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{babel}[2020/09/01 3.48 The Babel package]
+\ProvidesPackage{babel}[2020/10/03 3.49 The Babel package]
 \@ifpackagewith{babel}{debug}
   {\providecommand\bbl at trace[1]{\message{^^J[ #1 ]}}%
    \let\bbl at debug\@firstofone}
@@ -106,6 +106,8 @@
 \def\bbl at ifblank#1{%
   \bbl at ifblank@i#1\@nil\@nil\@secondoftwo\@firstoftwo\@nil}
 \long\def\bbl at ifblank@i#1#2\@nil#3#4#5\@nil{#4}
+\def\bbl at ifset#1#2#3{%
+  \bbl at ifunset{#1}{#3}{\bbl at exp{\\\bbl at ifblank{#1}}{#3}{#2}}}
 \def\bbl at forkv#1#2{%
   \def\bbl at kvcmd##1##2##3{#2}%
   \bbl at kvnext#1,\@nil,}
@@ -194,6 +196,18 @@
   \else
     \let\bbl at esphack\@empty
   \fi}
+\def\bbl at cased{%
+  \ifx\oe\OE
+    \expandafter\in@\expandafter
+      {\expandafter\OE\expandafter}\expandafter{\oe}%
+    \ifin@
+      \bbl at afterelse\expandafter\MakeUppercase
+    \else
+      \bbl at afterfi\expandafter\MakeLowercase
+    \fi
+  \else
+    \expandafter\@firstofone
+  \fi}
   % Temporarily repeat here the code for errors
   \def\bbl at error#1#2{%
     \begingroup
@@ -295,17 +309,24 @@
   \endinput}{}%
 \bbl at trace{key=value and another general options}
 \bbl at csarg\let{tempa\expandafter}\csname opt at babel.sty\endcsname
-\def\bbl at tempb#1.#2{%
+\def\bbl at tempb#1.#2{%  Remove trailing dot
    #1\ifx\@empty#2\else,\bbl at afterfi\bbl at tempb#2\fi}%
-\def\bbl at tempd#1.#2\@nnil{%
+\def\bbl at tempd#1.#2\@nnil{%  TODO. Refactor lists?
   \ifx\@empty#2%
     \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1}%
   \else
-    \in@{=}{#1}\ifin@
-      \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1.#2}%
+    \in@{,provide,}{,#1,}%
+    \ifin@
+      \edef\bbl at tempc{%
+        \ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1.\bbl at tempb#2}%
     \else
-      \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1}%
-      \bbl at csarg\edef{mod@#1}{\bbl at tempb#2}%
+      \in@{=}{#1}%
+      \ifin@
+        \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1.#2}%
+      \else
+        \edef\bbl at tempc{\ifx\bbl at tempc\@empty\else\bbl at tempc,\fi#1}%
+        \bbl at csarg\edef{mod@#1}{\bbl at tempb#2}%
+      \fi
     \fi
   \fi}
 \let\bbl at tempc\@empty
@@ -320,8 +341,16 @@
 \DeclareOption{silent}{}
 \DeclareOption{mono}{}
 \DeclareOption{shorthands=off}{\bbl at tempa shorthands=\bbl at tempa}
+\chardef\bbl at iniflag\z@
+\DeclareOption{provide=*}{\chardef\bbl at iniflag\@ne}    % main -> +1
+\DeclareOption{provide+=*}{\chardef\bbl at iniflag\tw@}   % add = 2
+\DeclareOption{provide*=*}{\chardef\bbl at iniflag\thr@@} % add + main
 \newif\ifbbl at single
 \DeclareOption{selectors=off}{\bbl at singletrue}
+\DeclareOption{provide@=*}{} % autoload with cat @=letter
+\makeatother
+\DeclareOption{provide@=*}{} % autoload with cat @=other
+\makeatletter
 \DeclareOption{safe=none}{\let\bbl at opt@safe\@empty}
 \DeclareOption{safe=bib}{\def\bbl at opt@safe{B}}
 \DeclareOption{safe=ref}{\def\bbl at opt@safe{R}}
@@ -755,7 +784,7 @@
       \AtEndOfPackage{%
         \EnableBabelHook{babel-bidi}%
         \ifx\fontspec\@undefined
-          \usepackage{fontspec}% bidi needs fontspec
+          \bbl at loadfontspec % bidi needs fontspec
         \fi
         \usepackage#1{bidi}}%
     \fi}
@@ -764,10 +793,8 @@
       \bbl at tentative{bidi=bidi}
       \bbl at loadxebidi{}
     \or
-      \bbl at tentative{bidi=bidi-r}
       \bbl at loadxebidi{[rldocument]}
     \or
-      \bbl at tentative{bidi=bidi-l}
       \bbl at loadxebidi{}
     \fi
   \fi
@@ -982,13 +1009,13 @@
     {\bbl at error{%
        Unknown option `\CurrentOption'. Either you misspelled it\\%
        or the language definition file \CurrentOption.ldf was not found}{%
-       Valid options are: shorthands=, KeepShorthandsActive,\\%
+       Valid options are, among others: shorthands=, KeepShorthandsActive,\\%
        activeacute, activegrave, noconfigs, safe=, main=, math=\\%
        headfoot=, strings=, config=, hyphenmap=, or a language name.}}}
 \def\bbl at try@load at lang#1#2#3{%
-    \IfFileExists{\CurrentOption.ldf}%
-      {\bbl at load@language{\CurrentOption}}%
-      {#1\bbl at load@language{#2}#3}}
+  \IfFileExists{\CurrentOption.ldf}%
+    {\bbl at load@language{\CurrentOption}}%
+    {#1\bbl at load@language{#2}#3}}
 \DeclareOption{afrikaans}{\bbl at try@load at lang{}{dutch}{}}
 \DeclareOption{hebrew}{%
   \input{rlbabel.def}%
@@ -1017,24 +1044,69 @@
        Local config file `\bbl at opt@config.cfg' not found}{%
        Perhaps you misspelled it.}}%
 \fi
-\bbl at for\bbl at tempa\bbl at language@opts{%
-  \bbl at ifunset{ds@\bbl at tempa}%
-    {\edef\bbl at tempb{%
-       \noexpand\DeclareOption
-         {\bbl at tempa}%
-         {\noexpand\bbl at load@language{\bbl at tempa}}}%
-     \bbl at tempb}%
-     \@empty}
+\let\bbl at tempc\relax
+\bbl at foreach\bbl at language@opts{%
+  \ifcase\bbl at iniflag
+    \bbl at ifunset{ds@#1}%
+      {\DeclareOption{#1}{\bbl at load@language{#1}}}%
+      {}%
+  \or
+    \@gobble % case 2 same as 1
+  \or
+    \bbl at ifunset{ds@#1}%
+      {\IfFileExists{#1.ldf}{}%
+        {\IfFileExists{babel-#1.tex}{}{\DeclareOption{#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
+    \def\bbl at tempc{#1}%
+    \bbl at ifunset{ds@#1}%
+      {\DeclareOption{#1}{%
+         \bbl at ldfinit
+         \babelprovide[import]{#1}%
+         \bbl at afterldf{}}}%
+      {}%
+  \fi}
+\let\bbl at tempb\@nnil
 \bbl at foreach\@classoptionslist{%
   \bbl at ifunset{ds@#1}%
-    {\IfFileExists{#1.ldf}%
-      {\DeclareOption{#1}{\bbl at load@language{#1}}}%
-      {}}%
+    {\IfFileExists{#1.ldf}{}%
+      {\IfFileExists{babel-#1.tex}{}{\DeclareOption{#1}{}}}}%
+    {}%
+  \bbl at ifunset{ds@#1}%
+    {\def\bbl at tempb{#1}%
+     \DeclareOption{#1}{%
+       \ifnum\bbl at iniflag>\@ne
+         \bbl at ldfinit
+         \babelprovide[import]{#1}%
+         \bbl at afterldf{}%
+       \else
+         \bbl at load@language{#1}%
+       \fi}}%
     {}}
+\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
-  \DeclareOption{\bbl at opt@main}{}
+  \expandafter\let\csname ds@\bbl at opt@main\endcsname\@empty
 \fi
 \def\AfterBabelLanguage#1{%
   \bbl at ifsamestring\CurrentOption{#1}{\global\bbl at add\bbl at afterlang}{}}
@@ -1058,10 +1130,17 @@
       option. Reported}%
   \fi
 \else
-  \DeclareOption{\bbl at opt@main}{\bbl at loadmain}
-  \ExecuteOptions{\bbl at opt@main}
-  \DeclareOption*{}
-  \ProcessOptions*
+  \ifodd\bbl at iniflag  % case 1,3
+    \bbl at ldfinit
+    \let\CurrentOption\bbl at opt@main
+    \bbl at exp{\\\babelprovide[import,main]{\bbl at opt@main}}
+    \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
+    \DeclareOption*{}%
+    \ProcessOptions*
+  \fi
 \fi
 \def\AfterBabelLanguage{%
   \bbl at error

Modified: trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2020-10-03 21:50:00 UTC (rev 56531)
@@ -37,10 +37,10 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{hyphen.cfg}[2020/09/01 3.48 Babel hyphens]
+\ProvidesFile{hyphen.cfg}[2020/10/03 3.49 Babel hyphens]
 \xdef\bbl at format{\jobname}
-\def\bbl at version{3.48}
-\def\bbl at date{2020/09/01}
+\def\bbl at version{3.49}
+\def\bbl at date{2020/10/03}
 \ifx\AtBeginDocument\@undefined
   \def\@empty{}
   \let\orig at dump\dump

Modified: trunk/Master/texmf-dist/tex/generic/babel/locale/km/babel-km.ini
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/locale/km/babel-km.ini	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/tex/generic/babel/locale/km/babel-km.ini	2020-10-03 21:50:00 UTC (rev 56531)
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.7
-date = 2020-06-30
+version = 1.8
+date = 2020-09-30
 name.local = ខ្មែរ
 name.english = Khmer
 name.babel = khmer
@@ -145,7 +145,6 @@
 preexhyphenchar = 
 postexhyphenchar = 
 hyphenationmin = 
-justify = s
 intraspace = 0 .1 0
 linebreaking = s
 

Modified: trunk/Master/texmf-dist/tex/generic/babel/locale/lo/babel-lo.ini
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/locale/lo/babel-lo.ini	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/tex/generic/babel/locale/lo/babel-lo.ini	2020-10-03 21:50:00 UTC (rev 56531)
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.6
-date = 2020-06-30
+version = 1.7
+date = 2020-09-30
 name.local = ລາວ
 name.english = Lao
 name.babel = lao
@@ -123,7 +123,6 @@
 preexhyphenchar = 
 postexhyphenchar = 
 hyphenationmin = 
-justify = s
 intraspace = 0 .1 0
 linebreaking = s
 

Modified: trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-th.ini
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-th.ini	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/tex/generic/babel/locale/th/babel-th.ini	2020-10-03 21:50:00 UTC (rev 56531)
@@ -11,8 +11,8 @@
 
 [identification]
 charset = utf8
-version = 1.6
-date = 2020-06-30
+version = 1.7
+date = 2020-09-30
 name.local = ไทย
 name.english = Thai
 name.babel = thai
@@ -161,7 +161,6 @@
 preexhyphenchar = 
 postexhyphenchar = 
 hyphenationmin = 
-justify = s
 intraspace = 0 .1 0
 linebreaking = s
 

Modified: trunk/Master/texmf-dist/tex/generic/babel/luababel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/luababel.def	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/tex/generic/babel/luababel.def	2020-10-03 21:50:00 UTC (rev 56531)
@@ -536,6 +536,26 @@
 \AddBabelHook{babel-fontspec}{beforestart}{\bbl at ckeckstdfonts}
 \DisableBabelHook{babel-fontspec}
 \bbl at trace{Font handling with fontspec}
+\ifx\ExplSyntaxOn\@undefined\else
+  \ExplSyntaxOn
+  \catcode`\ =10
+  \def\bbl at loadfontspec{%
+    \usepackage{fontspec}%
+    \expandafter
+    \def\csname msg~text~>~fontspec/language-not-exist\endcsname##1##2##3##4{%
+      Font '\l_fontspec_fontname_tl' is using the\\%
+      default features for language '##1'.\\%
+      That's usually fine, because many languages\\%
+      require no specific features, but if the output is\\%
+      not as expected, consider selecting another font.}
+    \expandafter
+    \def\csname msg~text~>~fontspec/no-script\endcsname##1##2##3##4{%
+      Font '\l_fontspec_fontname_tl' is using the\\%
+      default features for script '##2'.\\%
+      That's not always wrong, but if the output is\\%
+      not as expected, consider selecting another font.}}
+  \ExplSyntaxOff
+\fi
 \@onlypreamble\babelfont
 \newcommand\babelfont[2][]{%  1=langs/scripts 2=fam
   \bbl at foreach{#1}{%
@@ -547,7 +567,7 @@
   \edef\bbl at tempa{#1}%
   \def\bbl at tempb{#2}%  Used by \bbl at bblfont
   \ifx\fontspec\@undefined
-    \usepackage{fontspec}%
+    \bbl at loadfontspec
   \fi
   \EnableBabelHook{babel-fontspec}% Just calls \bbl at switchfont
   \bbl at bblfont}
@@ -1250,6 +1270,9 @@
       if not u.find(patt, '()', nil, true) then
         patt = '()' .. patt .. '()'
       end
+      patt = string.gsub(patt, '%(%)%^', '^()')
+      patt = string.gsub(patt, '%$%(%)', '()$')
+      texio.write('***************' .. patt)
       patt = u.gsub(patt, '{(.)}',
                 function (n)
                   return '%' .. (tonumber(n) and (tonumber(n)+1) or n)

Modified: trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2020-10-03 21:50:00 UTC (rev 56531)
@@ -32,7 +32,7 @@
 %% extension |.ins|) which are part of the distribution.
 %%
 
-\ProvidesLanguage{nil}[2020/09/01 3.48 Nil language]
+\ProvidesLanguage{nil}[2020/10/03 3.49 Nil language]
 \LdfInit{nil}{datenil}
 \ifx\l at nil\@undefined
   \newlanguage\l at nil

Modified: trunk/Master/texmf-dist/tex/generic/babel/xebabel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/xebabel.def	2020-10-03 21:48:56 UTC (rev 56530)
+++ trunk/Master/texmf-dist/tex/generic/babel/xebabel.def	2020-10-03 21:50:00 UTC (rev 56531)
@@ -96,6 +96,26 @@
 \AddBabelHook{babel-fontspec}{beforestart}{\bbl at ckeckstdfonts}
 \DisableBabelHook{babel-fontspec}
 \bbl at trace{Font handling with fontspec}
+\ifx\ExplSyntaxOn\@undefined\else
+  \ExplSyntaxOn
+  \catcode`\ =10
+  \def\bbl at loadfontspec{%
+    \usepackage{fontspec}%
+    \expandafter
+    \def\csname msg~text~>~fontspec/language-not-exist\endcsname##1##2##3##4{%
+      Font '\l_fontspec_fontname_tl' is using the\\%
+      default features for language '##1'.\\%
+      That's usually fine, because many languages\\%
+      require no specific features, but if the output is\\%
+      not as expected, consider selecting another font.}
+    \expandafter
+    \def\csname msg~text~>~fontspec/no-script\endcsname##1##2##3##4{%
+      Font '\l_fontspec_fontname_tl' is using the\\%
+      default features for script '##2'.\\%
+      That's not always wrong, but if the output is\\%
+      not as expected, consider selecting another font.}}
+  \ExplSyntaxOff
+\fi
 \@onlypreamble\babelfont
 \newcommand\babelfont[2][]{%  1=langs/scripts 2=fam
   \bbl at foreach{#1}{%
@@ -107,7 +127,7 @@
   \edef\bbl at tempa{#1}%
   \def\bbl at tempb{#2}%  Used by \bbl at bblfont
   \ifx\fontspec\@undefined
-    \usepackage{fontspec}%
+    \bbl at loadfontspec
   \fi
   \EnableBabelHook{babel-fontspec}% Just calls \bbl at switchfont
   \bbl at bblfont}



More information about the tex-live-commits mailing list.