diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-07-09 10:26:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-07-09 10:26:00 +0200 |
commit | 305f6529b5970f953803716fb0e475c7f52ff3b5 (patch) | |
tree | cb12e68f1c1aa8e22a7a3f06bd7bc91f63add0b8 /tex/context/base/core-uti.lua | |
parent | 19e6c5feec9f26dd796a135d3f2924b9b15a998a (diff) | |
download | context-305f6529b5970f953803716fb0e475c7f52ff3b5.tar.gz |
beta 2014.07.09 10:26
Diffstat (limited to 'tex/context/base/core-uti.lua')
-rw-r--r-- | tex/context/base/core-uti.lua | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tex/context/base/core-uti.lua b/tex/context/base/core-uti.lua index 1903ad823..d172eb05f 100644 --- a/tex/context/base/core-uti.lua +++ b/tex/context/base/core-uti.lua @@ -65,6 +65,7 @@ job.comment("version",job.version) local enabled = true 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 @@ -74,6 +75,9 @@ function job.initialize(loadname,savename) 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 job.save(savename) end end) @@ -283,6 +287,28 @@ function job.loadother(filename) statistics.stoptiming(_load_) end +-- function job.keep(filename) +-- local suffix = file.suffix(filename) +-- local base = file.removesuffix(filename) +-- if suffix == "" then +-- suffix = "tuc" +-- end +-- for i=1,10 do +-- local tmpname = format("%s-%s-%02d.tmp",base,suffix,i) +-- if lfs.isfile(tmpname) then +-- os.remove(tmpname) +-- report_passes("removing %a",tmpname) +-- end +-- end +-- if lfs.isfile(filename) then +-- local tmpname = format("%s-%s-%02d.tmp",base,suffix,environment.currentrun or 1) +-- report_passes("copying %a into %a",filename,tmpname) +-- file.copy(filename,tmpname) +-- else +-- report_passes("no file %a, nothing kept",filename) +-- end +-- end + -- eventually this will end up in strc-ini statistics.register("startup time", function() @@ -352,6 +378,5 @@ function statistics.formatruntime(runtime) end end - commands.savevariable = job.variables.save commands.setjobcomment = job.comment |