texlive[71407] Master/texmf-dist: babel (2jun24)

commits+karl at tug.org commits+karl at tug.org
Sun Jun 2 22:24:11 CEST 2024


Revision: 71407
          https://tug.org/svn/texlive?view=revision&revision=71407
Author:   karl
Date:     2024-06-02 22:24:10 +0200 (Sun, 02 Jun 2024)
Log Message:
-----------
babel (2jun24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/babel/README.md
    trunk/Master/texmf-dist/doc/latex/babel/babel-code.pdf
    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-transforms.lua
    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/luababel.def
    trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
    trunk/Master/texmf-dist/tex/generic/babel/txtbabel.def
    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	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/doc/latex/babel/README.md	2024-06-02 20:24:10 UTC (rev 71407)
@@ -1,6 +1,6 @@
-## Babel 24.5
+## Babel 24.6
 
-2024-05-18
+2024-06-02
 
 `babel` is the multilingual framework for localizing documents in
 LaTeX, LuaLaTeX, XeLaTeX. It manages culturally-determined
@@ -10,9 +10,9 @@
 
 The latest stable version is available on <https://ctan.org/pkg/babel>.
 
-Changes in version 24.5 are described in:
+Changes in version 24.6 are described in:
 
-https://latex3.github.io/babel/news/whats-new-in-babel-24.5.html
+https://latex3.github.io/babel/news/whats-new-in-babel-24.6.html
 
 Apart from the manual, you can find information on some aspects of babel at:
 
@@ -48,16 +48,11 @@
 
 ### Summary of latest changes
 ```
-24.5 2024-05-18
-     * Change the first item in `abjad` and `maghrebi.abjad` counters
-       in `ar-DZ`, `ar-MA` and `ar-TN`), from ا to أ. Suggested by
-       @seloumi.
-     * Fixed an error when a locale is loaded on the fly and there are empty
-       captions in another language (#294)
-     * Fix in transforms (lua): negative values in `space` and `spacefactor`
-       raised and error.
+24.6  2024-06-02
+      * New keys in transforms (lua): kern, norule, after, node.
 ```
 
+
 ### Previous changes
 
 See https://latex3.github.io/babel/#whats-new

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

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	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.dtx	2024-06-02 20:24:10 UTC (rev 71407)
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2024/05/18 v24.5 The Babel package]
+\ProvidesFile{babel.dtx}[2024/06/02 v24.6 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -865,7 +865,7 @@
 \begin{warning}
   Being similar to |\selectlanguage|, the warning above about the
   internal |\write| also applies here. The current mode (vertical or
-  horizonal) is also not changed.
+  horizontal) is also not changed.
 \end{warning}
 
 \Describe{\begin\menv{otherlanguage*}}%
@@ -1600,7 +1600,7 @@
 |\babelprovide| with a valueless |import|, which will load the |ini|
 file with the tag given in parenthesis.
 
-Many locale are quite useable, provided captions and dates are
+Many locale are quite usable, provided captions and dates are
 not required (which is a very frequent case, particularly in ancient
 languages). So, they are included in the default \babel{} distribution.
 This can serve to encourage contributions, too. A warning will remember
@@ -2731,12 +2731,12 @@
 Sets the interword space for the writing system of the language, in em
 units (so, |0 .1 0| is |0em plus .1em|). Like |\spaceskip|, the em unit
 applied is that of the current text (more precisely, the previous 
-glyph). Currently used only in Southeast Asian scrips, like Thai, and
+glyph). Currently used only in Southeast Asian scripts, like Thai, and
 CJK.
 
 \Describe{intrapenalty=}{\meta{penalty}}
 Sets the interword penalty for the writing system of this language.
-Currently used only in Southeast Asian scrips, like Thai. Ignored if 0
+Currently used only in Southeast Asian scripts, like Thai. Ignored if 0
 (which is the default value).
 
 \Describe{transforms=}{\meta{transform-list}}
@@ -3148,7 +3148,7 @@
 identifier, which can be retrieved with |\localeid|.
 
 The |\localeid| is not the same as the |\language| identifier, which
