diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-03-28 19:08:46 +0200 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-03-28 19:08:46 +0200 |
commit | 29571234614ef11c8b2ff57588c4b5774fe3c55f (patch) | |
tree | 9a38e5c4f4ee6fdfe28e2b1fb4d7adb539c60eff | |
parent | 2a5bc26ece3b6596ce47530ba93d8a61d3c9790a (diff) | |
download | luatexbase-29571234614ef11c8b2ff57588c4b5774fe3c55f.tar.gz |
require(foo.bar) looks for foo/bar.lua
-rw-r--r-- | Changes | 6 | ||||
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | luatexbase-loader.dtx | 9 |
3 files changed, 14 insertions, 6 deletions
@@ -1,11 +1,11 @@ Changes in the luatexbase package/bundle -[on-going] - luatexbase-attr +2010/03/28 + all - use luatexbase as the Lua module name + luatexbase-attr - don't create tex.attributenumber luatexbase-cctb - - use luatexbase as the Lua module name - don't create tex.catcodetablenumber - rename \luatexsetcatcoderange to \setcatcoderange @@ -13,10 +13,11 @@ compat loader ------ -- a.b.c -> a/b/c or a/b.c or a.b.c? What do to with files under texmf/scripts? -- adujst names of the modules afterwards +- adujst names of the other modules - write doc - make a real test using a fake texmf tree as TEXMFHOME? +- ensure compatibility with older versions of LuaTeX (no 'lua' type for + kpse.find_file). modutils -------- diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx index 684fcab..a6fa7e7 100644 --- a/luatexbase-loader.dtx +++ b/luatexbase-loader.dtx @@ -245,8 +245,15 @@ module('luatexbase', package.seeall) % \end{macrocode} % % \begin{macrocode} +local function find_module_file(mod) + return kpse.find_file(mod:gsub('%.', '/'), 'lua') + or kpse.find_file(mod, 'lua') +end +% \end{macrocode} +% +% \begin{macrocode} local function load_module(mod) - local file = kpse.find_file(mod, 'lua') + local file = find_module_file(file) if not file then return "\n\t[luatexbase.loader] Search failed" end |