[latex3-commits] [git/LaTeX3-latex3-babel] master: Bump to 3.43. (9d28892)

Javier email at dante.de
Tue Apr 28 17:35:33 CEST 2020


Repository : https://github.com/latex3/babel
On branch  : master
Link       : https://github.com/latex3/babel/commit/9d288920c804b9f3cc34d8f849d94290910370fc

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

commit 9d288920c804b9f3cc34d8f849d94290910370fc
Author: Javier <email at localhost>
Date:   Tue Apr 28 17:35:33 2020 +0200

    Bump to 3.43.


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

9d288920c804b9f3cc34d8f849d94290910370fc
 README.md              |  37 +---
 babel.dtx              | 570 +++++++++++++++++++++++++++----------------------
 babel.ins              |   2 +-
 babel.pdf              | Bin 771499 -> 773033 bytes
 bbcompat.dtx           |   2 +-
 locale/as/babel-as.ini |   1 +
 locale/fi/babel-fi.ini |   1 +
 locale/mr/babel-mr.ini |   1 +
 8 files changed, 331 insertions(+), 283 deletions(-)

diff --git a/README.md b/README.md
index cdda811..d37c85f 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.42.1989
+## Babel 3.43
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -44,18 +44,17 @@ respective authors.
 ### Latest changes
 
 ```
-3.43   2020-04-??
+3.43   2020-04-28
        - Autoloading based on the BCP47 codes, with basic lookup.
-       - Now only a few essential commands are loaded with the format.
+       - Now only a few essential commands are loaded in the format.
        - Improvements in Assamese, Luxembourgish, Marathi, Armenian,
          Bengali, and Finnish.
        - First steps in the removal of switch.def and plain.def.
        - Fixes:
          - Babel reset the \sfcode of » to 1000. It should be 0.
-         - With autoloading the hyphenmins were set to the default
-           values.
-         - With autoloading and counters an error could be raised in
-           pdftex.
+         - \guillemotleft and \guillemotleft renamed to \guillemetleft
+           and \guillemetleft (#63).
+         - A couple of bugs related to autoloading.
        
 3.42   2020-03-22
        - \getlocaleproperty, to get the value of a field from the loaded
@@ -159,30 +158,6 @@ See https://github.com/latex3/babel/wiki/What's-new-in-babel-3.36
        - Basic support for the picture environment (with pict2e) and pgf
          (lua, somewhat experimental).
        - Start support for harftex (just try - it may work).
-
-3.31   2019-05-04
-       - Basic support for line breaking with CJK scripts (lua)
-       - layout=tabular now works with the 'array' package (and some
-         others; lua).
-
-3.30   2019-04-22
-       - Fix - dir in boxes inside math (hopefully now it works; lua).
-       - Option mapdigits for \babelprovide, which converts European
-         digits to local ones (lua).
-
-3.29    2019-04-03
-       - The fix for boxes inside math is incompatible with ams.
-         Removed (a better fix is under study).
-       - Options bidi-l and bidi-r (for the bidi package; xe).
-
-3.28    2019-04-01
-       - Fixes - wrong dir after math, in math inside tabular, in weak L
-         inside R inside L, and in boxes inside math.
-       - \babelfont now takes into account \defaultfontfeatures. This
-         is a potential source of backwards incompatibilities, but
-         very likely the risks are very low, and it is, I think, the
-         expected behavior.
-
 ```
 
 Javier Bezos
diff --git a/babel.dtx b/babel.dtx
index 6d1320c..7acfb16 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2020/04/26 v3.42.1989 The Babel package]
+\ProvidesFile{babel.dtx}[2020/03/28 v3.43 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -624,8 +624,10 @@ This command can be used as environment, too.
 \begin{note}
   For ``historical reasons'', a macro name is converted to a language
   name without the leading |\|; in other words,
-  |\selectlanguage{\german}| is equivalent to |\selectlanguage{german}|.
-  Using a macro instead of a ``real'' name is deprecated.
+  |\selectlanguage{\german}| is equivalent to
+  |\selectlanguage{german}|. Using a macro instead of a ``real'' name
+  is deprecated. \New{3.43} However, if the macro name does not match
+  any language, it will get expanded as expected.
 \end{note}
 
 \begin{warning}
@@ -2508,7 +2510,7 @@ The styles are:
 
 \item[Hindi] |alphabetic|
 
-\item[Armenian] |lower|, |upper|
+\item[Armenian] |lower.letter|, |upper.letter|
 
 \item[Japanese] |hiragana|, |hiragana.iroha|, |katakana|,
 |katakana.iroha|, |circled.katakana|, |informal|, |formal|,
@@ -2787,6 +2789,68 @@ additional replacement type with the key |string|.
   |\babelprehyphenation| is on the way.)
 \end{example}
 
