summaryrefslogtreecommitdiff
path: root/luaotfload-override.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-07-10 09:44:59 -0700
committerPhilipp Gesang <phg42.2a@gmail.com>2013-07-10 09:44:59 -0700
commit36abb3e8cf8d2d24bf5cfb770cdba2731de655c5 (patch)
tree91b5dc821ed404eb9618ae69f0a8d5481326aa46 /luaotfload-override.lua
parent9bb68613ca57d6486906317f0b5f832ea4deceea (diff)
parentc005b2dc2c002b970536ae3acf9532e1f673b478 (diff)
downloadluaotfload-36abb3e8cf8d2d24bf5cfb770cdba2731de655c5.tar.gz
Merge pull request #110 from phi-gamma/master
v2.3a
Diffstat (limited to 'luaotfload-override.lua')
-rw-r--r--luaotfload-override.lua26
1 files changed, 16 insertions, 10 deletions
diff --git a/luaotfload-override.lua b/luaotfload-override.lua
index 39cc172..f647826 100644
--- a/luaotfload-override.lua
+++ b/luaotfload-override.lua
@@ -1,5 +1,5 @@
if not modules then modules = { } end modules ['luat-ovr'] = {
- version = 2.3,
+ version = "2.3a",
comment = "companion to luatex-*.tex",
author = "Khaled Hosny, Elie Roux, Philipp Gesang",
copyright = "Luaotfload Development Team",
@@ -32,6 +32,12 @@ local texio_write = texio.write
local texiowrite = texio.write
local type = type
+local texjob = false
+if tex and (tex.jobname or tex.formatname) then
+ --- TeX
+ texjob = true
+end
+
--[[doc--
We recreate the verbosity levels previously implemented in font-nms:
@@ -136,10 +142,9 @@ end
logs.set_logout = set_logout
local log = function (category, fmt, ...)
- local res = { module_name, " |" }
- if category then res[#res+1] = " " .. category end
- if fmt then res[#res+1] = ": " .. stringformat(fmt, ...) end
- texiowrite_nl(logout, tableconcat(res))
+ local res = { module_name, "|", category, ":" }
+ if fmt then res[#res+1] = stringformat(fmt, ...) end
+ texiowrite_nl(logout, tableconcat(res, " "))
end
--- with faux db update with maximum verbosity:
@@ -156,11 +161,11 @@ end
io.stdout:setvbuf "no"
io.stderr:setvbuf "no"
-if tex and (tex.jobname or tex.formatname) then
- --- TeX
- writeln = texiowrite_nl
+if texjob == true then
+ writeln = function (str)
+ texiowrite_nl ("term", str)
+ end
else
- --- Lua interpreter
writeln = function (str)
iowrite(str)
iowrite "\n"
@@ -171,7 +176,8 @@ stdout = function (category, ...)
local res = { module_name, "|", category, ":" }
local nargs = select("#", ...)
if nargs == 0 then
- writeln (tableconcat ({...}))
+ --writeln tableconcat(res, " ")
+ --return
elseif nargs == 1 then
res[#res+1] = select(1, ...) -- around 30% faster than unpack()
else