diff options
author | Marius <mariausol@gmail.com> | 2011-11-17 16:40:15 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-11-17 16:40:15 +0200 |
commit | 4d0577229a188b5026af47e7318bfa6f81ab20df (patch) | |
tree | a890f22d0c19c212cf5f13dace45670a950fa184 /tex/context/base/core-uti.lua | |
parent | 43e678821c0c2ee8d8130adb6a109a2b0330889d (diff) | |
download | context-4d0577229a188b5026af47e7318bfa6f81ab20df.tar.gz |
beta 2011.11.17 15:19
Diffstat (limited to 'tex/context/base/core-uti.lua')
-rw-r--r-- | tex/context/base/core-uti.lua | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tex/context/base/core-uti.lua b/tex/context/base/core-uti.lua index febb5cebd..69b8fffe1 100644 --- a/tex/context/base/core-uti.lua +++ b/tex/context/base/core-uti.lua @@ -53,10 +53,18 @@ end job.comment(format("version: %1.2f",job.version)) +local enabled = true + +directives.register("job.save",function(v) enabled = v end) + +function job.disablesave() -- can be command + enabled = false +end + function job.initialize(loadname,savename) job.load(loadname) -- has to come after structure is defined ! luatex.registerstopactions(function() - if not status.lasterrorstring or status.lasterrorstring == "" then + if enabled and not status.lasterrorstring or status.lasterrorstring == "" then job.save(savename) end end) @@ -225,11 +233,17 @@ statistics.register("startup time", function() end) statistics.register("jobdata time",function() - if statistics.elapsedindeed(_save_) or statistics.elapsedindeed(_load_) or #_others_ > 0 then + if enabled then + if #_others_ > 0 then + return format("%s seconds saving, %s seconds loading, other files: %s",statistics.elapsedtime(_save_),statistics.elapsedtime(_load_),concat(_others_," ")) + else + return format("%s seconds saving, %s seconds loading",statistics.elapsedtime(_save_),statistics.elapsedtime(_load_)) + end + else if #_others_ > 0 then - return format("%s seconds saving, %s seconds loading, other files: %s", statistics.elapsedtime(_save_), statistics.elapsedtime(_load_),concat(_others_," ")) + return format("nothing saved, %s seconds loading, other files: %s",statistics.elapsedtime(_load_),concat(_others_," ")) else - return format("%s seconds saving, %s seconds loading", statistics.elapsedtime(_save_), statistics.elapsedtime(_load_)) + return format("nothing saved, %s seconds loading",statistics.elapsedtime(_load_)) end end end) |