-refers to a set of hyphenation patters (which, in turn, is just a
+refers to a set of hyphenation patterns (which, in turn, is just a
 component of the line breaking algorithm described in the next
 section). The data about preloaded patterns are store in an internal
 macro named |\bbl at languages| (see the code for further details), but
@@ -3901,7 +3901,7 @@
 in the wrong order.
 
 In \luatex, the preferred method is |basic|, which supports both L and
-R text. |basic-r| was a first attempt to create a bidi algorith and
+R text. |basic-r| was a first attempt to create a bidi algorithm and
 provides a simple and fast method for R text in some typical cases.
 (They are named \texttt{basic} mainly because they only consider the
 intrinsic direction of scripts and weak directionality.)
@@ -4131,7 +4131,7 @@
 order is \textit{RTL B and still ltr 1 ltr text RTL A}. This is by
 design to provide the proper behavior in the most usual cases — but if
 you need to use |\ref| in an L text inside R, the L text must be marked
-up explictly; for example:
+up explicitly; for example:
 \begin{verbatim}
 RTL A \foreignlanguage{english}{ltr text \thechapter{} and still ltr} RTL B
 \end{verbatim}
@@ -5479,8 +5479,8 @@
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=24.5>>
-%<<date=2024/05/18>>
+%<<version=24.6>>
+%<<date=2024/06/02>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -11537,7 +11537,7 @@
   \typeout{*******}}
 %    \end{macrocode}
 %
-% \section{Adjusting the Babel bahavior}
+% \section{Adjusting the Babel behavior}
 %
 % A generic high level interface is provided to adjust some global
 % and general settings.
@@ -11997,7 +11997,7 @@
 %    documentclasses \cls{report} and \cls{book} define and set the
 %    headings for the page. While doing so they also store a copy of
 %    |\markboth| in |\@mkboth|. Therefore we need to check whether
