From 194f7034951b66ba668002ff24f087ecf1518f1d Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Thu, 14 Apr 2016 17:35:41 +0100 Subject: [PATCH] Do all primitive work globally As the Lua interface works globally, we really should as well from the TeX side. This also keeps things sensible in terms of the save stack. --- luatexconfig.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/luatexconfig.tex b/luatexconfig.tex index bfdf31b..06b1b7d 100644 --- a/luatexconfig.tex +++ b/luatexconfig.tex @@ -25,12 +25,12 @@ \directlua{tex.enableprimitives("", {"pageheight", "pagewidth", "outputmode"})}% \ifx\pdfoutput\undefined - \let\pdfoutput\outputmode - \let\pdfpageheight\pageheight - \let\pdfpagewidth\pagewidth + \global\let\pdfoutput\outputmode + \global\let\pdfpageheight\pageheight + \global\let\pdfpagewidth\pagewidth \def\do#1{% \ifx\relax#1\else - \expandafter\def\csname pdf#1\endcsname{\pdfvariable #1}% + \expandafter\xdef\csname pdf#1\endcsname{\pdfvariable #1}% \expandafter\do \fi }% @@ -45,7 +45,7 @@ \global\let\dvimode\undefined \def\do#1{% \ifx\relax#1\else - \global\expandafter\let\csname pdf#1\endcsname\relax + \global\expandafter\let\csname pdf#1\endcsname\undefined \expandafter\do \fi }%