[latex3-commits] [git/LaTeX3-latex3-babel] main: Fixed #207. \babel at save saves only the first time. (f0532c8)
Javier
email at dante.de
Tue Dec 13 14:49:40 CET 2022
Repository : https://github.com/latex3/babel
On branch : main
Link : https://github.com/latex3/babel/commit/f0532c802711523f45e393928792b7f5b55c3bc6
>---------------------------------------------------------------
commit f0532c802711523f45e393928792b7f5b55c3bc6
Author: Javier <email at localhost>
Date: Tue Dec 13 14:49:40 2022 +0100
Fixed #207. \babel at save saves only the first time.
>---------------------------------------------------------------
f0532c802711523f45e393928792b7f5b55c3bc6
README.md | 2 +-
babel.dtx | 134 +++++++++++++++++++++++++++++++++--------------------------
babel.ins | 2 +-
babel.pdf | Bin 899537 -> 900444 bytes
bbcompat.dtx | 2 +-
5 files changed, 78 insertions(+), 62 deletions(-)
diff --git a/README.md b/README.md
index b51fbea..e81bb9e 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.83.2945
+## Babel 3.83.2950
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
diff --git a/babel.dtx b/babel.dtx
index db0462d..6778b96 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2022/12/08 v3.83.2945 The Babel package]
+\ProvidesFile{babel.dtx}[2022/12/13 v3.83.2950 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -5194,8 +5194,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.83.2945>>
-%<<date=2022/12/08>>
+%<<version=3.83.2950>>
+%<<date=2022/12/13>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -6489,6 +6489,7 @@ help from Bernd Raichle, for which I am grateful.
%
% \begin{macrocode}
\newif\ifbbl at usedategroup
+\let\bbl at savedextras\@empty
\def\bbl at switch#1{% from select@, foreign@
% make sure there is info for the language if so requested
\bbl at ensureinfo{#1}%
@@ -6521,6 +6522,7 @@ help from Bernd Raichle, for which I am grateful.
\fi
\bbl at esphack
% switch extras
+ \csname bbl at preextras@#1\endcsname
\bbl at usehooks{beforeextras}{}%
\csname extras#1\endcsname\relax
\bbl at usehooks{afterextras}{}%
@@ -6528,6 +6530,7 @@ help from Bernd Raichle, for which I am grateful.
% > babel-sh-<short>
% > babel-bidi
% > babel-fontspec
+ \let\bbl at savedextras\@empty
% hyphenation - case mapping
\ifcase\bbl at opt@hyphenmap\or
\def\BabelLower##1##2{\lccode##1=##2\relax}%
@@ -8446,15 +8449,23 @@ help from Bernd Raichle, for which I am grateful.
% are appended to |\originalTeX| and the counter is incremented. The
% macro |\babel at savevariable|\meta{variable} saves the value of the
% variable. \meta{variable} can be anything allowed after the |\the|
-% primitive.
+% primitive. To avoid messing saved definitions up, they are saved only
+% the very first time.
%
% \begin{macrocode}
\def\babel at save#1{%
- \expandafter\let\csname babel@\number\babel at savecnt\endcsname#1\relax
- \toks@\expandafter{\originalTeX\let#1=}%
- \bbl at exp{%
- \def\\\originalTeX{\the\toks@\<babel@\number\babel at savecnt>\relax}}%
- \advance\babel at savecnt\@ne}
+ \def\bbl at tempa{{,#1,}}% Clumsy, for Plain
+ \expandafter\bbl at add\expandafter\bbl at tempa\expandafter{%
+ \expandafter{\expandafter,\bbl at savedextras,}}%
+ \expandafter\in@\bbl at tempa
+ \ifin@\else
+ \bbl at add\bbl at savedextras{,#1,}%
+ \bbl at carg\let{babel@\number\babel at savecnt}#1\relax
+ \toks@\expandafter{\originalTeX\let#1=}%
+ \bbl at exp{%
+ \def\\\originalTeX{\the\toks@\<babel@\number\babel at savecnt>\relax}}%
+ \advance\babel at savecnt\@ne
+ \fi}
\def\babel at savevariable#1{%
\toks@\expandafter{\originalTeX #1=}%
\bbl at exp{\def\\\originalTeX{\the\toks@\the#1\relax}}}
@@ -10016,62 +10027,18 @@ help from Bernd Raichle, for which I am grateful.
\fi}%
\fi
% == Counters: mapdigits ==
- % Native digits (lua level).
- \ifodd\bbl at engine
- \ifx\bbl at KVP@mapdigits\@nnil\else
- \bbl at ifunset{bbl at dgnat@\languagename}{}%
- {\RequirePackage{luatexbase}%
- \bbl at activate@preotf
- \directlua{
- Babel = Babel or {} %%% -> presets in luababel
- Babel.digits_mapped = true
- Babel.digits = Babel.digits or {}
- Babel.digits[\the\localeid] =
- table.pack(string.utfvalue('\bbl at cl{dgnat}'))
- if not Babel.numbers then
- function Babel.numbers(head)
- local LOCALE = Babel.attr_locale
- local GLYPH = node.id'glyph'
- local inmath = false
- for item in node.traverse(head) do
- if not inmath and item.id == GLYPH then
- local temp = node.get_attribute(item, LOCALE)
- if Babel.digits[temp] then
- local chr = item.char
- if chr > 47 and chr < 58 then
- item.char = Babel.digits[temp][chr-47]
- end
- end
- elseif item.id == node.id'math' then
- inmath = (item.subtype == 0)
- end
- end
- return head
- end
- end
- }}%
- \fi
- \fi
+ % > luababel.def
% == Counters: alph, Alph ==
- % What if extras<lang> contains a \babel at save\@alph? It won't be
- % restored correctly when exiting the language, so we ignore
- % this change with the \bbl at alph@saved trick.
\ifx\bbl at KVP@alph\@nnil\else
- \bbl at extras@wrap{\\\bbl at alph@saved}%
- {\let\bbl at alph@saved\@alph}%
- {\let\@alph\bbl at alph@saved
- \babel at save\@alph}%
\bbl at exp{%
- \\\bbl at add\<extras\languagename>{%
+ \\\bbl at add\<bbl at preextras@\languagename>{%
+ \\\babel at save\\\@alph
\let\\\@alph\<bbl at cntr@\bbl at KVP@alph @\languagename>}}%
\fi
\ifx\bbl at KVP@Alph\@nnil\else
- \bbl at extras@wrap{\\\bbl at Alph@saved}%
- {\let\bbl at Alph@saved\@Alph}%
- {\let\@Alph\bbl at Alph@saved
- \babel at save\@Alph}%
\bbl at exp{%
- \\\bbl at add\<extras\languagename>{%
+ \\\bbl at add\<bbl at preextras@\languagename>{%
+ \\\babel at save\\\@Alph
\let\\\@Alph\<bbl at cntr@\bbl at KVP@Alph @\languagename>}}%
\fi
% == Calendars ==
@@ -13428,9 +13395,11 @@ help from Bernd Raichle, for which I am grateful.
\ifin@\def\bbl at tempb{##1}\fi
\fi}%
\ifx\bbl at tempb\relax\else
- \bbl at exp{\global\<bbl at add>\<extras#1>{\<bbl at encoding@#1>}%
+ \bbl at exp{%
+ \global\<bbl at add>\<bbl at preextras@#1>{\<bbl at encoding@#1>}%
\gdef\<bbl at encoding@#1>{%
\\\babel at save\\\f at encoding
+ \\\bbl at add\\\originalTeX{\\\selectfont}%
\\\fontencoding{\bbl at tempb}%
\\\selectfont}}%
\fi
@@ -14950,6 +14919,41 @@ end
\fi}
\fi
\def\bbl at provide@extra#1{%
+ % == Counters: mapdigits ==
+ % Native digits
+ \ifx\bbl at KVP@mapdigits\@nnil\else
+ \bbl at ifunset{bbl at dgnat@\languagename}{}%
+ {\RequirePackage{luatexbase}%
+ \bbl at activate@preotf
+ \directlua{
+ Babel = Babel or {} %%% -> presets in luababel
+ Babel.digits_mapped = true
+ Babel.digits = Babel.digits or {}
+ Babel.digits[\the\localeid] =
+ table.pack(string.utfvalue('\bbl at cl{dgnat}'))
+ if not Babel.numbers then
+ function Babel.numbers(head)
+ local LOCALE = Babel.attr_locale
+ local GLYPH = node.id'glyph'
+ local inmath = false
+ for item in node.traverse(head) do
+ if not inmath and item.id == GLYPH then
+ local temp = node.get_attribute(item, LOCALE)
+ if Babel.digits[temp] then
+ local chr = item.char
+ if chr > 47 and chr < 58 then
+ item.char = Babel.digits[temp][chr-47]
+ end
+ end
+ elseif item.id == node.id'math' then
+ inmath = (item.subtype == 0)
+ end
+ end
+ return head
+ end
+ end
+ }}%
+ \fi
% == transforms ==
\ifx\bbl at KVP@transforms\@nnil\else
\def\bbl at elt##1##2##3{%
@@ -22111,9 +22115,15 @@ local function insert_implicit(head, state, outer)
dir = ((outer == 'r') and 'TLT' or 'TRT') -- ie, reverse
local d = node.new(DIR)
d.dir = '+' .. dir
+ if state.sim.prev and state.sim.prev.id == 8 then
+ state.sim = state.sim.prev
+ end
node.insert_before(head, state.sim, d)
local d = node.new(DIR)
d.dir = '-' .. dir
+ if state.eim.next and state.eim.next.id == 8 then
+ state.eim = state.eim.next
+ end
node.insert_after(head, state.eim, d)
end
new_state.sim, new_state.eim = nil, nil
@@ -22126,10 +22136,16 @@ local function insert_numeric(head, state)
if state.san and state.ean and state.san ~= state.ean then
local d = node.new(DIR)
d.dir = '+TLT'
+ if state.san.prev and state.san.prev.id == 8 then
+ state.san = state.san.prev
+ end
_, new = node.insert_before(head, state.san, d)
if state.san == state.sim then state.sim = new end
local d = node.new(DIR)
d.dir = '-TLT'
+ if state.ean.next and state.ean.next.id == 8 then
+ state.ean = state.ean.next
+ end
_, new = node.insert_after(head, state.ean, d)
if state.ean == state.eim then state.eim = new end
end
diff --git a/babel.ins b/babel.ins
index 7c06e66..7e7172e 100644
--- a/babel.ins
+++ b/babel.ins
@@ -26,7 +26,7 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%%
-\def\filedate{2022/12/08}
+\def\filedate{2022/12/13}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/babel.pdf b/babel.pdf
index f5a979a..a752e34 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 221c9dc..d9438b4 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2022/12/08 v3.83.2945]
+\ProvidesFile{bbcompat.dtx}[2022/12/13 v3.83.2950]
%</dtx>
%
%% File 'bbcompat.dtx'
More information about the latex3-commits
mailing list.