texlive[57266] Master/texmf-dist: luamplib (30dec20)

commits+karl at tug.org commits+karl at tug.org
Wed Dec 30 22:52:47 CET 2020


Revision: 57266
          http://tug.org/svn/texlive?view=revision&revision=57266
Author:   karl
Date:     2020-12-30 22:52:47 +0100 (Wed, 30 Dec 2020)
Log Message:
-----------
luamplib (30dec20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS
    trunk/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
    trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
    trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
    trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
    trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty

Modified: trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS	2020-12-30 21:52:31 UTC (rev 57265)
+++ trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS	2020-12-30 21:52:47 UTC (rev 57266)
@@ -1,5 +1,11 @@
                        History of the luamplib package
 
+2020/12/30 2.20.6
+    * fix a bug regarding no figure output when luamplib.showlog is
+      true. (#91)
+    * now metapost `show' command triggers a warning message, so that
+      it could be shown on the console. (#91)
+
 2020/02/24 2.20.5
     * Extra check for \pdfliteral (PR #89)
     * allow expansion of \mpdim and \mpcolor when they are used in

Modified: trunk/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex	2020-12-30 21:52:31 UTC (rev 57265)
+++ trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex	2020-12-30 21:52:47 UTC (rev 57266)
@@ -164,4 +164,6 @@
     rotatedlabel.top(textext("Rotated!"), origin, 45);
   endfig;
 \end{mplibcode}%
+
+\tracingcommands0
 \end{document}

Modified: trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
===================================================================
--- trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx	2020-12-30 21:52:31 UTC (rev 57265)
+++ trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx	2020-12-30 21:52:47 UTC (rev 57266)
@@ -85,7 +85,7 @@
 %<*driver>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{luamplib.drv}%
-  [2020/02/24 v2.20.5 Interface for using the mplib library]%
+  [2020/12/30 v2.20.6 Interface for using the mplib library]%
 \documentclass{ltxdoc}
 \usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace}
 \usepackage[x11names]{xcolor}
@@ -153,7 +153,7 @@
 % \author{Hans Hagen, Taco Hoekwater, Elie Roux, Philipp Gesang and Kim Dohyun\\
 % Maintainer: LuaLaTeX Maintainers ---
 % Support: \email{lualatex-dev at tug.org}}
-% \date{2020/02/24 v2.20.5}
+% \date{2020/12/30 v2.20.6}
 %
 % \maketitle
 %
@@ -407,8 +407,8 @@
 
 luatexbase.provides_module {
   name          = "luamplib",
-  version       = "2.20.5",
-  date          = "2020/02/24",
+  version       = "2.20.6",
+  date          = "2020/12/30",
   description   = "Lua package to typeset Metapost with LuaTeX's MPLib.",
 }
 
@@ -427,7 +427,6 @@
 local luamplib    = luamplib
 
 luamplib.showlog  = luamplib.showlog or false
-luamplib.lastlog  = ""
 
 %    \end{macrocode}
 %
@@ -702,23 +701,35 @@
   input %s ;
 ]]
 
-local function luamplibresetlastlog()
-  luamplib.lastlog = ""
-end
-
-local function reporterror (result)
+local function reporterror (result, indeed)
   if not result then
     err("no result object returned")
   else
     local t, e, l = result.term, result.error, result.log
     local log = t or l or "no-term"
-    log = log:gsub("^%s+","\n")
-    luamplib.lastlog = luamplib.lastlog .. "\n" .. (l or t or "no-log")
+    log = log:gsub("%(Please type a command or say `end'%)",""):gsub("\n+","\n")
     if result.status > 0 then
-      warn("%s",log)
+      warn(log)
       if result.status > 1 then
-        err("%s",e or "see above messages")
+        err(e or "see above messages")
       end
+    else
+%    \end{macrocode}
+%
+%    v2.6.1: now luamplib does not disregard |show| command,
+%    even when |luamplib.showlog| is false.  Incidentally,
+%    it does not raise error but just prints a warning,
+%    even if output has no figure.
+%    \begin{macrocode}
+      if log:find"\n>>" then
+        warn(log)
+      elseif log:find"%g" then
+        if luamplib.showlog then
+          info(log)
+        elseif indeed and not result.fig then
+          info(log)
+        end
+      end
     end
     return log
   end
@@ -784,23 +795,11 @@
   local converted, result = false, {}
   if mpx and data then
     result = mpx:execute(data)
-    local log = reporterror(result)
+    local log = reporterror(result, true)
     if log then
-      if luamplib.showlog then
-        info("%s",luamplib.lastlog)
-        luamplibresetlastlog()
-      elseif result.fig then
-%    \end{macrocode}
-%
-%    v2.6.1: now luamplib does not disregard |show| command,
-%    even when |luamplib.showlog| is false.  Incidentally,
-%    it does not raise error but just prints a warning,
-%    even if output has no figure.
-%    \begin{macrocode}
-        if log:find("\n>>") then info("%s",log) end
+      if result.fig then
         converted = luamplib.convert(result)
       else
-        info("%s",log)
         warn("No figure output. Maybe no beginfig/endfig")
       end
     end
@@ -1960,7 +1959,7 @@
 \else
   \NeedsTeXFormat{LaTeX2e}
   \ProvidesPackage{luamplib}
-    [2020/02/24 v2.20.5 mplib package for LuaTeX]
+    [2020/12/30 v2.20.6 mplib package for LuaTeX]
   \ifx\newluafunction\@undefined
   \input ltluatex
   \fi

Modified: trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua	2020-12-30 21:52:31 UTC (rev 57265)
+++ trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua	2020-12-30 21:52:47 UTC (rev 57266)
@@ -11,8 +11,8 @@
 
 luatexbase.provides_module {
   name          = "luamplib",
-  version       = "2.20.5",
-  date          = "2020/02/24",
+  version       = "2.20.6",
+  date          = "2020/12/30",
   description   = "Lua package to typeset Metapost with LuaTeX's MPLib.",
 }
 
@@ -26,7 +26,6 @@
 local luamplib    = luamplib
 
 luamplib.showlog  = luamplib.showlog or false
-luamplib.lastlog  = ""
 
 local tableconcat   = table.concat
 local texsprint     = tex.sprint
@@ -247,23 +246,28 @@
   input %s ;
 ]]
 
