From 29571234614ef11c8b2ff57588c4b5774fe3c55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Sun, 28 Mar 2010 19:08:46 +0200 Subject: require(foo.bar) looks for foo/bar.lua --- Changes | 6 +++--- TODO | 5 +++-- luatexbase-loader.dtx | 9 ++++++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index a43d688..865c6b9 100644 --- a/Changes +++ b/Changes @@ -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 diff --git a/TODO b/TODO index 971e9be..378e6c1 100644 --- a/TODO +++ b/TODO @@ -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 -- cgit v1.2.3