summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-03-28 19:08:46 +0200
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-03-28 19:08:46 +0200
commit29571234614ef11c8b2ff57588c4b5774fe3c55f (patch)
tree9a38e5c4f4ee6fdfe28e2b1fb4d7adb539c60eff
parent2a5bc26ece3b6596ce47530ba93d8a61d3c9790a (diff)
downloadluatexbase-29571234614ef11c8b2ff57588c4b5774fe3c55f.tar.gz
require(foo.bar) looks for foo/bar.lua
-rw-r--r--Changes6
-rw-r--r--TODO5
-rw-r--r--luatexbase-loader.dtx9
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