-%    |\@mkboth| has already been set. If so we neeed to do that again
+%    |\@mkboth| has already been set. If so we need to do that again
 %    with the new definition of |\markboth|. (As of Oct 2019, \LaTeX{}
 %    stores the definition in an intermediate macro, so it's not
 %    necessary anymore, but it's preserved for older versions.)
@@ -12111,7 +12111,7 @@
 %    \end{macrocode}
 %
 % The package \pkg{varioref} defines |\Ref| to be a robust command
-% wich uppercases the first character of the reference text. In
+% which uppercases the first character of the reference text. In
 % order to be able to do that it needs to access the expandable form
 % of |\ref|. So we employ a little trick here. We redefine the
 % (internal) command \verb*|\Ref | to call |\org at ref| instead of
@@ -12395,16 +12395,16 @@
   \fi
 \fi
 % TODO? Separate:
-\ifnum\bbl at bidimode=\@ne % Any bidi= except default=1
+\ifnum\bbl at bidimode=\@ne % bidi=default
   \let\bbl at beforeforeign\leavevmode
-  \ifodd\bbl at engine
+  \ifodd\bbl at engine % lua
     \newattribute\bbl at attr@dir
     \directlua{ Babel.attr_dir = luatexbase.registernumber'bbl at attr@dir' }
     \bbl at exp{\output{\bodydir\pagedir\the\output}}
   \fi
   \AtEndOfPackage{%
-    \EnableBabelHook{babel-bidi}%
-    \ifodd\bbl at engine\else
+    \EnableBabelHook{babel-bidi}% pdf/lua/xe
+    \ifodd\bbl at engine\else % pdf/xe
       \bbl at xebidipar
     \fi}
 \fi
@@ -13995,12 +13995,12 @@
 %<*xetex|texxet>
 \providecommand\bbl at provide@intraspace{}
 \bbl at trace{Redefinitions for bidi layout}
-\def\bbl at sspre@caption{%
+\def\bbl at sspre@caption{%  TODO: Unused!
   \bbl at exp{\everyhbox{\\\bbl at textdir\bbl at cs{wdir@\bbl at main@language}}}}
 \ifx\bbl at opt@layout\@nnil\else % if layout=.. 
 \def\bbl at startskip{\ifcase\bbl at thepardir\leftskip\else\rightskip\fi}
 \def\bbl at endskip{\ifcase\bbl at thepardir\rightskip\else\leftskip\fi}
-\ifx\bbl at beforeforeign\leavevmode % A poor test for bidi=
+\ifnum\bbl at bidimode>\z@  % TODO: always?
   \def\@hangfrom#1{%
     \setbox\@tempboxa\hbox{{#1}}%
     \hangindent\ifcase\bbl at thepardir\wd\@tempboxa\else-\wd\@tempboxa\fi
@@ -14092,7 +14092,7 @@
 %
 % Which start just above, because some code is shared with \xetex. Now,
 % 8-bit specific stuff. If just one encoding has been declared, then
-% asume no switching is necessary (1). 
+% assume no switching is necessary (1). 
 %
 %    \begin{macrocode}
 %<*texxet>
@@ -14357,6 +14357,7 @@
 \endinput\fi
   % Here stops reading code for hyphen.cfg
   % The following is read the 2nd time it's loaded
+  % First, global declarations for lua
 \begingroup  % TODO - to a lua file
 \catcode`\%=12
 \catcode`\'=12
@@ -14364,6 +14365,10 @@
 \catcode`\:=12
 \directlua{
   Babel = Babel or {}
+  function Babel.lua_error(e, a)
+    tex.print([[\noexpand\csname bbl at error\endcsname{]] .. 
+      e .. '}{' .. (a or '') .. '}{}{}')
+  end
   function Babel.bytes(line)
     return line:gsub("(.)",
       function (chr) return unicode.utf8.char(string.byte(chr)) end)
@@ -15323,7 +15328,12 @@
            local rep = [=[##1]=]             
            rep = rep:gsub('^%s*(remove)%s*$', 'remove = true')
            rep = rep:gsub('^%s*(insert)%s*,', 'insert = true, ')
+           rep = rep:gsub('^%s*(after)%s*,', 'after = true, ')
            rep = rep:gsub('(string)%s*=%s*([^%s,]*)', Babel.capture_func)
+           rep = rep:gsub('node%s*=%s*(%a+)%s*(%a*)', Babel.capture_node)
+           rep = rep:gsub(&%
+             '(norule)%s*=%s*([%-%d%.]+)%s+([%-%d%.]+)%s+([%-%d%.]+)',
+             'norule = {' .. '%2, %3, %4' .. '}')
            if #1 == 0 or #1 == 2 then
              rep = rep:gsub(&%
                '(space)%s*=%s*([%-%d%.]+)%s+([%-%d%.]+)%s+([%-%d%.]+)',
@@ -15342,7 +15352,7 @@
     \bbl at foreach\babeltempb{&%
       \bbl at forkv{{##1}}{&%
         \in@{,####1,}{,nil,step,data,remove,insert,string,no,pre,&%
-            no,post,penalty,kashida,space,spacefactor,}&%
+          no,post,penalty,kashida,space,spacefactor,kern,node,after,}&%
         \ifin@\else
           \bbl at error{bad-transform-option}{####1}{}{}&%
         \fi}}&% 
@@ -16358,6 +16368,7 @@
           print('=====')
         end
         local new  -- used when inserting and removing nodes
+        local dummy_node -- used by after
 
         local matches = { u.match(w, p, last_match) }
 
@@ -16402,7 +16413,8 @@
         -- rc = the replacement table index
         local rc = 0
 
-        while rc < last-first+1 do -- for each replacement
+------- TODO. dummy_node?
+        while rc < last-first+1 or dummy_node do -- for each replacement
           if Babel.debug then
             print('.....', rc + 1)
           end
@@ -16434,11 +16446,31 @@
           end
 
           if crep then
-            step = crep.step or 0
+            step = crep.step or step
           end
+          
+          if crep and crep.after then
+            crep.insert = true
+            if dummy_node then
+              item = dummy_node
+            else -- TODO. if there is a node after?
+              d = node.copy(item_base)
+              head, item = node.insert_after(head, item, d)
+              dummy_node = item
+            end
+          end
+          
+          if crep and not crep.after and dummy_node then
+            node.remove(head, dummy_node)
+            dummy_node = nil
+          end
 
           if (not enabled) or (crep and next(crep) == nil) then -- = {}
-            last_match = save_last    -- Optimization
+            if step == 0 then
+              last_match = save_last    -- Optimization
+            else
+              last_match = utf8.offset(w, sc+step)
+            end
             goto next
 
           elseif crep == nil or crep.remove then
@@ -16448,7 +16480,7 @@
             sc = sc - 1  -- Nothing has been inserted.
             last_match = utf8.offset(w, sc+1+step)
             goto next
-
+            
           elseif crep and crep.kashida then -- Experimental
             node.set_attribute(item,
                Babel.attr_kashida, 
@@ -16526,6 +16558,15 @@
               placeholder = ' '
             end
             head, new = node.insert_before(head, item, d)
+            
+          elseif crep and crep.norule then
+            -- 655360 = 10 pt = 10 * 65536 sp
+            d = node.new(2, 3)      -- (rule, empty) = \no*rule
+            local quad = font.getfont(item_base.font).size or 655360
+            d.width   = crep.norule[1] * quad
+            d.height  = crep.norule[2] * quad
+            d.depth   = crep.norule[3] * quad
+            head, new = node.insert_before(head, item, d)
 
           elseif crep and crep.spacefactor then
             d = node.new(12, 13)      -- (glue, spaceskip)
@@ -16541,10 +16582,22 @@
 
           elseif mode == 0 and crep and crep.space then
             -- ERROR
+            
+          elseif crep and crep.kern then
+            d = node.new(13, 1)      -- (kern, user)
+            local quad = font.getfont(item_base.font).size or 655360
+            d.attr = item_base.attr
+            d.kern = crep.kern * quad
+            head, new = node.insert_before(head, item, d)
+            
+          elseif crep and crep.node then
+            d = node.new(crep.node[1], crep.node[2])  
+            d.attr = item_base.attr
+            head, new = node.insert_before(head, item, d)
 
           end  -- ie replacement cases
 
-          -- Shared by disc, space and penalty.
+          -- Shared by disc, space(factor), kern, node and penalty.
           if sc == 1 then
             word_head = head
           end
@@ -16568,6 +16621,11 @@
             print('.....', '/')
             Babel.debug_hyph(w, w_nodes, sc, first, last, last_match)
         end
+      
+      if dummy_node then
+        node.remove(head, dummy_node)
+        dummy_node = nil
+      end
 
       end  -- for match
 
@@ -16649,6 +16707,14 @@
   return 'kashida = ' .. wt
 end
 
+function Babel.capture_node(id, subtype)
+  local sbt = 0
+  for k, v in pairs(node.subtypes(id)) do
+    if v == subtype then sbt = k end
+  end
+  return 'node = {' .. node.id(id) .. ', ' .. sbt .. '}'
+end
+
 -- Experimental: applies prehyphenation transforms to a string (letters
 -- and spaces). 
 function Babel.string_prehyphenation(str, locale)

Modified: trunk/Master/texmf-dist/source/latex/babel/babel.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/babel.ins	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/source/latex/babel/babel.ins	2024-06-02 20:24:10 UTC (rev 71407)
@@ -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{2024/05/18}
+\def\filedate{2024/06/02}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
@@ -48,7 +48,7 @@
 % Modify docstrip. A pseudo-guard is defined to set variables:
 % <<name=value>>. These variables are used with <@name@> Two further
 % pseudo-guards define "block" variables: <<*name>> and <</name>>
-% delimite the lines to be retrived with <@name@>. Note the verbatim
+% delimite the lines to be retrieved with <@name@>. Note the verbatim
 % guard is overridden, but it's not used here.  This is done in two
 % passes: 1) with saving true, there is a dummy pass, generating
 % nothing, but blocks are read and saved; 2) with saving false, blocks

Modified: trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/source/latex/babel/bbcompat.dtx	2024-06-02 20:24:10 UTC (rev 71407)
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2024/05/18 v24.5]
+\ProvidesFile{bbcompat.dtx}[2024/06/02 v24.6]
 %</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-transforms.lua
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel-transforms.lua	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel-transforms.lua	2024-06-02 20:24:10 UTC (rev 71407)
@@ -227,6 +227,7 @@
           print('=====')
         end
         local new  -- used when inserting and removing nodes
+        local dummy_node -- used by after
 
         local matches = { u.match(w, p, last_match) }
 
@@ -271,7 +272,8 @@
         -- rc = the replacement table index
         local rc = 0
 
-        while rc < last-first+1 do -- for each replacement
+------- TODO. dummy_node?
+        while rc < last-first+1 or dummy_node do -- for each replacement
           if Babel.debug then
             print('.....', rc + 1)
           end
@@ -303,11 +305,31 @@
           end
 
           if crep then
-            step = crep.step or 0
+            step = crep.step or step
           end
 
+          if crep and crep.after then
+            crep.insert = true
+            if dummy_node then
+              item = dummy_node
+            else -- TODO. if there is a node after?
+              d = node.copy(item_base)
+              head, item = node.insert_after(head, item, d)
+              dummy_node = item
+            end
+          end
+
+          if crep and not crep.after and dummy_node then
+            node.remove(head, dummy_node)
+            dummy_node = nil
+          end
+
           if (not enabled) or (crep and next(crep) == nil) then -- = {}
-            last_match = save_last    -- Optimization
+            if step == 0 then
+              last_match = save_last    -- Optimization
+            else
+              last_match = utf8.offset(w, sc+step)
+            end
             goto next
 
           elseif crep == nil or crep.remove then
@@ -396,6 +418,15 @@
             end
             head, new = node.insert_before(head, item, d)
 
+          elseif crep and crep.norule then
+            -- 655360 = 10 pt = 10 * 65536 sp
+            d = node.new(2, 3)      -- (rule, empty) = \no*rule
+            local quad = font.getfont(item_base.font).size or 655360
+            d.width   = crep.norule[1] * quad
+            d.height  = crep.norule[2] * quad
+            d.depth   = crep.norule[3] * quad
+            head, new = node.insert_before(head, item, d)
+
           elseif crep and crep.spacefactor then
             d = node.new(12, 13)      -- (glue, spaceskip)
             local base_font = font.getfont(item_base.font)
@@ -411,9 +442,21 @@
           elseif mode == 0 and crep and crep.space then
             -- ERROR
 
+          elseif crep and crep.kern then
+            d = node.new(13, 1)      -- (kern, user)
+            local quad = font.getfont(item_base.font).size or 655360
+            d.attr = item_base.attr
+            d.kern = crep.kern * quad
+            head, new = node.insert_before(head, item, d)
+
+          elseif crep and crep.node then
+            d = node.new(crep.node[1], crep.node[2])
+            d.attr = item_base.attr
+            head, new = node.insert_before(head, item, d)
+
           end  -- ie replacement cases
 
-          -- Shared by disc, space and penalty.
+          -- Shared by disc, space(factor), kern, node and penalty.
           if sc == 1 then
             word_head = head
           end
@@ -438,6 +481,11 @@
             Babel.debug_hyph(w, w_nodes, sc, first, last, last_match)
         end
 
+      if dummy_node then
+        node.remove(head, dummy_node)
+        dummy_node = nil
+      end
+
       end  -- for match
 
     end  -- for patterns
@@ -518,6 +566,14 @@
   return 'kashida = ' .. wt
 end
 
+function Babel.capture_node(id, subtype)
+  local sbt = 0
+  for k, v in pairs(node.subtypes(id)) do
+    if v == subtype then sbt = k end
+  end
+  return 'node = {' .. node.id(id) .. ', ' .. sbt .. '}'
+end
+
 -- Experimental: applies prehyphenation transforms to a string (letters
 -- and spaces).
 function Babel.string_prehyphenation(str, locale)

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.def	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.def	2024-06-02 20:24:10 UTC (rev 71407)
@@ -40,7 +40,7 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{babel.def}[2024/05/18 v24.5 Babel common definitions]
+\ProvidesFile{babel.def}[2024/06/02 v24.6 Babel common definitions]
 \ifx\AtBeginDocument\@undefined  % TODO. change test.
   \def\@empty{}
 \def\loadlocalcfg#1{%
@@ -596,8 +596,8 @@
     \toks@\expandafter{\bbl at tempc#3}%
     \expandafter\edef\csname extras\languagename\endcsname{\the\toks@}%
   \fi}
-\def\bbl at version{24.5}
-\def\bbl at date{2024/05/18}
+\def\bbl at version{24.6}
+\def\bbl at date{2024/06/02}
 \ifx\language\@undefined
   \csname newcount\endcsname\language
 \fi

Modified: trunk/Master/texmf-dist/tex/generic/babel/babel.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/tex/generic/babel/babel.sty	2024-06-02 20:24:10 UTC (rev 71407)
@@ -34,7 +34,7 @@
 %%
 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{babel}[2024/05/18 v24.5 The Babel package]
+\ProvidesPackage{babel}[2024/06/02 v24.6 The Babel package]
 \@ifpackagewith{babel}{debug}
   {\providecommand\bbl at trace[1]{\message{^^J[ #1 ]}}%
    \let\bbl at debug\@firstofone
@@ -466,8 +466,8 @@
       \expandafter\@secondoftwo
     \fi}
 \fi
-\def\bbl at version{24.5}
-\def\bbl at date{2024/05/18}
+\def\bbl at version{24.6}
+\def\bbl at date{2024/06/02}
 \ifx\language\@undefined
   \csname newcount\endcsname\language
 \fi
@@ -3963,16 +3963,16 @@
     \fi
   \fi
 \fi
-\ifnum\bbl at bidimode=\@ne % Any bidi= except default=1
+\ifnum\bbl at bidimode=\@ne % bidi=default
   \let\bbl at beforeforeign\leavevmode
-  \ifodd\bbl at engine
+  \ifodd\bbl at engine % lua
     \newattribute\bbl at attr@dir
     \directlua{ Babel.attr_dir = luatexbase.registernumber'bbl at attr@dir' }
     \bbl at exp{\output{\bodydir\pagedir\the\output}}
   \fi
   \AtEndOfPackage{%
-    \EnableBabelHook{babel-bidi}%
-    \ifodd\bbl at engine\else
+    \EnableBabelHook{babel-bidi}% pdf/lua/xe
+    \ifodd\bbl at engine\else % pdf/xe
       \bbl at xebidipar
     \fi}
 \fi

Modified: trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/tex/generic/babel/hyphen.cfg	2024-06-02 20:24:10 UTC (rev 71407)
@@ -38,10 +38,10 @@
     \wlog{File: #1 #4 #3 <#2>}%
     \let\ProvidesFile\@undefined}
 \fi
-\ProvidesFile{hyphen.cfg}[2024/05/18 v24.5 Babel hyphens]
+\ProvidesFile{hyphen.cfg}[2024/06/02 v24.6 Babel hyphens]
 \xdef\bbl at format{\jobname}
-\def\bbl at version{24.5}
-\def\bbl at date{2024/05/18}
+\def\bbl at version{24.6}
+\def\bbl at date{2024/06/02}
 \ifx\AtBeginDocument\@undefined
   \def\@empty{}
 \fi

Modified: trunk/Master/texmf-dist/tex/generic/babel/luababel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/luababel.def	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/tex/generic/babel/luababel.def	2024-06-02 20:24:10 UTC (rev 71407)
@@ -197,6 +197,7 @@
 \endinput\fi
   % Here stops reading code for hyphen.cfg
   % The following is read the 2nd time it's loaded
+  % First, global declarations for lua
 \begingroup  % TODO - to a lua file
 \catcode`\%=12
 \catcode`\'=12
@@ -204,6 +205,10 @@
 \catcode`\:=12
 \directlua{
   Babel = Babel or {}
+  function Babel.lua_error(e, a)
+    tex.print([[\noexpand\csname bbl at error\endcsname{]] ..
+      e .. '}{' .. (a or '') .. '}{}{}')
+  end
   function Babel.bytes(line)
     return line:gsub("(.)",
       function (chr) return unicode.utf8.char(string.byte(chr)) end)
@@ -1220,7 +1225,12 @@
            local rep = [=[##1]=]
            rep = rep:gsub('^%s*(remove)%s*$', 'remove = true')
            rep = rep:gsub('^%s*(insert)%s*,', 'insert = true, ')
+           rep = rep:gsub('^%s*(after)%s*,', 'after = true, ')
            rep = rep:gsub('(string)%s*=%s*([^%s,]*)', Babel.capture_func)
+           rep = rep:gsub('node%s*=%s*(%a+)%s*(%a*)', Babel.capture_node)
+           rep = rep:gsub(&%
+             '(norule)%s*=%s*([%-%d%.]+)%s+([%-%d%.]+)%s+([%-%d%.]+)',
+             'norule = {' .. '%2, %3, %4' .. '}')
            if #1 == 0 or #1 == 2 then
              rep = rep:gsub(&%
                '(space)%s*=%s*([%-%d%.]+)%s+([%-%d%.]+)%s+([%-%d%.]+)',
@@ -1239,7 +1249,7 @@
     \bbl at foreach\babeltempb{&%
       \bbl at forkv{{##1}}{&%
         \in@{,####1,}{,nil,step,data,remove,insert,string,no,pre,&%
-            no,post,penalty,kashida,space,spacefactor,}&%
+          no,post,penalty,kashida,space,spacefactor,kern,node,after,}&%
         \ifin@\else
           \bbl at error{bad-transform-option}{####1}{}{}&%
         \fi}}&%

Modified: trunk/Master/texmf-dist/tex/generic/babel/nil.ldf
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/tex/generic/babel/nil.ldf	2024-06-02 20:24:10 UTC (rev 71407)
@@ -33,7 +33,7 @@
 %% extension |.ins|) which are part of the distribution.
 %%
 
-\ProvidesLanguage{nil}[2024/05/18 v24.5 Nil language]
+\ProvidesLanguage{nil}[2024/06/02 v24.6 Nil language]
 \LdfInit{nil}{datenil}
 \ifx\l at nil\@undefined
   \newlanguage\l at nil

Modified: trunk/Master/texmf-dist/tex/generic/babel/txtbabel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/txtbabel.def	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/tex/generic/babel/txtbabel.def	2024-06-02 20:24:10 UTC (rev 71407)
@@ -35,12 +35,12 @@
 
 \providecommand\bbl at provide@intraspace{}
 \bbl at trace{Redefinitions for bidi layout}
-\def\bbl at sspre@caption{%
+\def\bbl at sspre@caption{%  TODO: Unused!
   \bbl at exp{\everyhbox{\\\bbl at textdir\bbl at cs{wdir@\bbl at main@language}}}}
 \ifx\bbl at opt@layout\@nnil\else % if layout=..
 \def\bbl at startskip{\ifcase\bbl at thepardir\leftskip\else\rightskip\fi}
 \def\bbl at endskip{\ifcase\bbl at thepardir\rightskip\else\leftskip\fi}
-\ifx\bbl at beforeforeign\leavevmode % A poor test for bidi=
+\ifnum\bbl at bidimode>\z@  % TODO: always?
   \def\@hangfrom#1{%
     \setbox\@tempboxa\hbox{{#1}}%
     \hangindent\ifcase\bbl at thepardir\wd\@tempboxa\else-\wd\@tempboxa\fi

Modified: trunk/Master/texmf-dist/tex/generic/babel/xebabel.def
===================================================================
--- trunk/Master/texmf-dist/tex/generic/babel/xebabel.def	2024-06-02 20:23:05 UTC (rev 71406)
+++ trunk/Master/texmf-dist/tex/generic/babel/xebabel.def	2024-06-02 20:24:10 UTC (rev 71407)
@@ -386,12 +386,12 @@
     {\bbl at csarg\let{ic@#1@\languagename}\@gobble}}
 \providecommand\bbl at provide@intraspace{}
 \bbl at trace{Redefinitions for bidi layout}
-\def\bbl at sspre@caption{%
+\def\bbl at sspre@caption{%  TODO: Unused!
   \bbl at exp{\everyhbox{\\\bbl at textdir\bbl at cs{wdir@\bbl at main@language}}}}
 \ifx\bbl at opt@layout\@nnil\else % if layout=..
 \def\bbl at startskip{\ifcase\bbl at thepardir\leftskip\else\rightskip\fi}
 \def\bbl at endskip{\ifcase\bbl at thepardir\rightskip\else\leftskip\fi}
-\ifx\bbl at beforeforeign\leavevmode % A poor test for bidi=
+\ifnum\bbl at bidimode>\z@  % TODO: always?
   \def\@hangfrom#1{%
     \setbox\@tempboxa\hbox{{#1}}%
     \hangindent\ifcase\bbl at thepardir\wd\@tempboxa\else-\wd\@tempboxa\fi



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