+\subsection{Selection based on BCP 47 tags}
+
+\New{3.43} The recommended way to select languages is that described at
+the beginning of this document. However, BCP 47 tags are becoming
+customary, particularly in document (or parts of documents) generated
+by external sources, and therefore \babel{} will provide a set of tools
+to select the locales in different situations, adapted to the
+particular needs of each case. Currently, \babel{} provides autoloading
+of locales as described in this section. In these contexts autoloading
+is particularly important because we may not know on beforehand which
+languages will be requested.
+
+It must be activated explicitly, because it is primarily meant for
+special tasks. Mapping from BCP 47 codes to locale names are not
+hardcoded in \babel. Instead the data is taken from the \texttt{ini}
+files, which means currently about 250 tags are already recognized.
+\Babel{} performs a simple lookup in the following way: |fr-Latn-FR| $\to$
+|fr-Latn| $\to$ |fr-FR| $\to$ |fr|. Languages with the same resolved
+name are considered the same. Case is normalized before, so that
+|fr-latn-fr| $\to$ |fr-Latn-FR|. If a tag and a name overlap, the tag
+takes precedence.
+
+Here is a minimal example:
+\begin{verbatim}
+\documentclass{article}
+
+\usepackage[danish]{babel}
+
+\babeladjust{ autoload.bcp47 = on }
+
+\begin{document}
+
+\today
+
+\selectlanguage{fr-CA}
+
+\today
+
+\end{document}
+\end{verbatim}
+
+Currently the locales loaded are based on the \texttt{ini} files and
+decoupled from the main \texttt{ldf} files. This is by design, to
+ensure code generated externally produces the same result regardless of
+the languages requested in the document, but an option to use the
+\texttt{ldf} instead will be added in a future release, because both
+options make sense depending on the particular needs of each document
+(there will be some restrictions, however).
+
+The behaviour is adjusted with |\babeladjust| with the following parameters:
+\begin{description}
+\item \texttt{autoload.bcp47} with values on and off.
+\item \texttt{autoload.bcp47.options}, which are passed to
+  |\babelprovide|; empty by default, but you may add \texttt{import}
+  (features defined in the corresponding |babel-...tex| file might not
+  available).
+\item \texttt{autoload.bcp47.prefix}. Although the public name used in
+  selectors is the tag, the internal name will be different and
+  generated by prepending a prefix, which by default is
+  \texttt{bcp47-}. You may change it with this key.
+\end{description}
+
 \subsection{Selecting scripts}
 
 Currently \babel{} provides no standard interface to select
@@ -4466,8 +4530,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.42.1989>>
-%<<date=2020/04/26>>
+%<<version=3.43>>
+%<<date=2020/03/28>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -6623,13 +6687,13 @@ help from Bernd Raichle, for which I am grateful.
 %    \end{macrocode}
 %
 %  \begin{macro}{\iflanguage}
-%    Users might want to test (in a private package for instance)
-%    which language is currently active. For this we provide a test
-%    macro, |\iflanguage|, that has three arguments.  It checks
-%    whether the first argument is a known language. If so, it
-%    compares the first argument with the value of |\language|. Then,
-%    depending on the result of the comparison, it executes either the
-%    second or the third argument.
+% Users might want to test (in a private package for instance)
+% which language is currently active. For this we provide a test
+% macro, |\iflanguage|, that has three arguments.  It checks
+% whether the first argument is a known language. If so, it
+% compares the first argument with the value of |\language|. Then,
+% depending on the result of the comparison, it executes either the
+% second or the third argument.
 %
 %    \begin{macrocode}
 \def\iflanguage#1{%
@@ -6647,9 +6711,9 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \begin{macro}{\selectlanguage}
 %
-%    The macro |\selectlanguage| checks whether the language is
-%    already defined before it performs its actual task, which is to
-%    update |\language| and activate language-specific definitions.
+% The macro |\selectlanguage| checks whether the language is
+% already defined before it performs its actual task, which is to
+% update |\language| and activate language-specific definitions.
 %
 %    \begin{macrocode}
 \let\bbl at select@type\z@
@@ -6658,10 +6722,10 @@ help from Bernd Raichle, for which I am grateful.
   \expandafter\noexpand\csname selectlanguage \endcsname}
 %    \end{macrocode}
 %
-%    Because the command |\selectlanguage| could be used in a moving
-%    argument it expands to \verb*=\protect\selectlanguage =.
-%    Therefore, we have to make sure that a macro |\protect| exists.
-%    If it doesn't it is |\let| to |\relax|.
+% Because the command |\selectlanguage| could be used in a moving
+% argument it expands to \verb*=\protect\selectlanguage =.
+% Therefore, we have to make sure that a macro |\protect| exists.
+% If it doesn't it is |\let| to |\relax|.
 %
 %    \begin{macrocode}
 \ifx\@undefined\protect\let\protect\relax\fi
@@ -6680,34 +6744,35 @@ help from Bernd Raichle, for which I am grateful.
 %    order to typeset table of contents etc. in the correct language
 %    environment.
 %
-%  \begin{macro}{\bbl at pop@language}
+% \begin{macro}{\bbl at pop@language}
 %
