summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-09-26 23:23:37 +0000
committerKarl Berry <karl@freefriends.org>2009-09-26 23:23:37 +0000
commitbe069a8171e0e5028a8893ee64753dd07b4f1180 (patch)
tree637af89dff9e6ff0c218a813b7cbbef5e7d13347 /Master/texmf-dist/tex/luatex
parent4e17af35bf2cf25beac93a51cfe56c026cf72eb0 (diff)
luatextra 0.94 update (26sep09)
git-svn-id: svn://tug.org/texlive/trunk@15473 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/luatextra/luaextra.lua3
-rw-r--r--Master/texmf-dist/tex/luatex/luatextra/luamcallbacks.lua14
-rw-r--r--Master/texmf-dist/tex/luatex/luatextra/luatextra.lua6
-rw-r--r--Master/texmf-dist/tex/luatex/luatextra/luatextra.sty126
4 files changed, 88 insertions, 61 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatextra/luaextra.lua b/Master/texmf-dist/tex/luatex/luatextra/luaextra.lua
index 4c21f24b157..cbf1d426708 100644
--- a/Master/texmf-dist/tex/luatex/luatextra/luaextra.lua
+++ b/Master/texmf-dist/tex/luatex/luatextra/luaextra.lua
@@ -56,7 +56,8 @@ lpeg.newline = lpeg.P("\r\n") + lpeg.P("\r") +lpeg.P("\n")
if not table.fastcopy then do
- local type, pairs, getmetatable, setmetatable = type, pairs, getmetatable, setmetatable
+ local type, pairs, getmetatable, setmetatable =
+ type, pairs, getmetatable, setmetatable
local function fastcopy(old) -- fast one
if old then
diff --git a/Master/texmf-dist/tex/luatex/luatextra/luamcallbacks.lua b/Master/texmf-dist/tex/luatex/luatextra/luamcallbacks.lua
index 03bebe0b7e9..77dc49c7681 100644
--- a/Master/texmf-dist/tex/luatex/luatextra/luamcallbacks.lua
+++ b/Master/texmf-dist/tex/luatex/luatextra/luamcallbacks.lua
@@ -20,8 +20,8 @@ luamcallbacks = { }
luamcallbacks.module = {
name = "luamcallbacks",
- version = 0.92,
- date = "2009/03/19",
+ version = 0.93,
+ date = "2009/09/18",
description = "Module to register several functions in a callback.",
author = "Hans Hagen & Elie Roux",
copyright = "Hans Hagen & Elie Roux",
@@ -96,6 +96,11 @@ read_data_file = first,
}
+if tex.luatexversion > 42 then
+ luamcallbacks.callbacktypes["process_output_buffer"] = data
+end
+
+
luamcallbacks.internalregister = luamcallbacks.internalregister or callback.register
local callbacktypes = luamcallbacks.callbacktypes
@@ -290,8 +295,11 @@ function luamcallbacks.remove (name, description)
table.remove(l,k)
luamcallbacks.log(
format("removing function '%s' from '%s'",description,name))
- if l == {} and not luamcallbacks.lua_callbacks_defaults[name] then
+ if not next(l) then
+ luamcallbacks.callbacklist[name] = nil
+ if not luamcallbacks.lua_callbacks_defaults[name] then
luamcallbacks.internalregister(name, nil)
+ end
end
return
end
diff --git a/Master/texmf-dist/tex/luatex/luatextra/luatextra.lua b/Master/texmf-dist/tex/luatex/luatextra/luatextra.lua
index 5c4a0f947af..02313348446 100644
--- a/Master/texmf-dist/tex/luatex/luatextra/luatextra.lua
+++ b/Master/texmf-dist/tex/luatex/luatextra/luatextra.lua
@@ -34,9 +34,9 @@ module("luatextra", package.seeall)
luatextra.modules = {}
luatextra.modules['luatextra'] = {
- version = 0.93,
+ version = 0.94,
name = "luatextra",
- date = "2009/04/15",
+ date = "2009/09/22",
description = "Additional low level functions for LuaTeX",
author = "Elie Roux",
copyright = "Elie Roux, 2009",
@@ -68,7 +68,7 @@ function luatextra.module_error(package, msg, helpmsg)
if helpmsg then
tex.sprint(format("\\errhelp{%s}", helpmsg))
end
- tex.sprint(format("\\luaModuleError{%s}{%s}", package, msg))
+ tex.sprint(format("\\luatexModuleError{%s}{%s}", package, msg))
end
function luatextra.module_warning(modulename, msg)
diff --git a/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty b/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty
index 3b86be22d90..db4acd9aa27 100644
--- a/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty
+++ b/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty
@@ -32,7 +32,7 @@
\immediate\write16{}
\errmessage{Package luatextra Error: This package must be used with LuaTeX}
\fi
- \def\luaRequireModule#1#2{\luadirect{luatextra.require_module([[#1]], [[#2]])}}
+ \def\luatexRequireModule#1#2{\luadirect{luatextra.require_module([[#1]], [[#2]])}}
\else
\ifluatex\else
\PackageError{luatextra}{This package must be used with LuaTeX.}
@@ -42,7 +42,7 @@
[2009/04/15 v0.93 LuaTeX extra low-level macros]
\RequirePackage{environ}
\NewEnviron{luacode}{\luadirect{\BODY}}
- \newcommand\luaRequireModule[2][0]{\luadirect{luatextra.require_module([[#2]], [[#1]])}}
+ \newcommand\luatexRequireModule[2][0]{\luadirect{luatextra.require_module([[#2]], [[#1]])}}
\RequirePackage{etex}[1998/03/26]%
\input luatextra-latex.tex
\fi
@@ -57,27 +57,33 @@
\def\latelua{\pdfprimitive\latelua0}
\def\luadirect{\pdfprimitive\directlua0}
\def\lualate{\pdfprimitive\latelua0}
- \def\luaattribute{\attribute}
- \def\luaattributedef{\attributedef}
- \def\luaclearmarks{\pdfprimitive\luaclearmarks}
- \def\luaformatname{\pdfprimitive\formatname}
- \def\luascantexttokens{\pdfprimitive\scantexttokens}
- \def\luacatcodetable{\catcodetable}
+ \def\luatexattribute{\attribute}
+ \def\luatexattributedef{\attributedef}
+ \def\luatexclearmarks{\pdfprimitive\luaclearmarks}
+ \def\luatexformatname{\pdfprimitive\formatname}
+ \def\luatexscantexttokens{\pdfprimitive\scantexttokens}
+ \def\luatexcatcodetable{\catcodetable}
+ \def\initluatexcatcodetable{\pdfprimitive\initcatcodetable}
+ \def\saveluatexcatcodetable{\pdfprimitive\savecatcodetable}
+ \def\luaclose{\pdfprimitive\closelua}
\else
- \directlua{tex.enableprimitives('lua', {'attribute'})}
- \directlua{tex.enableprimitives('lua', {'attributedef'})}
- \directlua{tex.enableprimitives('lua', {'clearmarks'})}
- \directlua{tex.enableprimitives('lua', {'formatname'})}
- \directlua{tex.enableprimitives('lua', {'scantexttokens'})}
- \directlua{tex.enableprimitives('lua', {'catcodetable'})}
- \def\luadirect{\pdfprimitive\directlua}
- \def\lualate{\pdfprimitive\latelua}
+ \directlua{tex.enableprimitives('luatex', {'attribute'})}
+ \directlua{tex.enableprimitives('luatex', {'attributedef'})}
+ \directlua{tex.enableprimitives('luatex', {'clearmarks'})}
+ \directlua{tex.enableprimitives('luatex', {'formatname'})}
+ \directlua{tex.enableprimitives('luatex', {'scantexttokens'})}
+ \directlua{tex.enableprimitives('luatex', {'catcodetable'})}
+ \directlua{tex.enableprimitives('luatex', {'latelua'})}
+ \directlua{tex.enableprimitives('luatex', {'initcatcodetable'})}
+ \directlua{tex.enableprimitives('luatex', {'savecatcodetable'})}
+ \directlua{tex.enableprimitives('luatex', {'closelua'})}
+ \let\luadirect\directlua
+ \let\lualate\luatexlatelua
+ \let\initluatexcatcodetable\luatexinitcatcodetable
+ \let\saveluatexcatcodetable\luatexsavecatcodetable
+ \let\luaclose\luatexcloselua
\fi
-\def\initluacatcodetable{\pdfprimitive\initcatcodetable}
-\def\saveluacatcodetable{\pdfprimitive\savecatcodetable}
-\def\luaclose{\pdfprimitive\closelua}
-
\luadirect{dofile(kpse.find_file("luatextra.lua"))}
@@ -87,28 +93,27 @@
}
-
-\def\luaModuleError#1#2{%
+\def\luatexModuleError#1#2{%
\errorcontextlines=0\relax
\immediate\write16{}%
\errmessage{Module #1 error: #2^^J^^J%
See the module #1 documentation for explanation.^^J ...^^J}%
}
-\def\luaUseModule#1{\luadirect{luatextra.use_module([[#1]])}}
+\def\luatexUseModule#1{\luadirect{luatextra.use_module([[#1]])}}
-\newcount\luaattdefcounter
-\luaattdefcounter = 1
+\newcount\luatexattdefcounter
+\luatexattdefcounter = 1
-\def\newluaattribute#1{%
- \ifnum\luaattdefcounter<65535\relax %
- \global\advance\luaattdefcounter by 1\relax %
- \allocationnumber\luaattdefcounter %
+\def\newluatexattribute#1{%
+ \ifnum\luatexattdefcounter<65535\relax %
+ \global\advance\luatexattdefcounter by 1\relax %
+ \allocationnumber\luatexattdefcounter %
\ifluatex %
- \global\luaattributedef#1=\allocationnumber %
+ \global\luatexattributedef#1=\allocationnumber %
\fi %
- \wlog{\string#1=\string\attribute\the\allocationnumber}%
+ \wlog{\string#1=\string\luatexattribute\the\allocationnumber}%
\luadirect{%
luatextra.attributedef_from_tex([[\noexpand#1]], '\number\allocationnumber')}%
\else %
@@ -117,11 +122,11 @@ See the module #1 documentation for explanation.^^J ...^^J}%
}
-\def\setluaattribute#1#2{%
+\def\setluatexattribute#1#2{%
#1=\numexpr#2\relax %
}
-\def\unsetluaattribute#1{%
+\def\unsetluatexattribute#1{%
\ifnum\luatexversion<37\relax %
#1=-1\relax %
\else %
@@ -130,14 +135,14 @@ See the module #1 documentation for explanation.^^J ...^^J}%
}
-\newcount\luacatcodetabledefcounter
+\newcount\luatexcatcodetabledefcounter
-\luacatcodetabledefcounter = 1
+\luatexcatcodetabledefcounter = 1
-\def\newluacatcodetable#1{%
- \ifnum\luacatcodetabledefcounter<1114110\relax % 0x10FFFF is maximal \chardef
- \global\advance\luacatcodetabledefcounter by 1\relax %
- \allocationnumber=\luacatcodetabledefcounter %
+\def\newluatexcatcodetable#1{%
+ \ifnum\luatexcatcodetabledefcounter<1114110\relax % 0x10FFFF is maximal \chardef
+ \global\advance\luatexcatcodetabledefcounter by 1\relax %
+ \allocationnumber=\luatexcatcodetabledefcounter %
\global\chardef#1=\allocationnumber %
\luadirect{%
luatextra.catcodetabledef_from_tex([[\noexpand#1]], '\number\allocationnumber')}%
@@ -162,7 +167,7 @@ See the module #1 documentation for explanation.^^J ...^^J}%
\fi
-\def\luasetcatcoderange#1#2#3{%
+\def\luatexsetcatcoderange#1#2#3{%
\edef\luaSCR@temp{%
\noexpand\@tempcnta=\the\@tempcnta
\noexpand\@tempcntb=\the\@tempcntb
@@ -180,11 +185,11 @@ See the module #1 documentation for explanation.^^J ...^^J}%
}
-\newluacatcodetable\CatcodeTableIniTeX
-\newluacatcodetable\CatcodeTableString
-\newluacatcodetable\CatcodeTableOther
-\newluacatcodetable\CatcodeTableLaTeX
-\initluacatcodetable\CatcodeTableIniTeX
+\newluatexcatcodetable\CatcodeTableIniTeX
+\newluatexcatcodetable\CatcodeTableString
+\newluatexcatcodetable\CatcodeTableOther
+\newluatexcatcodetable\CatcodeTableLaTeX
+\initluatexcatcodetable\CatcodeTableIniTeX
\expandafter\ifx\csname @firstofone\endcsname\relax
\long\def\@firstofone#1{#1}%
@@ -193,13 +198,13 @@ See the module #1 documentation for explanation.^^J ...^^J}%
\begingroup
\def\@makeother#1{\catcode#1=12\relax}%
\@firstofone{%
- \luacatcodetable\CatcodeTableIniTeX
+ \luatexcatcodetable\CatcodeTableIniTeX
\begingroup
- \luasetcatcoderange{0}{8}{15}%
+ \luatexsetcatcoderange{0}{8}{15}%
\catcode9=10 % tab
\catcode11=15 %
\catcode12=13 % form feed
- \luasetcatcoderange{14}{31}{15}%
+ \luatexsetcatcoderange{14}{31}{15}%
\catcode35=6 % hash
\catcode36=3 % dollar
\catcode38=4 % ampersand
@@ -209,21 +214,35 @@ See the module #1 documentation for explanation.^^J ...^^J}%
\catcode125=2 % brace right
\catcode126=13 % tilde
\catcode127=15 %
- \saveluacatcodetable\CatcodeTableLaTeX
+ \saveluatexcatcodetable\CatcodeTableLaTeX
\endgroup
\@makeother{0}% nul
\@makeother{13}% carriage return
\@makeother{37}% percent
\@makeother{92}% backslash
\@makeother{127}%
- \luasetcatcoderange{65}{90}{12}% A-Z
- \luasetcatcoderange{97}{122}{12}% a-z
- \saveluacatcodetable\CatcodeTableString
+ \luatexsetcatcoderange{65}{90}{12}% A-Z
+ \luatexsetcatcoderange{97}{122}{12}% a-z
+ \saveluatexcatcodetable\CatcodeTableString
\@makeother{32}% space
- \saveluacatcodetable\CatcodeTableOther
+ \saveluatexcatcodetable\CatcodeTableOther
\endgroup
}
+\ltxtra@AtEnd
+
+
+\let\newluaattribute\newluatexattribute
+\let\luaattribute\luatexattribute
+\let\unsetluaattribute\unsetluatexattribute
+\let\initluacatcodetable\initluatexcatcodetable
+\let\luasetcatcoderange\luatexsetcatcoderange
+\let\newluacatcodetable\newluatexcatcodetable
+\let\setluaattribute\setluatexattribute
+\let\luaModuleError\luatexModuleError
+\let\luaRequireModule\luatexRequireModule
+\let\luaUseModule\luatexUseModule
+
\expandafter\ifx\csname ProvidesPackage\endcsname\relax
\input luaotfload.sty
@@ -231,7 +250,6 @@ See the module #1 documentation for explanation.^^J ...^^J}%
\RequirePackage{luaotfload}
\fi
-\ltxtra@AtEnd
\endinput
%%
%% End of file `luatextra.sty'.