summaryrefslogtreecommitdiff
path: root/scripts/context/lua/mtx-context.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/context/lua/mtx-context.lua')
-rw-r--r--scripts/context/lua/mtx-context.lua29
1 files changed, 19 insertions, 10 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index c50c4a77a..4466992fd 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -159,7 +159,7 @@ local formatofinterface = {
local defaultformats = {
"cont-en",
- "cont-nl",
+ -- "cont-nl",
}
-- purging files (we should have an mkii and mkiv variants)
@@ -209,7 +209,11 @@ local persistent_runfiles = {
}
local special_runfiles = {
- "%-mpgraph", "%-mprun", "%-temp%-"
+ "%-mpgraph", "%-mprun", "%-temp%-",
+}
+
+local extra_runfiles = {
+ "^l_m_t_x_.-%.pdf$",
}
local function purge_file(dfile,cfile)
@@ -446,8 +450,7 @@ local function pdf_open(name,method)
end
pdfview.open(pdfname)
statistics.stoptiming("pdfview")
- -- report("pdfview overhead after opening: %0.3f seconds",statistics.elapsedtime("pdfview"))
- report("pdfview overhead: %0.3f seconds",statistics.elapsedtime("pdfview"))
+ report("pdfview overhead: %s seconds",statistics.elapsedtime("pdfview"))
end
local function pdf_close(name,method)
@@ -461,7 +464,6 @@ local function pdf_close(name,method)
pdfname = name .. ".pdf" -- agressive
pdfview.close(pdfname)
statistics.stoptiming("pdfview")
- -- report("pdfview overhead after closing: %0.3f seconds",statistics.elapsedtime("pdfview"))
end
-- result file handling
@@ -539,7 +541,7 @@ end
local function luatex_command(l_flags,c_flags,filename,engine)
return format('%s %s %s "%s"',
- engine or "luatex",
+ engine or (status and status.luatex_engine) or "luatex",
flags_to_string(l_flags),
flags_to_string(c_flags,true),
filename
@@ -874,10 +876,12 @@ function scripts.context.run(ctxdata,filename)
--
report("run %s: %s",currentrun,command)
print("") -- cleaner, else continuation on same line
- local returncode, errorstring = os.spawn(command)
+-- local returncode, errorstring = os.spawn(command)
+ local returncode = os.execute(command)
-- todo: remake format when no proper format is found
if not returncode then
- report("fatal error: no return code, message: %s",errorstring or "?")
+-- report("fatal error: no return code, message: %s",errorstring or "?")
+ report("fatal error: no return code")
if resultname then
result_save_error(oldbase,newbase)
end
@@ -1194,7 +1198,7 @@ function scripts.context.make(name)
scripts.context.generate()
end
local list = (name and { name }) or (environment.filenames[1] and environment.filenames) or defaultformats
- local engine = getargument("engine") or "luatex"
+ local engine = getargument("engine") or (status and status.luatex_engine) or "luatex"
if getargument("jit") then
engine = "luajittex"
end
@@ -1203,7 +1207,7 @@ function scripts.context.make(name)
name = formatofinterface[name] or name or ""
if name == "" then
-- nothing
- elseif engine == "luatex" or engine == "luajittex" then
+ elseif engine == "luametatex" or engine == "luatex" or engine == "luajittex" then
make_mkiv_format(name,engine)
elseif engine == "pdftex" or engine == "xetex" then
make_mkii_format(name,engine)
@@ -1362,6 +1366,11 @@ function scripts.context.purge(all,pattern,mkiitoo)
end
end
end
+ for i=1,#extra_runfiles do
+ if find(basename,extra_runfiles[i]) then
+ deleted[#deleted+1] = purge_file(name)
+ end
+ end
end
if #deleted > 0 then
report("purged files: %s", concat(deleted,", "))