summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-03-29 08:06:05 +0200
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-03-29 08:06:05 +0200
commit60620185a92d7e383c26fe8ba4364ed517d6e298 (patch)
treeb2482eac7cece23460e7e355ec6d911519af903d
parent3c6452a7addcc5404f64f158ccbc7dc123f4e0d5 (diff)
downloadluatexbase-60620185a92d7e383c26fe8ba4364ed517d6e298.tar.gz
Use emulation as a fallback search mode.
-rw-r--r--TODO2
-rw-r--r--luatexbase-loader.dtx14
2 files changed, 11 insertions, 5 deletions
diff --git a/TODO b/TODO
index 3ae0555..e1c02ef 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,7 @@
loader
------
-- Make a decision about the behaviour (discuss this with Heiko & all)
+- write doc
modutils
--------
diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx
index 6d72a36..68e6755 100644
--- a/luatexbase-loader.dtx
+++ b/luatexbase-loader.dtx
@@ -291,7 +291,7 @@ local lua_suffixes = {
".luc", ".luctex", ".texluc",
".lua", ".luatex", ".texlua",
}
-local function find_file_lua(name)
+local function find_file_lua_emul(name)
for _, suf in ipairs(lua_suffixes) do
local name = name..suf
local f = kpse.find_file(name, 'texmfscripts')
@@ -301,12 +301,18 @@ local function find_file_lua(name)
end
% \end{macrocode}
%
-% Don't use the emulated version if kpse lua format works.
+% If lua search format is available, use it with emulation as a fall-back,
+% or just use emulation.
%
% \begin{macrocode}
+local find_file_lua
if pcall('kpse.find_file', 'dummy', 'lua') then
- find_file_lua = function(name)
- return kpse.find_file(name, 'lua')
+ find_file_lua = function (name)
+ return kpse.find_file(name, 'lua') or find_file_lua_emul(name)
+ end
+else
+ find_file_lua = function (name)
+ return find_file_lua_emul(name)
end
end
% \end{macrocode}