diff options
| author | Khaled Hosny <khaledhosny@eglug.org> | 2010-02-20 07:16:46 +0200 | 
|---|---|---|
| committer | Khaled Hosny <khaledhosny@eglug.org> | 2010-02-20 07:34:31 +0200 | 
| commit | cac52b5f4cfdc934cd3c5a68777c77d8d70f4b7c (patch) | |
| tree | 30cadfe05c4652b07192bc5896e4cf8e8a6fbb34 | |
| parent | 3d54718f98098de05b995e35de7e18b5239a710d (diff) | |
| download | luaotfload-cac52b5f4cfdc934cd3c5a68777c77d8d70f4b7c.tar.gz | |
Add a new |luat-over| module
To minimize differences between original ConTeXt files, this module
overrides functions defined in |luat-dum| module.
| -rw-r--r-- | luaotfload.dtx | 1 | ||||
| -rw-r--r-- | otfl-luat-dum.lua | 24 | ||||
| -rw-r--r-- | otfl-luat-ovr.lua | 35 | 
3 files changed, 37 insertions, 23 deletions
| diff --git a/luaotfload.dtx b/luaotfload.dtx index 22b87f2..d481938 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -426,6 +426,7 @@ end  %    \begin{macrocode}  luaotfload.loadmodule('luat-dum.lua') -- not used in context at all +luaotfload.loadmodule('luat-ovr.lua') -- override some luat-dum functions  luaotfload.loadmodule('data-con.lua') -- maybe some day we don't need this one  %    \end{macrocode} diff --git a/otfl-luat-dum.lua b/otfl-luat-dum.lua index a594b64..19e95e2 100644 --- a/otfl-luat-dum.lua +++ b/otfl-luat-dum.lua @@ -43,7 +43,7 @@ tasks = {      prependaction = dummyfunction,  }  callbacks = { -    register      = dummyfunction, +    register = function(n,f) return callback.register(n,f) end,  }  -- we need to cheat a bit here @@ -72,25 +72,3 @@ function resolvers.findbinfile(name,kind)      end      return resolvers.find_file(name,(kind and remapper[kind]) or kind)  end - -local write_nl, format, name = texio.write_nl, string.format, "luaotfload" - -function logs.report(category,fmt,...) -    if fmt then -        write_nl('log', format("%s | %s: %s",name,category,format(fmt,...))) -    elseif category then -        write_nl('log', format("%s | %s",name,category)) -    else -        write_nl('log', format("%s |",name)) -    end -end - -function logs.simple(fmt,...) -    if fmt then -        write_nl('log', format("%s | %s",name,format(fmt,...))) -    else -        write_nl('log', format("%s |",name)) -    end -end - -tex.ctxcatcodes = luatextra.catcodetables.latex diff --git a/otfl-luat-ovr.lua b/otfl-luat-ovr.lua new file mode 100644 index 0000000..3670df7 --- /dev/null +++ b/otfl-luat-ovr.lua @@ -0,0 +1,35 @@ +if not modules then modules = { } end modules ['luat-ovr'] = { +    version   = 1.001, +    comment   = "companion to luatex-*.tex", +    author    = "Khaled Hosny and Elie Roux", +    copyright = "Luaotfload Development Team", +    license   = "GPL" +} + + +local write_nl, format, name = texio.write_nl, string.format, "luaotfload" +local dummyfunction = function() end + +callbacks = { +    register      = dummyfunction, +} + +function logs.report(category,fmt,...) +    if fmt then +        write_nl('log', format("%s | %s: %s",name,category,format(fmt,...))) +    elseif category then +        write_nl('log', format("%s | %s",name,category)) +    else +        write_nl('log', format("%s |",name)) +    end +end + +function logs.simple(fmt,...) +    if fmt then +        write_nl('log', format("%s | %s",name,format(fmt,...))) +    else +        write_nl('log', format("%s |",name)) +    end +end + +tex.ctxcatcodes = luatextra.catcodetables.latex | 