-local function luamplibresetlastlog()
-  luamplib.lastlog = ""
-end
-
-local function reporterror (result)
+local function reporterror (result, indeed)
   if not result then
     err("no result object returned")
   else
     local t, e, l = result.term, result.error, result.log
     local log = t or l or "no-term"
-    log = log:gsub("^%s+","\n")
-    luamplib.lastlog = luamplib.lastlog .. "\n" .. (l or t or "no-log")
+    log = log:gsub("%(Please type a command or say `end'%)",""):gsub("\n+","\n")
     if result.status > 0 then
-      warn("%s",log)
+      warn(log)
       if result.status > 1 then
-        err("%s",e or "see above messages")
+        err(e or "see above messages")
       end
+    else
+      if log:find"\n>>" then
+        warn(log)
+      elseif log:find"%g" then
+        if luamplib.showlog then
+          info(log)
+        elseif indeed and not result.fig then
+          info(log)
+        end
+      end
     end
     return log
   end
@@ -306,16 +310,11 @@
   local converted, result = false, {}
   if mpx and data then
     result = mpx:execute(data)
-    local log = reporterror(result)
+    local log = reporterror(result, true)
     if log then
-      if luamplib.showlog then
-        info("%s",luamplib.lastlog)
-        luamplibresetlastlog()
-      elseif result.fig then
-        if log:find("\n>>") then info("%s",log) end
+      if result.fig then
         converted = luamplib.convert(result)
       else
-        info("%s",log)
         warn("No figure output. Maybe no beginfig/endfig")
       end
     end

Modified: trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty	2020-12-30 21:52:31 UTC (rev 57265)
+++ trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty	2020-12-30 21:52:47 UTC (rev 57266)
@@ -14,7 +14,7 @@
 \else
   \NeedsTeXFormat{LaTeX2e}
   \ProvidesPackage{luamplib}
-    [2020/02/24 v2.20.5 mplib package for LuaTeX]
+    [2020/12/30 v2.20.6 mplib package for LuaTeX]
   \ifx\newluafunction\@undefined
   \input ltluatex
   \fi



More information about the tex-live-commits mailing list.