summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/texdoc/News5
-rw-r--r--Master/texmf-dist/scripts/texdoc/config.tlu2
-rw-r--r--Master/texmf-dist/scripts/texdoc/constants.tlu20
-rw-r--r--Master/texmf-dist/scripts/texdoc/texdoclib.tlu23
4 files changed, 39 insertions, 11 deletions
diff --git a/Master/texmf-dist/doc/texdoc/News b/Master/texmf-dist/doc/texdoc/News
index caad4f51959..28708316a57 100644
--- a/Master/texmf-dist/doc/texdoc/News
+++ b/Master/texmf-dist/doc/texdoc/News
@@ -1,3 +1,8 @@
+Version 0.85
+------------
+
+Compatibility with LuaTeX 0.74+ (Lua 5.2).
+
Version 0.84 (TeX Live 2012)
============================
diff --git a/Master/texmf-dist/scripts/texdoc/config.tlu b/Master/texmf-dist/scripts/texdoc/config.tlu
index 0c3640c71c1..ed35d0efd76 100644
--- a/Master/texmf-dist/scripts/texdoc/config.tlu
+++ b/Master/texmf-dist/scripts/texdoc/config.tlu
@@ -500,7 +500,7 @@ function setup_config_and_alias(arg)
real_set_config('interact_switch', false)
end
-- debug implies verbose
- if table.maxn(config.debug_list) > 0 then
+ if #config.debug_list > 0 then
real_set_config('verbosity_level', tonumber(C.max_verbosity))
end
-- we were waiting for config.debug_list to be known to do this
diff --git a/Master/texmf-dist/scripts/texdoc/constants.tlu b/Master/texmf-dist/scripts/texdoc/constants.tlu
index 872a3ac7b93..02d608440da 100644
--- a/Master/texmf-dist/scripts/texdoc/constants.tlu
+++ b/Master/texmf-dist/scripts/texdoc/constants.tlu
@@ -6,15 +6,21 @@
local constants = {}
local kpse = kpse
local setfenv = setfenv
-local texdoc_env = getfenv()
-setfenv(1, constants)
+local texdoc_env
+if setfenv then
+ texdoc_env = getfenv()
+ setfenv(1, constants)
+else
+ texdoc_env = _ENV
+ _ENV = constants
+end
-- BEGIN constants
-- progname and version
fullname = kpse.find_file('texdoc/texdoclib', 'lua')
progname = 'texdoc'
-version = '0.84'
+version = '0.85'
-- make sure to update setup_config_from_cl() accordingly
-- and set a default value in setup_config_from_defaults() if relevant
@@ -48,7 +54,7 @@ Report bugs to <texdoc@tug.org>.
Full manual available via `texdoc texdoc'.]]
copyright_msg = [[
-Copyright (C) 2008-2011 Manuel P'egouri'e-Gonnard.
+Copyright (C) 2008-2013 Manuel P'egouri'e-Gonnard.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.]]
@@ -119,7 +125,11 @@ place_holder = '%%s' -- used for viewer commands
-- END constants
-- get our previous environment back
-setfenv(1, texdoc_env)
+if setfenv then
+ setfenv(1, texdoc_env)
+else
+ _ENV = texdoc_env
+end
-- Make global C a read-only proxy to the local <constants>.
-- Note this is not deep read-only: C.known_debugs is read-only, but
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
index ccaad778d93..c92ef185b17 100644
--- a/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
@@ -38,15 +38,19 @@ end
-- initialise the shared environment with a copy of the global environment
local prv_env = simple_copy(_G)
-setfenv(1, prv_env)
+if setfenv then
+ setfenv(1, prv_env)
+else
+ _ENV = prv_env
+end
-- import symbols from a table to the share environment
local function import_symbols(symbols, name)
for sym, val in pairs(symbols) do
assert(val ~= nil,
- 'Internal error: '..name..'exporting undefined symbol '..sym..'.')
+ 'Internal error: '..name..' exporting undefined symbol '..sym..'.')
assert(prv_env[sym] == nil,
- 'Internal error: '..name..'exporting existing symbol '..sym..'.')
+ 'Internal error: '..name..' exporting existing symbol '..sym..'.')
prv_env[sym] = val
end
end
@@ -55,8 +59,17 @@ end
local function texdoc_do(name)
local pathname = kpse.find_file('texdoc/'..name, 'lua')
assert(pathname, 'Internal error: missing submodule: '..name)
- local submod = assert(loadfile (pathname))
- setfenv(submod, simple_copy(prv_env))
+ local submod
+ if setfenv then
+ submod = assert(loadfile (pathname))
+ setfenv(submod, simple_copy(prv_env))
+ else
+ local f = assert(io.open(pathname))
+ local s = f:read('*a')
+ f:close()
+ submod = assert(load(s, pathname, 'bt', simple_copy(prv_env)))
+ -- submod = assert(loadfile(pathname, 'bt', simple_copy(prv_env)))
+ end
local symbols = submod()
if symbols then import_symbols(symbols, name) end
end