summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/lua-widow-control/lua-widow-control.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/generic/lua-widow-control/lua-widow-control.tex')
-rw-r--r--macros/luatex/generic/lua-widow-control/lua-widow-control.tex22
1 files changed, 12 insertions, 10 deletions
diff --git a/macros/luatex/generic/lua-widow-control/lua-widow-control.tex b/macros/luatex/generic/lua-widow-control/lua-widow-control.tex
index b667d05c11..78385ad698 100644
--- a/macros/luatex/generic/lua-widow-control/lua-widow-control.tex
+++ b/macros/luatex/generic/lua-widow-control/lua-widow-control.tex
@@ -3,7 +3,7 @@
% SPDX-License-Identifier: MPL-2.0+
% SPDX-FileCopyrightText: 2022 Max Chernoff
-\wlog{lua-widow-control v2.0.6} %%version
+\wlog{lua-widow-control v2.1.0} %%version
\ifx\directlua\undefined
\errmessage{%
@@ -35,13 +35,8 @@
\expandglyphsinfont\the\font 20 20 5
\adjustspacing=2
-% Define \TeX{} wrappers for Lua functions
-\def\lwcenable{\directlua{lwc.enable_callbacks()}}
-\def\lwcdisable{\directlua{lwc.disable_callbacks()}}
-\def\iflwc{\directlua{lwc.if_lwc_enabled()}}
-
% Enable \lwc/ by default when the package is loaded.
-\lwcenable
+\lwc@enable
% Expansion of some parts of the document, such as section headings, is quite
% undesirable, so we'll disable \lwc/ for certain commands.
@@ -50,15 +45,15 @@
\newcount\lwc@disable@count
\def\lwc@patch@pre{%
- \iflwc%
+ \lwc@if@enabled%
\advance\lwc@disable@count by 1%
- \lwcdisable%
+ \lwc@disable%
\fi%
}
\def\lwc@patch@post{
\ifnum\lwc@disable@count>0%
- \lwcenable%
+ \lwc@enable%
\advance\lwc@disable@count by -1%
\fi
}
@@ -89,6 +84,13 @@
\lwcdisablecmd{\beginsection} % Sectioning
\endgroup
+% Make the commands public
+\let\lwcenable=\lwc@enable
+\let\lwcdisable=\lwc@disable
+\let\lwcdebug=\lwc@debug
+\let\iflwc=\lwc@if@enabled
+\let\lwcnobreak=\lwc@nobreak
+
\catcode`@=12
\endinput