summaryrefslogtreecommitdiff
path: root/tex/context/base/core-uti.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/core-uti.lua')
-rw-r--r--tex/context/base/core-uti.lua22
1 files changed, 9 insertions, 13 deletions
diff --git a/tex/context/base/core-uti.lua b/tex/context/base/core-uti.lua
index 1657a75e2..141f20cd3 100644
--- a/tex/context/base/core-uti.lua
+++ b/tex/context/base/core-uti.lua
@@ -20,6 +20,7 @@ saves much runtime but at the cost of more memory usage.</p>
local format, match = string.format, string.match
local next, type, tostring = next, type, tostring
local concat = table.concat
+local texcount = tex.count
local definetable = utilities.tables.definetable
local accesstable = utilities.tables.accesstable
@@ -29,7 +30,7 @@ local packers = utilities.packers
local allocate = utilities.storage.allocate
local mark = utilities.storage.mark
-local report_jobcontrol = logs.reporter("jobcontrol")
+local report_passes = logs.reporter("job","passes")
job = job or { }
local job = job
@@ -146,9 +147,7 @@ function job.save(filename) -- we could return a table but it can get pretty lar
for c=1,#comment do
f:write("-- ",comment[c],"\n")
end
- f:write("\n")
- f:write("local utilitydata = { }\n")
- f:write("\n")
+ f:write("\nlocal utilitydata = { }\n\n")
for l=1,#savelist do
local list = savelist[l]
local target = format("utilitydata.%s",list[1])
@@ -160,16 +159,13 @@ function job.save(filename) -- we could return a table but it can get pretty lar
if job.pack then
packers.pack(data,jobpacker,true)
end
- f:write(definetable(target),"\n")
- f:write(serialize(data,target,true,true),"\n")
+ f:write(definetable(target),"\n",serialize(data,target,true,true),"\n")
end
if job.pack then
packers.strip(jobpacker)
f:write(serialize(jobpacker,"utilitydata.job.packed",true,true),"\n")
end
- f:write("\n")
- f:write("return utilitydata\n")
- f:write("\n")
+ f:write("\nreturn utilitydata\n\n")
f:close()
end
statistics.stoptiming(_save_)
@@ -180,7 +176,7 @@ local function load(filename)
if data and data ~= "" then
local version = tonumber(match(data,"^-- version: ([%d%.]+)"))
if version ~= job.version then
- report_jobcontrol("version mismatch with jobfile: %s <> %s", version or "?", job.version)
+ report_passes("version mismatch: %s <> %s", version or "?", job.version)
else
local data = loadstring(data)
return data and data()
@@ -252,7 +248,7 @@ end)
statistics.register("callbacks", function()
local total, indirect = status.callbacks or 0, status.indirect_callbacks or 0
- local pages = tex.count['realpageno'] - 1
+ local pages = texcount['realpageno'] - 1
if pages > 1 then
return format("direct: %s, indirect: %s, total: %s (%i per page)", total-indirect, indirect, total, total/pages)
else
@@ -268,8 +264,8 @@ end)
function statistics.formatruntime(runtime)
if not environment.initex then -- else error when testing as not counters yet
- local shipped = tex.count['nofshipouts']
- local pages = tex.count['realpageno'] - 1
+ local shipped = texcount['nofshipouts']
+ local pages = texcount['realpageno'] - 1
if shipped > 0 or pages > 0 then
local persecond = shipped / runtime
if pages == 0 then pages = shipped end