diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/luat-run.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/luat-run.lua | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/context/base/luat-run.lua b/Master/texmf-dist/tex/context/base/luat-run.lua index ce25d1f55a3..eaede103014 100644 --- a/Master/texmf-dist/tex/context/base/luat-run.lua +++ b/Master/texmf-dist/tex/context/base/luat-run.lua @@ -9,10 +9,15 @@ if not modules then modules = { } end modules ['luat-run'] = { local format = string.format local insert = table.insert +-- trace_job_status is also controlled by statistics.enable that is set via the directive system.nostatistics + local trace_lua_dump = false trackers.register("system.dump", function(v) trace_lua_dump = v end) local trace_temp_files = false trackers.register("system.tempfiles", function(v) trace_temp_files = v end) +local trace_job_status = true trackers.register("system.jobstatus", function(v) trace_job_status = v end) +local trace_tex_status = false trackers.register("system.texstatus", function(v) trace_tex_status = v end) local report_lua = logs.reporter("system","lua") +local report_tex = logs.reporter("system","status") local report_tempfiles = logs.reporter("resolvers","tempfiles") luatex = luatex or { } @@ -24,9 +29,6 @@ local stopactions = { } function luatex.registerstartactions(...) insert(startactions, ...) end function luatex.registerstopactions (...) insert(stopactions, ...) end -luatex.showtexstat = luatex.showtexstat or function() end -luatex.showjobstat = luatex.showjobstat or statistics.showjobstat - local function start_run() if logs.start_run then logs.start_run() @@ -40,12 +42,12 @@ local function stop_run() for i=1,#stopactions do stopactions[i]() end - if luatex.showjobstat then - statistics.show(logs.report_job_stat) + if trace_job_status then + statistics.show() end - if luatex.showtexstat then - for k,v in next, status.list() do - logs.report_tex_stat(k,v) + if trace_tex_status then + for k, v in table.sortedhash(status.list()) do + report_tex("%S=%S",k,v) end end if logs.stop_run then @@ -67,15 +69,14 @@ end local function report_output_log() end ---~ local function show_open() ---~ end +-- local function show_open() +-- end ---~ local function show_close() ---~ end +-- local function show_close() +-- end local function pre_dump_actions() lua.finalize(trace_lua_dump and report_lua or nil) - statistics.reportstorage("log") -- statistics.savefmtstatus("\jobname","\contextversion","context.tex") end @@ -84,8 +85,8 @@ end callbacks.register('start_run', start_run, "actions performed at the beginning of a run") callbacks.register('stop_run', stop_run, "actions performed at the end of a run") ---~ callbacks.register('show_open', show_open, "actions performed when opening a file") ---~ callbacks.register('show_close', show_close, "actions performed when closing a file") +---------.register('show_open', show_open, "actions performed when opening a file") +---------.register('show_close', show_close, "actions performed when closing a file") callbacks.register('report_output_pages', report_output_pages, "actions performed when reporting pages") callbacks.register('report_output_log', report_output_log, "actions performed when reporting log file") @@ -107,7 +108,7 @@ function luatex.registertempfile(name,extrasuffix) name = name .. ".mkiv-tmp" -- maybe just .tmp end if trace_temp_files and not tempfiles[name] then - report_tempfiles("registering temporary file: %s",name) + report_tempfiles("registering temporary file %a",name) end tempfiles[name] = true return name @@ -116,7 +117,7 @@ end function luatex.cleanuptempfiles() for name, _ in next, tempfiles do if trace_temp_files then - report_tempfiles("removing temporary file: %s",name) + report_tempfiles("removing temporary file %a",name) end os.remove(name) end @@ -138,8 +139,9 @@ directives.register("system.synctex", function(v) else report_system("synctex functionality is disabled!") end + synctex = tonumber(synctex) or (toboolean(synctex,true) and 1) or (synctex == "zipped" and 1) or (synctex == "unzipped" and -1) or false -- currently this is bugged: - tex.synctex = synctex and 1 or 0 + tex.synctex = synctex -- so for the moment we need: context.normalsynctex() if synctex then @@ -150,7 +152,7 @@ directives.register("system.synctex", function(v) end) statistics.register("synctex tracing",function() - if synctex or tex.synctex > 0 then + if synctex or tex.synctex ~= 0 then return "synctex has been enabled (extra log file generated)" end end) |