-%    \emph{But} when the language change happens \emph{inside} a group
-%    the end of the group doesn't write anything to the auxiliary
-%    files. Therefore we need \TeX's |aftergroup| mechanism to help
-%    us. The command |\aftergroup| stores the token immediately
-%    following it to be executed when the current group is closed. So
-%    we define a temporary control sequence |\bbl at pop@language| to be
-%    executed at the end of the group. It calls |\bbl at set@language|
-%    with the name of the current language as its argument.
+% \emph{But} when the language change happens \emph{inside} a group
+% the end of the group doesn't write anything to the auxiliary
+% files. Therefore we need \TeX's |aftergroup| mechanism to help
+% us. The command |\aftergroup| stores the token immediately
+% following it to be executed when the current group is closed. So
+% we define a temporary control sequence |\bbl at pop@language| to be
+% executed at the end of the group. It calls |\bbl at set@language|
+% with the name of the current language as its argument.
 %
-%  \begin{macro}{\bbl at language@stack}
-%    The previous solution works for one level of nesting groups, but
-%    as soon as more levels are used it is no longer adequate. For
-%    that case we need to keep track of the nested languages using a
-%    stack mechanism. This stack is called |\bbl at language@stack| and
-%    initially empty.
+% \begin{macro}{\bbl at language@stack}
+% The previous solution works for one level of nesting groups, but
+% as soon as more levels are used it is no longer adequate. For
+% that case we need to keep track of the nested languages using a
+% stack mechanism. This stack is called |\bbl at language@stack| and
+% initially empty.
 %
 %    \begin{macrocode}
 \def\bbl at language@stack{}
 %    \end{macrocode}
 %
-%    When using a stack we need a mechanism to push an element on the
-%    stack and to retrieve the information afterwards.
-%  \begin{macro}{\bbl at push@language}
-%  \begin{macro}{\bbl at pop@language}
-%    The stack is simply a list of languagenames, separated with a `+'
-%    sign; the push function can be simple:
+% When using a stack we need a mechanism to push an element on the
+% stack and to retrieve the information afterwards.
+%
+% \begin{macro}{\bbl at push@language}
+% \begin{macro}{\bbl at pop@language}
+% The stack is simply a list of languagenames, separated with a `+'
+% sign; the push function can be simple:
 %
 %    \begin{macrocode}
 \def\bbl at push@language{%
@@ -6730,15 +6795,15 @@ help from Bernd Raichle, for which I am grateful.
 %    \end{macrocode}
 %
 %  \end{macro}
-%    The reason for the somewhat weird arrangement of arguments to the
-%    helper function is the fact it is called in the following way.
-%    This means that before |\bbl at pop@lang| is executed \TeX\ first
-%    \emph{expands} the stack, stored in |\bbl at language@stack|. The
-%    result of that is that the argument string of |\bbl at pop@lang|
-%    contains one or more language names, each followed by a `+'-sign
-%    (zero language names won't occur as this macro will only be
-%    called after something has been pushed on the stack) followed by
-%    the `\&'-sign and finally the reference to the stack.
+% The reason for the somewhat weird arrangement of arguments to the
+% helper function is the fact it is called in the following way.
+% This means that before |\bbl at pop@lang| is executed \TeX\ first
+% \emph{expands} the stack, stored in |\bbl at language@stack|. The
+% result of that is that the argument string of |\bbl at pop@lang|
+% contains one or more language names, each followed by a `+'-sign
+% (zero language names won't occur as this macro will only be
+% called after something has been pushed on the stack) followed by
+% the `\&'-sign and finally the reference to the stack.
 %
 %    \begin{macrocode}
 \let\bbl at ifrestoring\@secondoftwo
@@ -6749,19 +6814,19 @@ help from Bernd Raichle, for which I am grateful.
   \let\bbl at ifrestoring\@secondoftwo}
 %    \end{macrocode}
 %
-%    Once the name of the previous language is retrieved from the stack,
-%    it is fed to |\bbl at set@language| to do the actual work of
-%    switching everything that needs switching.
+% Once the name of the previous language is retrieved from the stack,
+% it is fed to |\bbl at set@language| to do the actual work of
+% switching everything that needs switching.
 %  \end{macro}
 %  \end{macro}
 %  \end{macro}
 %
-%  An alternative way to identify languages (in the \babel{} sense)
-%  with a numerical value is introduced in 3.30. This is one of the
-%  first steps for a new interface based on the concept of locale,
-%  which explains the name of |\localeid|. This means |\l at ...| will be
-%  reserved for hyphenation patterns (so that two locales can share the
-%  same rules).
+% An alternative way to identify languages (in the \babel{} sense)
+% with a numerical value is introduced in 3.30. This is one of the
+% first steps for a new interface based on the concept of locale,
+% which explains the name of |\localeid|. This means |\l at ...| will be
+% reserved for hyphenation patterns (so that two locales can share the
+% same rules).
 %
 %    \begin{macrocode}
 \chardef\localeid\z@
@@ -6798,20 +6863,20 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \begin{macro}{\bbl at set@language}
 %
