diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/base/ltluatex.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/base/ltluatex.dtx | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/Master/texmf-dist/source/latex/base/ltluatex.dtx b/Master/texmf-dist/source/latex/base/ltluatex.dtx index 4686785cf57..5645d3a85fe 100644 --- a/Master/texmf-dist/source/latex/base/ltluatex.dtx +++ b/Master/texmf-dist/source/latex/base/ltluatex.dtx @@ -24,7 +24,7 @@ \ProvidesFile{ltluatex.dtx} %</driver> %<*tex> -[2018/05/02 v1.1g +[2018/10/21 v1.1i %</tex> %<plain> LuaTeX support for plain TeX (core) %<*tex> @@ -200,6 +200,14 @@ % The number is returned and also \meta{name} argument is added to the % |lua.name| array at that index. % +% \noindent +% \DescribeMacro{new_luafunction} +% |luatexbase.new_luafunction(|\meta{functionname}|)|\\ +% Returns an allocation number for a lua function for use +% with |\luafunction|, |\lateluafunction|, and |\luadef|, +% indexed from~$1$. The optional \meta{functionname} argument +% is just used for logging. +% % These functions all require access to a named \TeX{} count register % to manage their allocations. The standard names are those defined % above for access from \TeX{}, \emph{e.g.}~\string\e@alloc@attribute@count, @@ -1184,6 +1192,29 @@ luatexbase.new_chunkname = new_chunkname % \end{macrocode} % \end{macro} % +% \subsection{Lua function allocation} +% +% \begin{macro}{new_luafunction} +% \changes{v1.1i}{2018/10/21}{Function added} +% Much the same as for attribute allocation in Lua. +% The optional \meta{name} argument is used in the log if given. +% \begin{macrocode} +local luafunction_count_name = + luafunction_count_name or "e@alloc@luafunction@count" +local function new_luafunction(name) + tex_setcount("global", luafunction_count_name, + tex_count[luafunction_count_name] + 1) + if tex_count[luafunction_count_name] > 65534 then + luatexbase_error("No room for a new luafunction register") + end + luatexbase_log("Lua function " .. (name or "") .. " = " .. + tex_count[luafunction_count_name]) + return tex_count[luafunction_count_name] +end +luatexbase.new_luafunction = new_luafunction +% \end{macrocode} +% \end{macro} +% % \subsection{Lua callback management} % % The native mechanism for callbacks in Lua\TeX\ allows only one per function. @@ -1279,13 +1310,14 @@ local callbacktypes = callbacktypes or { % {process\_rule, [hv]pack\_quality append\_to\_vlist\_filter added} % \changes{v1.0n}{2016/03/13}{insert\_local\_par added} % \changes{v1.0n}{2016/03/13}{contribute\_filter added} +% \changes{v1.1h}{2018/08/18}{append\_to\_vlist\_filter is \texttt{exclusive}} % \begin{macrocode} contribute_filter = simple, buildpage_filter = simple, build_page_insert = exclusive, pre_linebreak_filter = list, linebreak_filter = list, - append_to_vlist_filter = list, + append_to_vlist_filter = exclusive, post_linebreak_filter = list, hpack_filter = list, vpack_filter = list, |