summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/ltluatex.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-01 03:03:37 +0000
committerNorbert Preining <norbert@preining.info>2020-09-01 03:03:37 +0000
commita9726d029d99c128a7abb22e73074ba0a1ce838e (patch)
treea31816862a76ed100de957dc93c04447f254132c /macros/latex-dev/base/ltluatex.dtx
parent568fe838cef40f671837d9348dd73c93d9ea962b (diff)
CTAN sync 202009010303
Diffstat (limited to 'macros/latex-dev/base/ltluatex.dtx')
-rw-r--r--macros/latex-dev/base/ltluatex.dtx41
1 files changed, 30 insertions, 11 deletions
diff --git a/macros/latex-dev/base/ltluatex.dtx b/macros/latex-dev/base/ltluatex.dtx
index 2e692a993b..ec1031cc29 100644
--- a/macros/latex-dev/base/ltluatex.dtx
+++ b/macros/latex-dev/base/ltluatex.dtx
@@ -28,7 +28,7 @@
\ProvidesFile{ltluatex.dtx}
%</driver>
%<*tex>
-[2020/06/10 v1.1n
+[2020/08/10 v1.1r
%</tex>
%<plain> LuaTeX support for plain TeX (core)
%<*tex>
@@ -459,7 +459,7 @@
% \end{macrocode}
% luatex/xetex also allow more math fam.
% \begin{macrocode}
-\edef \et@xmaxfam {\ifx\Umathchar\@undefined\sixt@@n\else\@cclvi\fi}
+\edef \et@xmaxfam {\ifx\Umathcode\@undefined\sixt@@n\else\@cclvi\fi}
% \end{macrocode}
%
% \begin{macrocode}
@@ -550,18 +550,19 @@
%
% \begin{macro}{\newattribute}
% \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
% As is generally the case for the Lua\TeX{} registers we start here
% from~$1$. Notably, some code assumes that |\attribute0| is never used so
% this is important in this case.
% \begin{macrocode}
\ifx\e@alloc@attribute@count\@undefined
\countdef\e@alloc@attribute@count=258
+ \e@alloc@attribute@count=\z@
\fi
\def\newattribute#1{%
\e@alloc\attribute\attributedef
\e@alloc@attribute@count\m@ne\e@alloc@top#1%
}
-\e@alloc@attribute@count=\z@
% \end{macrocode}
% \end{macro}
%
@@ -586,13 +587,13 @@
% \begin{macrocode}
\ifx\e@alloc@ccodetable@count\@undefined
\countdef\e@alloc@ccodetable@count=259
+ \e@alloc@ccodetable@count=\z@
\fi
\def\newcatcodetable#1{%
\e@alloc\catcodetable\chardef
\e@alloc@ccodetable@count\m@ne{"8000}#1%
\initcatcodetable\allocationnumber
}
-\e@alloc@ccodetable@count=\z@
% \end{macrocode}
% \end{macro}
%
@@ -699,18 +700,19 @@
%
% \begin{macro}{\newluafunction}
% \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
% Much the same story for allocating Lua\TeX{} functions except here they are
% just numbers so they are allocated in the same way as boxes.
% Lua indexes from~$1$ so once again slot~$0$ is skipped.
% \begin{macrocode}
\ifx\e@alloc@luafunction@count\@undefined
\countdef\e@alloc@luafunction@count=260
+ \e@alloc@luafunction@count=\z@
\fi
\def\newluafunction{%
\e@alloc\luafunction\e@alloc@chardef
\e@alloc@luafunction@count\m@ne\e@alloc@top
}
-\e@alloc@luafunction@count=\z@
% \end{macrocode}
% \end{macro}
%
@@ -718,17 +720,18 @@
%
% \begin{macro}{\newwhatsit}
% \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
% These are only settable from Lua but for consistency are definable
% here.
% \begin{macrocode}
\ifx\e@alloc@whatsit@count\@undefined
\countdef\e@alloc@whatsit@count=261
+ \e@alloc@whatsit@count=\z@
\fi
\def\newwhatsit#1{%
\e@alloc\whatsit\e@alloc@chardef
\e@alloc@whatsit@count\m@ne\e@alloc@top#1%
}
-\e@alloc@whatsit@count=\z@
% \end{macrocode}
% \end{macro}
%
@@ -736,17 +739,18 @@
%
% \begin{macro}{\newluabytecode}
% \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
% These are only settable from Lua but for consistency are definable
% here.
% \begin{macrocode}
\ifx\e@alloc@bytecode@count\@undefined
\countdef\e@alloc@bytecode@count=262
+ \e@alloc@bytecode@count=\z@
\fi
\def\newluabytecode#1{%
\e@alloc\luabytecode\e@alloc@chardef
\e@alloc@bytecode@count\m@ne\e@alloc@top#1%
}
-\e@alloc@bytecode@count=\z@
% \end{macrocode}
% \end{macro}
%
@@ -754,12 +758,14 @@
% \begin{macro}{\newluachunkname}
% \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
% As for bytecode registers, but in addition we need to add a string
% to the \verb|lua.name| table to use in stack tracing. We use the
% name of the command passed to the allocator, with no backslash.
% \begin{macrocode}
\ifx\e@alloc@luachunk@count\@undefined
\countdef\e@alloc@luachunk@count=263
+ \e@alloc@luachunk@count=\z@
\fi
\def\newluachunkname#1{%
\e@alloc\luachunk\e@alloc@chardef
@@ -767,19 +773,31 @@
{\escapechar\m@ne
\directlua{lua.name[\the\allocationnumber]="\string#1"}}%
}
-\e@alloc@luachunk@count=\z@
% \end{macrocode}
% \end{macro}
%
% \subsection{Lua loader}
+% \changes{v1.1r}{2020/08/10}{Load ltluatex Lua module during format building}
+%
+% Lua code loaded in the format often has to to be loaded again at the
+% beginning of every job, so we define a helper whch allows us to avoid
+% duplicated code:
+%
+% \begin{macrocode}
+\def\now@and@everyjob#1{%
+ \everyjob\expandafter{\the\everyjob
+ #1%
+ }%
+ #1%
+}
+% \end{macrocode}
%
% Load the Lua code at the start of every job.
% For the conversion of \TeX{} into numbers at the Lua side we need some
% known registers: for convenience we use a set of systematic names, which
% means using a group around the Lua loader.
% \begin{macrocode}
-%<2ekernel>\everyjob\expandafter{%
-%<2ekernel> \the\everyjob
+%<2ekernel>\now@and@everyjob{%
\begingroup
\attributedef\attributezero=0 %
\chardef \charzero =0 %
@@ -1322,6 +1340,7 @@ local callbacktypes = callbacktypes or {
% \changes{v1.1k}{2019/10/02}{process\_rule is \texttt{exclusive}}
% \changes{v1.1k}{2019/10/02}{mlist\_to\_hlist is \texttt{exclusive}}
% \changes{v1.1l}{2020/02/02}{post\_linebreak\_filter is \texttt{reverselist}}
+% \changes{v1.1p}{2020/08/01}{new\_graf is \texttt{exclusive}}
% \begin{macrocode}
contribute_filter = simple,
buildpage_filter = simple,
@@ -1343,7 +1362,7 @@ local callbacktypes = callbacktypes or {
pre_mlist_to_hlist_filter = list,
mlist_to_hlist = exclusive,
post_mlist_to_hlist_filter = reverselist,
- new_graf = simple,
+ new_graf = exclusive,
% \end{macrocode}
% Section 8.5: information reporting callbacks.
% \changes{v1.0m}{2016/02/11}{show\_warning\_message added}