diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/core-uti.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/core-uti.lua | 41 |
1 files changed, 12 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-uti.lua b/Master/texmf-dist/tex/context/base/mkiv/core-uti.lua index 50c7bc9dc6a..887ef9a7536 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/core-uti.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/core-uti.lua @@ -43,7 +43,7 @@ local report_passes = logs.reporter("job","passes") job = job or { } local job = job -job.version = 1.31 +job.version = 1.32 job.packversion = 1.02 -- some day we will implement loading of other jobs and then we need @@ -73,10 +73,9 @@ local enabled = true local initialized = false directives.register("job.save",function(v) enabled = v end) -----------.register("job.keep",function(v) kept = v end) -function job.disablesave() -- can be command - enabled = false +function job.disablesave() + enabled = false -- for instance called when an error end function job.initialize(loadname,savename) @@ -89,10 +88,7 @@ function job.initialize(loadname,savename) end job.load(loadname) -- has to come after structure is defined ! luatex.registerstopactions(function() - if enabled and not status.lasterrorstring or status.lasterrorstring == "" then - -- if kept then - -- job.keep(loadname) -- could move to mtx-context instead - -- end + if enabled then job.save(savename) end end) @@ -396,37 +392,24 @@ statistics.register("jobdata time",function() end end) --- statistics.register("callbacks", function() --- local total, indirect = status.callbacks or 0, status.indirect_callbacks or 0 --- local pages = texgetcount('realpageno') - 1 --- if pages > 1 then --- return format("direct: %s, indirect: %s, total: %s (%i per page)", total-indirect, indirect, total, total/pages) --- else --- return format("direct: %s, indirect: %s, total: %s", total-indirect, indirect, total) --- end --- end) - -function statistics.callbacks() +statistics.register("callbacks", function() local c_internal = status.callbacks or 0 local c_file = status.indirect_callbacks or 0 local c_direct = status.direct_callbacks or 0 - local c_late = backends.noflatelua() or 0 + local c_late = backends.getcallbackstate().count local c_function = status.function_callbacks or 0 local c_total = c_internal + c_file + c_direct + c_late + c_function - local n_pages = texgetcount('realpageno') - 1 + local n_pages = structures.pages.nofpages or 0 local c_average = n_pages > 0 and math.round(c_total/n_pages) or 0 - local s_result = format ( - c_average > 0 and "internal: %s, file: %s, direct: %s, late: %s, function %s, total: %s (%s per page)" - or "internal: %s, file: %s, direct: %s, late: %s, function %s, total: %s", + local result = format ( + "internal: %s, file: %s, direct: %s, late: %s, function %s, total: %s (%s per page)", c_internal, c_file, c_direct, c_late, c_function, c_total, c_average ) statistics.callbacks = function() - return s_result + return result end - return s_result -end - -statistics.register("callbacks", statistics.callbacks) + return result +end) statistics.register("randomizer", function() if rmethod and rvalue then |