-%    The macro |\bbl at set@language| takes care of switching the language
-%    environment \emph{and} of writing entries on the auxiliary files.
-%    For historial reasons, language names can be either |language| of
-%    |\language|. To catch either form a trick is used, but
-%    unfortunately as a side effect the catcodes of letters in
-%    |\languagename| are messed up. This is a bug, but preserved for
-%    backwards compatibility. The list of auxiliary files can be
-%    extended by redefining |\BabelContentsFiles|, but make sure they
-%    are loaded inside a group (as |aux|, |toc|, |lof|, and |lot| do)
-%    or the last language of the document will remain active
-%    afterwards.
+% The macro |\bbl at set@language| takes care of switching the language
+% environment \emph{and} of writing entries on the auxiliary files.
+% For historial reasons, language names can be either |language| of
+% |\language|. To catch either form a trick is used, but
+% unfortunately as a side effect the catcodes of letters in
+% |\languagename| are messed up. This is a bug, but preserved for
+% backwards compatibility. The list of auxiliary files can be
+% extended by redefining |\BabelContentsFiles|, but make sure they
+% are loaded inside a group (as |aux|, |toc|, |lof|, and |lot| do)
+% or the last language of the document will remain active
+% afterwards.
 %
-%    We also write a command to change the current language in the
-%    auxiliary files.
+% We also write a command to change the current language in the
+% auxiliary files.
 %
 %    \begin{macrocode}
 \def\BabelContentsFiles{toc,lof,lot}
@@ -6826,8 +6891,8 @@ help from Bernd Raichle, for which I am grateful.
       \let\localename\languagename
     \else
       \bbl at info{Using '\string\language' instead of 'language' is\\%
-                not recommended. If what you want is to use\\%
-                a macro containing the actual locale, make\\%
+                deprecated. If what you want is to use a\\%
+                macro containing the actual locale, make\\%
                 sure it does not not match any language.\\%
                 Reported}%
 %                 I'll\\%
@@ -6888,31 +6953,31 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \end{macro}
 %
-%    First, check if the user asks for a known language. If so,
-%    update the value of |\language| and call |\originalTeX|
-%    to bring \TeX\ in a certain pre-defined state.
+% First, check if the user asks for a known language. If so,
+% update the value of |\language| and call |\originalTeX|
+% to bring \TeX\ in a certain pre-defined state.
 %
-%    The name of the language is stored in the control sequence
-%    |\languagename|.
+% The name of the language is stored in the control sequence
+% |\languagename|.
 %
-%    Then we have to \emph{re}define |\originalTeX| to compensate for
-%    the things that have been activated.  To save memory space for
-%    the macro definition of |\originalTeX|, we construct the control
-%    sequence name for the |\noextras|\langvar\ command at definition
-%    time by expanding the |\csname| primitive.
+% Then we have to \emph{re}define |\originalTeX| to compensate for
+% the things that have been activated.  To save memory space for
+% the macro definition of |\originalTeX|, we construct the control
+% sequence name for the |\noextras|\langvar\ command at definition
+% time by expanding the |\csname| primitive.
 %
-%    Now activate the language-specific definitions. This is done by
-%    constructing the names of three macros by concatenating three
-%    words with the argument of |\selectlanguage|, and calling these
-%    macros. \nb{What if \cs{hyphenation} was used in |extras|? Patch
-%    temporarily |\set at hyphenmins| and hyphenation. It can be done in
-%    hooks if necessary.}
+% Now activate the language-specific definitions. This is done by
+% constructing the names of three macros by concatenating three
+% words with the argument of |\selectlanguage|, and calling these
+% macros. \nb{What if \cs{hyphenation} was used in |extras|? Patch
+% temporarily |\set at hyphenmins| and hyphenation. It can be done in
+% hooks if necessary.}
 %
-%    The switching of the values of |\lefthyphenmin| and
-%    |\righthyphenmin| is somewhat different. First we save their
-%    current values, then we check if |\|\langvar|hyphenmins| is
-%    defined. If it is not, we set default values (2 and 3), otherwise
-%    the values in |\|\langvar|hyphenmins| will be used.
+% The switching of the values of |\lefthyphenmin| and
+% |\righthyphenmin| is somewhat different. First we save their
+% current values, then we check if |\|\langvar|hyphenmins| is
+% defined. If it is not, we set default values (2 and 3), otherwise
+% the values in |\|\langvar|hyphenmins| will be used.
 %
 %    \begin{macrocode}
 \newif\ifbbl at usedategroup
@@ -6986,15 +7051,15 @@ help from Bernd Raichle, for which I am grateful.
   \fi}
 %    \end{macrocode}
 %
-%  \begin{environment}{otherlanguage}
-%    The \Lenv{otherlanguage} environment can be used as an
-%    alternative to using the |\selectlanguage| declarative
-%    command. When you are typesetting a document which mixes
-%    left-to-right and right-to-left typesetting you have to use this
-%    environment in order to let things work as you expect them to.
+% \begin{environment}{otherlanguage}
+% The \Lenv{otherlanguage} environment can be used as an
+% alternative to using the |\selectlanguage| declarative
+% command. When you are typesetting a document which mixes
+% left-to-right and right-to-left typesetting you have to use this
+% environment in order to let things work as you expect them to.
 %
-%    The |\ignorespaces| command is necessary to hide the environment
-%    when it is entered in horizontal mode.
+% The |\ignorespaces| command is necessary to hide the environment
+% when it is entered in horizontal mode.
 %
 %    \begin{macrocode}
 \long\def\otherlanguage#1{%
@@ -7003,8 +7068,8 @@ help from Bernd Raichle, for which I am grateful.
   \ignorespaces}
 %    \end{macrocode}
 %
