summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/cont-run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/cont-run.lua')
-rw-r--r--tex/context/base/mkiv/cont-run.lua48
1 files changed, 42 insertions, 6 deletions
diff --git a/tex/context/base/mkiv/cont-run.lua b/tex/context/base/mkiv/cont-run.lua
index 9bd252e60..2634654fe 100644
--- a/tex/context/base/mkiv/cont-run.lua
+++ b/tex/context/base/mkiv/cont-run.lua
@@ -142,6 +142,7 @@ trackers.register("sandbox.tracecalls",sandbox.logcalls)
trackers.register("sandbox.tracefiles",sandbox.logfiles)
local sandboxing = environment.arguments.sandbox
+local debugging = environment.arguments.debug
if sandboxing then
@@ -170,15 +171,33 @@ if sandboxing then
\let\normalprimitive\relax
]]
-end
+ debug = {
+ traceback = traceback,
+ }
-local function processjob()
+ package.loaded.debug = debug
- environment.initializefilenames() -- todo: check if we really need to pre-prep the filename
+elseif debugging then
+
+ -- we keep debug
+
+else
+
+ debug = {
+ traceback = traceback,
+ getinfo = getinfo,
+ sethook = sethook,
+ }
+
+ package.loaded.debug = debug
+
+end
+
+local preparejob preparejob = function() -- tricky: we need a hook for this
local arguments = environment.arguments
- local suffix = environment.suffix
- local filename = environment.filename -- hm, not inputfilename !
+
+ environment.lmtxmode = CONTEXTLMTXMODE
if arguments.nosynctex then
luatex.synctex.setup {
@@ -222,6 +241,24 @@ local function processjob()
-- directives.enable("logs.errors",arguments.errors)
-- end
+ preparejob = function() end
+
+ job.prepare = preparejob
+
+end
+
+job.prepare = preparejob
+
+local function processjob()
+
+ environment.initializefilenames() -- todo: check if we really need to pre-prep the filename
+
+ local arguments = environment.arguments
+ local suffix = environment.suffix
+ local filename = environment.filename -- hm, not inputfilename !
+
+ preparejob()
+
if not filename or filename == "" then
-- skip
elseif suffix == "xml" or arguments.forcexml then
@@ -285,7 +322,6 @@ local function processjob()
-- \writestatus{system}{processing as tex}
-- We have a regular tex file so no \starttext yet as we can
-- load fonts.
-
-- context.enabletrackers { "resolvers.*" }
context.input(filename)
-- context.disabletrackers { "resolvers.*" }