From 83a331fff83ac18314885a39e959ca0c10f316f7 Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 15 Jul 2010 23:20:05 +0300 Subject: beta 2010-07-15 15:05 --- tex/context/base/mlib-run.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tex/context/base/mlib-run.lua') diff --git a/tex/context/base/mlib-run.lua b/tex/context/base/mlib-run.lua index b961fa02c..0467498d0 100644 --- a/tex/context/base/mlib-run.lua +++ b/tex/context/base/mlib-run.lua @@ -33,14 +33,19 @@ local trace_graphics = false trackers.register("metapost.graphics", function(v) local report_mplib = logs.new("mplib") +local texerrormessage = tracers.texerrormessage + local format, gsub, match = string.format, string.gsub, string.match local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming metapost = metapost or { } -metapost.showlog = false -metapost.lastlog = "" +metapost.showlog = false +metapost.lastlog = "" +metapost.texerrors = false + +directives.register("mplib.texerrors", function(v) metapost.texerrors = v end) function metapost.resetlastlog() metapost.lastlog = "" @@ -127,10 +132,10 @@ function metapost.reporterror(result) elseif result.status > 0 then local t, e, l = result.term, result.error, result.log if t and t ~= "" then - report_mplib("mp terminal: %s",t) + (metapost.texerrors and texerrormessage or report_mplib)("mp terminal: %s",t) end if e then - report_mplib("mp error: %s",(e=="" and "?") or e) + (metapost.texerrors and texerrormessage or report_mplib)("mp error: %s",(e=="" and "?") or e) end if not t and not e and l then metapost.lastlog = metapost.lastlog .. "\n" .. l -- cgit v1.2.3