-%    The |\endotherlanguage| part of the environment tries to hide
-%    itself when it is called in horizontal mode.
+% The |\endotherlanguage| part of the environment tries to hide
+% itself when it is called in horizontal mode.
 %
 %    \begin{macrocode}
 \long\def\endotherlanguage{%
@@ -7013,11 +7078,11 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \end{environment}
 %
-%  \begin{environment}{otherlanguage*}
-%    The \Lenv{otherlanguage} environment is meant to be used when a
-%    large part of text from a different language needs to be typeset,
-%    but without changing the translation of words such as `figure'.
-%    This environment makes use of |\foreign at language|.
+% \begin{environment}{otherlanguage*}
+% The \Lenv{otherlanguage} environment is meant to be used when a
+% large part of text from a different language needs to be typeset,
+% but without changing the translation of words such as `figure'.
+% This environment makes use of |\foreign at language|.
 %
 %    \begin{macrocode}
 \expandafter\def\csname otherlanguage*\endcsname#1{%
@@ -7025,9 +7090,9 @@ help from Bernd Raichle, for which I am grateful.
   \foreign at language{#1}}
 %    \end{macrocode}
 %
-%    At the end of the environment we need to switch off the extra
-%    definitions. The grouping mechanism of the environment will take
-%    care of resetting the correct hyphenation rules and ``extras''.
+% At the end of the environment we need to switch off the extra
+% definitions. The grouping mechanism of the environment will take
+% care of resetting the correct hyphenation rules and ``extras''.
 %
 %    \begin{macrocode}
 \expandafter\let\csname endotherlanguage*\endcsname\relax
@@ -7035,43 +7100,44 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \end{environment}
 %
-%  \begin{macro}{\foreignlanguage}
-%    The |\foreignlanguage| command is another substitute for the
-%    |\selectlanguage| command. This command takes two arguments, the
-%    first argument is the name of the language to use for typesetting
-%    the text specified in the second argument.
-%
-%    Unlike |\selectlanguage| this command doesn't switch
-%    \emph{everything}, it only switches the hyphenation rules and the
-%    extra definitions for the language specified. It does this within
-%    a group and assumes the |\extras|\langvar\ command doesn't make
-%    any |\global| changes. The coding is very similar to part of
-%    |\selectlanguage|.
-%
-%    |\bbl at beforeforeign| is a trick to fix a bug in bidi
-%    texts. |\foreignlanguage| is supposed to be a `text' command, and
-%    therefore it must emit a |\leavevmode|, but it does not, and
-%    therefore the indent is placed on the opposite margin. For
-%    backward compatibility, however, it is done only if a
-%    right-to-left script is requested; otherwise, it is no-op.
-%
-%    (3.11) |\foreignlanguage*| is a temporary, experimental macro for
-%    a few lines with a different script direction, while preserving
-%    the paragraph format (thank the braces around |\par|, things like
-%    |\hangindent| are not reset). Do not use it in production,
-%    because its semantics and its syntax may change (and very likely
-%    will, or even it could be removed altogether). Currently it
-%    enters in vmode and then selects the language (which in turn sets the
-%    paragraph direction).
-%
-%    (3.11) Also experimental are the hook |foreign| and |foreign*|.
-%    With them you can redefine |\BabelText| which by default does
-%    nothing. Its behavior is not well defined yet. So, use it in
-%    horizontal mode only if you do not want surprises.
-%
-%    In other words, at the beginning of a paragraph |\foreignlanguage|
-%    enters into hmode with the surrounding lang, and with
-%    |\foreignlanguage*| with the new lang.
+% \begin{macro}{\foreignlanguage}
+%
+% The |\foreignlanguage| command is another substitute for the
+% |\selectlanguage| command. This command takes two arguments, the
+% first argument is the name of the language to use for typesetting
+% the text specified in the second argument.
+%
+% Unlike |\selectlanguage| this command doesn't switch
+% \emph{everything}, it only switches the hyphenation rules and the
+% extra definitions for the language specified. It does this within
+% a group and assumes the |\extras|\langvar\ command doesn't make
+% any |\global| changes. The coding is very similar to part of
+% |\selectlanguage|.
+%
+% |\bbl at beforeforeign| is a trick to fix a bug in bidi
+% texts. |\foreignlanguage| is supposed to be a `text' command, and
+% therefore it must emit a |\leavevmode|, but it does not, and
+% therefore the indent is placed on the opposite margin. For
+% backward compatibility, however, it is done only if a
+% right-to-left script is requested; otherwise, it is no-op.
+%
+% (3.11) |\foreignlanguage*| is a temporary, experimental macro for
+% a few lines with a different script direction, while preserving
+% the paragraph format (thank the braces around |\par|, things like
+% |\hangindent| are not reset). Do not use it in production,
+% because its semantics and its syntax may change (and very likely
+% will, or even it could be removed altogether). Currently it
+% enters in vmode and then selects the language (which in turn sets the
+% paragraph direction).
+%
+% (3.11) Also experimental are the hook |foreign| and |foreign*|.
+% With them you can redefine |\BabelText| which by default does
+% nothing. Its behavior is not well defined yet. So, use it in
+% horizontal mode only if you do not want surprises.
+%
+% In other words, at the beginning of a paragraph |\foreignlanguage|
+% enters into hmode with the surrounding lang, and with
+% |\foreignlanguage*| with the new lang.
 %
 %    \begin{macrocode}
 \providecommand\bbl at beforeforeign{}
@@ -7104,10 +7170,10 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \begin{macro}{\foreign at language}
 %
-%    This macro does the work for |\foreignlanguage| and the
-%    \Lenv{otherlanguage*} environment. First we need to store the name
-%    of the language and check that it is a known language. Then it
-%    just calls |bbl at switch|.
+% This macro does the work for |\foreignlanguage| and the
+% \Lenv{otherlanguage*} environment. First we need to store the name
+% of the language and check that it is a known language. Then it
+% just calls |bbl at switch|.
 %
 %    \begin{macrocode}
 \def\foreign at language#1{%
@@ -7134,21 +7200,21 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \end{macro}
 %
-%  \begin{macro}{\bbl at patterns}
+% \begin{macro}{\bbl at patterns}
 %
-%    This macro selects the hyphenation patterns by changing the
-%    \cs{language} register.  If special hyphenation patterns
-%    are available specifically for the current font encoding,
-%    use them instead of the default.
+% This macro selects the hyphenation patterns by changing the
+% \cs{language} register.  If special hyphenation patterns
+% are available specifically for the current font encoding,
+% use them instead of the default.
 %
-%    It also sets hyphenation exceptions, but only once, because they
-%    are global (here language |\lccode|'s has been set, too).
-%    |\bbl at hyphenation@| is set to relax until the very first
-%    |\babelhyphenation|, so do nothing with this value. If the
-%    exceptions for a language (by its number, not its name, so that
-%    |:ENC| is taken into account) has been set, then use
-%    |\hyphenation| with both global and language exceptions and empty
-%    the latter to mark they must not be set again.
+% It also sets hyphenation exceptions, but only once, because they
+% are global (here language |\lccode|'s has been set, too).
+% |\bbl at hyphenation@| is set to relax until the very first
+% |\babelhyphenation|, so do nothing with this value. If the
+% exceptions for a language (by its number, not its name, so that
+% |:ENC| is taken into account) has been set, then use
+% |\hyphenation| with both global and language exceptions and empty
+% the latter to mark they must not be set again.
 %
 %    \begin{macrocode}
 \let\bbl at hyphlist\@empty
@@ -7183,14 +7249,14 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \end{macro}
 %
-%  \begin{environment}{hyphenrules}
+% \begin{environment}{hyphenrules}
 %
-%    The environment \Lenv{hyphenrules} can be used to select
-%    \emph{just} the hyphenation rules. This environment does
-%    \emph{not} change |\languagename| and when the hyphenation rules
-%    specified were not loaded it has no effect. Note however,
-%    |\lccode|'s and font encodings are not set at all, so in most
-%    cases you should use |otherlanguage*|.
+% The environment \Lenv{hyphenrules} can be used to select
+% \emph{just} the hyphenation rules. This environment does
+% \emph{not} change |\languagename| and when the hyphenation rules
+% specified were not loaded it has no effect. Note however,
+% |\lccode|'s and font encodings are not set at all, so in most
+% cases you should use |otherlanguage*|.
 %
 %    \begin{macrocode}
 \def\hyphenrules#1{%
@@ -7307,26 +7373,28 @@ help from Bernd Raichle, for which I am grateful.
 %
 % \subsection{Errors}
 %
-%  \begin{macro}{\@nolanerr}
-%  \begin{macro}{\@nopatterns}
-%    The \babel\ package will signal an error when a documents tries
-%    to select a language that hasn't been defined earlier. When a
-%    user selects a language for which no hyphenation patterns were
-%    loaded into the format he will be given a warning about that
-%    fact. We revert to the patterns for |\language|=0 in that case.
-%    In most formats that will be (US)english, but it might also be
-%    empty.
-%  \begin{macro}{\@noopterr}
-%    When the package was loaded without options not everything will
-%    work as expected. An error message is issued in that case.
+% \begin{macro}{\@nolanerr}
+% \begin{macro}{\@nopatterns}
+%
+% The \babel\ package will signal an error when a documents tries
+% to select a language that hasn't been defined earlier. When a
+% user selects a language for which no hyphenation patterns were
+% loaded into the format he will be given a warning about that
+% fact. We revert to the patterns for |\language|=0 in that case.
+% In most formats that will be (US)english, but it might also be
+% empty.
 %
-%    When the format knows about |\PackageError| it must be \LaTeXe,
-%    so we can safely use its error handling interface. Otherwise
-%    we'll have to `keep it simple'.
+% \begin{macro}{\@noopterr}
+% When the package was loaded without options not everything will
+% work as expected. An error message is issued in that case.
 %
-%    Infos are not written to the console, but on the other hand many
-%    people think warnings are errors, so a further message type is
-%    defined: an important info which is sent to the console.
+% When the format knows about |\PackageError| it must be \LaTeXe,
+% so we can safely use its error handling interface. Otherwise
+% we'll have to `keep it simple'.
+%
+% Infos are not written to the console, but on the other hand many
+% people think warnings are errors, so a further message type is
+% defined: an important info which is sent to the console.
 %
 %    \begin{macrocode}
 \edef\bbl at nulllanguage{\string\language=0}
@@ -7444,11 +7512,11 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \end{macro}
 %
-%    The macro |\initiate at active@char| below takes all the necessary
-%    actions to make its argument a shorthand character. The real work
-%    is performed once for each character. But first we define a little
-%    tool. TODO. Always used with additional expansions. Move them here?
-%    Move the macro to basic?
+% The macro |\initiate at active@char| below takes all the necessary
+% actions to make its argument a shorthand character. The real work
+% is performed once for each character. But first we define a little
+% tool. TODO. Always used with additional expansions. Move them here?
+% Move the macro to basic?
 %
 %    \begin{macrocode}
 \def\bbl at withactive#1#2{%
@@ -7459,12 +7527,12 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \begin{macro}{\bbl at redefine}
 %
-%    To redefine a command, we save the old meaning of the macro. Then
-%    we redefine it to call the original macro with the `sanitized'
-%    argument. The reason why we do it this way is that we don't want
-%    to redefine the \LaTeX\ macros completely in case their
-%    definitions change (they have changed in the past). A macro named
-%    |\macro| will be saved new control sequences named |\org at macro|.
+% To redefine a command, we save the old meaning of the macro. Then
+% we redefine it to call the original macro with the `sanitized'
+% argument. The reason why we do it this way is that we don't want
+% to redefine the \LaTeX\ macros completely in case their
+% definitions change (they have changed in the past). A macro named
+% |\macro| will be saved new control sequences named |\org at macro|.
 %
 %    \begin{macrocode}
 \def\bbl at redefine#1{%
@@ -7490,13 +7558,13 @@ help from Bernd Raichle, for which I am grateful.
 %
 %  \end{macro}
 %
-%  \begin{macro}{\bbl at redefinerobust}
-%    For commands that are redefined, but which \textit{might} be
-%    robust we need a slightly more intelligent macro. A robust
-%    command |foo| is defined to expand to |\protect|\verb*|\foo |. So
-%    it is necessary to check whether \verb*|\foo | exists. The result
-%    is that the command that is being redefined is always robust
-%    afterwards.  Therefore all we need to do now is define \verb*|\foo |.
+% \begin{macro}{\bbl at redefinerobust}
+% For commands that are redefined, but which \textit{might} be
+% robust we need a slightly more intelligent macro. A robust
+% command |foo| is defined to expand to |\protect|\verb*|\foo |. So
+% it is necessary to check whether \verb*|\foo | exists. The result
+% is that the command that is being redefined is always robust
+% afterwards.  Therefore all we need to do now is define \verb*|\foo |.
 %
 %    \begin{macrocode}
 \def\bbl at redefinerobust#1{%
@@ -7513,10 +7581,10 @@ help from Bernd Raichle, for which I am grateful.
 %
 % \subsection{Hooks}
 %
-%  Admittedly, the current implementation is a somewhat simplistic and
-%  does very little to catch errors, but it is meant for developers,
-%  after all. |\bbl at usehooks| is the commands used by \babel{} to execute
-%  hooks defined for an event.
+% Admittedly, the current implementation is a somewhat simplistic and
+% does very little to catch errors, but it is meant for developers,
+% after all. |\bbl at usehooks| is the commands used by \babel{} to execute
+% hooks defined for an event.
 %
 %    \begin{macrocode}
 \bbl at trace{Hooks}
@@ -7541,11 +7609,11 @@ help from Bernd Raichle, for which I am grateful.
   \fi}
 %    \end{macrocode}
 %
-%    To ensure forward compatibility, arguments in hooks are set
-%    implicitly. So, if a further argument is added in the future,
-%    there is no need to change the existing code. Note events
-%    intended for \textsf{hyphen.cfg} are also loaded (just in
-%    case you need them for some reason).
+% To ensure forward compatibility, arguments in hooks are set
+% implicitly. So, if a further argument is added in the future,
+% there is no need to change the existing code. Note events
+% intended for \textsf{hyphen.cfg} are also loaded (just in
+% case you need them for some reason).
 %
 %    \begin{macrocode}
 \def\bbl at evargs{,% <- don't delete this comma
@@ -7647,38 +7715,39 @@ help from Bernd Raichle, for which I am grateful.
 % \subsection{Setting up language files}
 %
 % \begin{macro}{\LdfInit}
-%    |\LdfInit| macro takes two arguments. The first
-%    argument is the name of the language that will be defined in the
-%    language definition file; the second argument is either a control
-%    sequence or a string from which a control sequence should be
-%    constructed. The existence of the control sequence indicates that
-%    the file has been processed before.
 %
-%    At the start of processing a language definition file we always
-%    check the category code of the at-sign. We make sure that it is
-%    a `letter' during the processing of the file. We also save its
-%    name as the last called option, even if not loaded.
+% |\LdfInit| macro takes two arguments. The first
+% argument is the name of the language that will be defined in the
+% language definition file; the second argument is either a control
+% sequence or a string from which a control sequence should be
+% constructed. The existence of the control sequence indicates that
+% the file has been processed before.
+%
+% At the start of processing a language definition file we always
+% check the category code of the at-sign. We make sure that it is
+% a `letter' during the processing of the file. We also save its
+% name as the last called option, even if not loaded.
 %
-%    Another character that needs to have the correct category code
-%    during processing of language definition files is the equals sign,
-%    `=', because it is sometimes used in constructions with the
-%    |\let| primitive. Therefore we store its current catcode and
-%    restore it later on.
+% Another character that needs to have the correct category code
+% during processing of language definition files is the equals sign,
+% `=', because it is sometimes used in constructions with the
+% |\let| primitive. Therefore we store its current catcode and
+% restore it later on.
 %
-%    Now we check whether we should perhaps stop the processing of
-%    this file. To do this we first need to check whether the second
-%    argument that is passed to |\LdfInit| is a control sequence. We
-%    do that by looking at the first token after passing |#2| through
-%    |string|. When it is equal to |\@backslashchar| we are dealing
-%    with a control sequence which we can compare with |\@undefined|.
+% Now we check whether we should perhaps stop the processing of
+% this file. To do this we first need to check whether the second
+% argument that is passed to |\LdfInit| is a control sequence. We
+% do that by looking at the first token after passing |#2| through
+% |string|. When it is equal to |\@backslashchar| we are dealing
+% with a control sequence which we can compare with |\@undefined|.
 %
-%   If so, we call |\ldf at quit| to set the main language, restore the
-%   category code of the @-sign and call |\endinput|
+% If so, we call |\ldf at quit| to set the main language, restore the
+% category code of the @-sign and call |\endinput|
 %
-%    When |#2| was \emph{not} a control sequence we construct one and
-%    compare it with |\relax|.
+% When |#2| was \emph{not} a control sequence we construct one and
+% compare it with |\relax|.
 %
-%    Finally we check |\originalTeX|.
+% Finally we check |\originalTeX|.
 %
 %    \begin{macrocode}
 \bbl at trace{Macros for setting language files up}
@@ -7777,11 +7846,11 @@ help from Bernd Raichle, for which I am grateful.
   \bbl at patterns{\languagename}}
 %    \end{macrocode}
 %
-%    We also have to make sure that some code gets executed at the
-%    beginning of the document, either when the |aux| file is read or,
-%    if it does not exist, when the |\AtBeginDocument| is executed.
-%    Languages do not set |\pagedir|, so we set here for the whole
-%    document to the main |\bodydir|.
+% We also have to make sure that some code gets executed at the
+% beginning of the document, either when the |aux| file is read or,
+% if it does not exist, when the |\AtBeginDocument| is executed.
+% Languages do not set |\pagedir|, so we set here for the whole
+% document to the main |\bodydir|.
 %
 %    \begin{macrocode}
 \def\bbl at beforestart{%
@@ -11243,6 +11312,7 @@ help from Bernd Raichle, for which I am grateful.
   \let\foreignlanguage\selectlanguage
   \let\otherlanguage\selectlanguage
   \expandafter\let\csname otherlanguage*\endcsname\selectlanguage
+  \def\bbl at usehooks##1##2{}% TODO. Temporary!!
   \def\setlocale{%
     \errhelp{Find an armchair, sit down and wait}%
     \errmessage{Not yet available}}%
diff --git a/babel.ins b/babel.ins
index 412b2ed..c194325 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{2020/04/26}
+\def\filedate{2020/03/28}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index bd7189b..56405ab 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 064ca18..6a7ba07 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2020/04/26 v3.42.1989]
+\ProvidesFile{bbcompat.dtx}[2020/03/28 v3.43]
 %</dtx>
 %
 %% File 'bbcompat.dtx'
diff --git a/locale/as/babel-as.ini b/locale/as/babel-as.ini
index 5d038bc..19f4e74 100644
--- a/locale/as/babel-as.ini
+++ b/locale/as/babel-as.ini
@@ -8,6 +8,7 @@
 ; * Common Locale Data Repository (license Unicode):
 ;   http://cldr.unicode.org/
 ;   http://unicode.org/copyright.html
+; * Contributors: Navanath Saharia
 
 [identification]
 charset = utf8
diff --git a/locale/fi/babel-fi.ini b/locale/fi/babel-fi.ini
index f28dea8..71a8cd2 100644
--- a/locale/fi/babel-fi.ini
+++ b/locale/fi/babel-fi.ini
@@ -8,6 +8,7 @@
 ; * Common Locale Data Repository (license Unicode):
 ;   http://cldr.unicode.org/
 ;   http://unicode.org/copyright.html
+; * Contributors: Teemu Likonen
 
 [identification]
 charset = utf8
diff --git a/locale/mr/babel-mr.ini b/locale/mr/babel-mr.ini
index 82f693f..2456c00 100644
--- a/locale/mr/babel-mr.ini
+++ b/locale/mr/babel-mr.ini
@@ -8,6 +8,7 @@
 ; * Common Locale Data Repository (license Unicode):
 ;   http://cldr.unicode.org/
 ;   http://unicode.org/copyright.html
+; * With some suggestions by NiranjanTambe
 
 [identification]
 charset = utf8





More information about the latex3-commits mailing list.