summaryrefslogtreecommitdiff
path: root/luatexbase-loader.dtx
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 /luatexbase-loader.dtx
parent3c6452a7addcc5404f64f158ccbc7dc123f4e0d5 (diff)
downloadluatexbase-60620185a92d7e383c26fe8ba4364ed517d6e298.tar.gz
Use emulation as a fallback search mode.
Diffstat (limited to 'luatexbase-loader.dtx')
-rw-r--r--luatexbase-loader.dtx14
1 files changed, 10 insertions, 4 deletions
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}