summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/trac-deb.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/trac-deb.lua')
-rw-r--r--tex/context/base/mkiv/trac-deb.lua100
1 files changed, 17 insertions, 83 deletions
diff --git a/tex/context/base/mkiv/trac-deb.lua b/tex/context/base/mkiv/trac-deb.lua
index cdf40fd59..4667b66ee 100644
--- a/tex/context/base/mkiv/trac-deb.lua
+++ b/tex/context/base/mkiv/trac-deb.lua
@@ -114,48 +114,6 @@ end
-- for now here
-if CONTEXTLMTXMODE > 0 then
-
- local ioflush = io.flush
- local ioread = io.read
- local writenl = texio.write_nl
- local write = texio.write
-
- local runtoks = tex.runtoks
- local terminaldata = false
- local context = context
-
- interfaces.implement {
- name = "fetchterminaldata",
- actions = function()
- context(terminaldata)
- end,
- }
-
- function texio.terminal()
- writenl("\n" .. "entering interactive mode, use \\quit to abort reading" .."\n\n")
- while true do
- write(">")
- ioflush()
- terminaldata = ioread()
- if terminaldata == "\\quit" then
- terminaldata = false
- break
- else
- runtoks("t_syst_terminal_data",nil,nil,true) -- obeymode
- end
- end
- end
-
- interfaces.implement {
- name = "readfromterminal",
- public = true,
- protected = true,
- actions = texio.terminal,
- }
-
-end
-
local savedluaerror = nil
local usescitelexer = nil
local quitonerror = true
@@ -227,18 +185,12 @@ end
-- todo: some nested errors have two line numbers
-- todo: collect errorcontext in string (after code cleanup)
-- todo: have a separate status.lualinenumber
-
-- todo: \starttext bla \blank[foo] bla \stoptext
local nop = function() end
local resetmessages = status.resetmessages or nop
local function processerror(offset,eof)
- -- print("[[ last tex error: " .. tostring(status.lasterrorstring or "<unset>") .. " ]]")
- -- print("[[ last lua error: " .. tostring(status.lastluaerrorstring or "<unset>") .. " ]]")
- -- print("[[ last warning : " .. tostring(status.lastwarningstring or "<unset>") .. " ]]")
- -- print("[[ last location : " .. tostring(status.lastwarninglocation or "<unset>") .. " ]]")
- -- print("[[ last context : " .. tostring(status.lasterrorcontext or "<unset>") .. " ]]")
local filename = status.filename
local linenumber = tonumber(status.linenumber) or 0
local lastcontext = status.lasterrorcontext
@@ -260,6 +212,9 @@ local function processerror(offset,eof)
lasttexhelp = tex.gethelptext and tex.gethelptext() or nil,
endoffile = eof,
}
+ if job and type(job.disablesave) == "function" then
+ job.disablesave()
+ end
end
directives.register("system.quitonerror",function(v)
@@ -361,41 +316,20 @@ function tracers.printwarning(specification)
logs.report("luatex warning","%s: %s",specification.lastlocation,specification.lastwarning)
end
-if CONTEXTLMTXMODE > 0 then
-
- directives.register("system.errorcontext", function(v)
- local register = callback.register
- if v then
- register('show_error_message', nop)
- register('show_warning_message', function() processwarning(v) end)
- register('intercept_lua_error', function() processerror(v) end)
- register('intercept_tex_error', function(mode,eof) processerror(v,eof) end)
- else
- register('show_error_message', nil)
- register('show_warning_message', nil)
- register('intercept_lua_error', nil)
- register('intercept_tex_error', nil)
- end
- end)
-
-else
-
- directives.register("system.errorcontext", function(v)
- local register = callback.register
- if v then
- register('show_error_message', nop)
- register('show_warning_message',function() processwarning(v) end)
- register('show_error_hook', function(eof) processerror(v,eof) end)
- register('show_lua_error_hook', function() processerror(v) end)
- else
- register('show_error_message', nil)
- register('show_error_hook', nil)
- register('show_warning_message',nil)
- register('show_lua_error_hook', nil)
- end
- end)
-
-end
+directives.register("system.errorcontext", function(v)
+ local register = callback.register
+ if v then
+ register('show_error_message', nop)
+ register('show_warning_message',function() processwarning(v) end)
+ register('show_error_hook', function(eof) processerror(v,eof) end)
+ register('show_lua_error_hook', function() processerror(v) end)
+ else
+ register('show_error_message', nil)
+ register('show_error_hook', nil)
+ register('show_warning_message',nil)
+ register('show_lua_error_hook', nil)
+ end
+end)
-- this might move