[latex3-commits] [git/LaTeX3-latex3-babel] master: Minor reorganization. (91ce58f)

Javier email at dante.de
Tue Sep 29 19:02:09 CEST 2020


Repository : https://github.com/latex3/babel
On branch  : master
Link       : https://github.com/latex3/babel/commit/91ce58f134e17076c61df8503c8af38004dc7c25

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

commit 91ce58f134e17076c61df8503c8af38004dc7c25
Author: Javier <email at localhost>
Date:   Tue Sep 29 19:02:09 2020 +0200

    Minor reorganization.


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

91ce58f134e17076c61df8503c8af38004dc7c25
 README.md    |   4 +-
 babel.dtx    | 251 ++++++++++++++++++++++++++++++-----------------------------
 babel.ins    |   2 +-
 babel.pdf    | Bin 808697 -> 808331 bytes
 bbcompat.dtx |   2 +-
 5 files changed, 132 insertions(+), 127 deletions(-)

diff --git a/README.md b/README.md
index 5550254..7a3a19e 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.48.2141
+## Babel 3.48.2145
 
 This package manages culturally-determined typographical (and other)
 rules, and hyphenation patterns for a wide range of languages.  Many
@@ -46,7 +46,7 @@ respective authors.
 3.49   2020-09-22
        - Allow standard LaTeX syntax to recognize locales based on ini
          files in the most common cases.
-       - [[frenchspacing in ini files.]]
+       - frenchspacing is set with ini files.
        - Fixes:
          - layout.lists=off didn't work (#94)
        
diff --git a/babel.dtx b/babel.dtx
index c975c96..51e3d5b 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -31,7 +31,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2020/09/25 v3.48.2141 The Babel package]
+\ProvidesFile{babel.dtx}[2020/09/29 v3.48.2145 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -289,7 +289,12 @@ In most cases, a single language is required, and then all you need in
 purpose, namely, passing that language as an optional argument. In
 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 @@ Plus ça change, plus c'est la même chose!
 
 \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 @@ in UTF-8 and a so-called Unicode font must be loaded (in this example
 
 \setengine{luatex/xetex}
 \begin{verbatim}
-\documentclass[russian]{article}
+_\documentclass[russian]{article}_
 
-_\usepackage{babel}_
+\usepackage{babel}
 
-\babelfont{rm}{DejaVu Serif}
+_\babelfont{rm}{DejaVu Serif}_
 
 \begin{document}
 
@@ -363,17 +377,6 @@ Or the more explanatory:
 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)
@@ -4744,8 +4747,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.48.2141>>
-%<<date=2020/09/25>>
+%<<version=3.48.2145>>
+%<<date=2020/09/29>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -4895,12 +4898,15 @@ help from Bernd Raichle, for which I am grateful.
 %
 % \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 +5046,25 @@ help from Bernd Raichle, for which I am grateful.
   \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}
 %
@@ -7358,37 +7383,10 @@ help from Bernd Raichle, for which I am grateful.
       \fi
     \fi
   \bbl at esphack
-  % (non)french spacing (1/2) save current values
-  \def\bbl at elt##1##2##3{\sfcode`##1=\the\sfcode`##1\relax}%
-  \edef\bbl at fs@presave{\bbl at fs@chars}%
-  %\show\bbl at fs@presave
   % switch extras
   \bbl at usehooks{beforeextras}{}%
   \csname extras#1\endcsname\relax
   \bbl at usehooks{afterextras}{}%
-  % (non)french spacing (2/2) set new values
-  \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
-       \bbl at fs@presave        % ignore settings in extras
-       \def\bbl at elt##1##2##3{%
-         \ifnum\sfcode`##1=##2\relax
-           \babel at savevariable{\sfcode`##1}%
-           \sfcode`##1=##3\relax
-         \fi}%
-       \bbl at fs@chars
-     \else\if y\bbl at tempa     % french
-       \bbl at fs@presave        % ignore settings in extras
-       \def\bbl at elt##1##2##3{%
-         \ifnum\sfcode`##1=##3\relax
-           \babel at savevariable{\sfcode`##1}%
-           \sfcode`##1=##2\relax
-         \fi}%
-       \bbl at fs@chars
-     \fi\fi\fi
-     }%
   %  > babel-ensure
   %  > babel-sh-<short>
   %  > babel-bidi
@@ -10718,45 +10716,6 @@ help from Bernd Raichle, for which I am grateful.
   \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}
-\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}
@@ -10793,14 +10752,43 @@ help from Bernd Raichle, for which I am grateful.
     \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 == TODO. In both new and renew, so-
   \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}%
@@ -10821,6 +10809,16 @@ help from Bernd Raichle, for which I am grateful.
 % 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}%
@@ -10830,21 +10828,12 @@ help from Bernd Raichle, for which I am grateful.
   \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:
@@ -10934,6 +10923,8 @@ help from Bernd Raichle, for which I am grateful.
        is not complete.}%
       {Fix the name or reinstall babel.}%
   \else
+    \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\\%
@@ -11115,19 +11106,10 @@ help from Bernd Raichle, for which I am grateful.
     \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}%  TODO. Unused?
-  \bbl at exportkey{frspc}{typography.frenchspacing}{u}% unset
-  \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}
@@ -11320,18 +11302,6 @@ help from Bernd Raichle, for which I am grateful.
 % 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
@@ -11467,8 +11437,6 @@ help from Bernd Raichle, for which I am grateful.
         \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
@@ -11503,14 +11471,51 @@ help from Bernd Raichle, for which I am grateful.
   \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}}}
 %    \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.
 %
diff --git a/babel.ins b/babel.ins
index 94a4720..50468a1 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/09/25}
+\def\filedate{2020/09/29}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 023bd60..59c44c0 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 91a0f6b..02e3f6d 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2020/09/25 v3.48.2141]
+\ProvidesFile{bbcompat.dtx}[2020/09/29 v3.48.2145]
 %</dtx>
 %
 %% File 'bbcompat.dtx'





More information about the latex3-commits mailing list.