texlive[63115] trunk: texlogsieve (23apr22)

commits+karl at tug.org commits+karl at tug.org
Sat Apr 23 23:11:57 CEST 2022


Revision: 63115
          http://tug.org/svn/texlive?view=revision&revision=63115
Author:   karl
Date:     2022-04-23 23:11:56 +0200 (Sat, 23 Apr 2022)
Log Message:
-----------
texlogsieve (23apr22)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/texlogsieve/texlogsieve
    trunk/Master/texmf-dist/doc/man/man1/texlogsieve.1
    trunk/Master/texmf-dist/doc/man/man1/texlogsieve.man1.pdf
    trunk/Master/texmf-dist/doc/support/texlogsieve/README.md
    trunk/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.pdf
    trunk/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex
    trunk/Master/texmf-dist/scripts/texlogsieve/texlogsieve

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlogsieve/texlogsieve
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlogsieve/texlogsieve	2022-04-23 21:11:35 UTC (rev 63114)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlogsieve/texlogsieve	2022-04-23 21:11:56 UTC (rev 63115)
@@ -553,7 +553,7 @@
 offending text, if any, always starts at the beginning of a line and
 ends at the end of a line.
 
-About the description: https://tex.stackexchange.com/a/367589/217608
+About the description: https://tex.stackexchange.com/a/367589
 
 This all means that handling these messages from a pipe is different
 than from the log file, because in the log file you know there will
@@ -1002,7 +1002,7 @@
 
   --version
   if vars.version then
-      print("texlogsieve 1.1.2")
+      print("texlogsieve 1.1.3")
       print("Copyright (C) 2021, 2022 Nelson Lago <lago at ime.usp.br>")
       print("License GPLv3+: GNU GPL version 3 or later "
             .. "<https://gnu.org/licenses/gpl.html>.")
@@ -1887,6 +1887,20 @@
     'You already have nine',
 }
 
+function errorHandler:isErrorLine(line)
+  local _, last = string.find(line, '^! ')
+  if not last then
+      _, last = string.find(line, '^' .. filepat .. ':%d+: ')
+  end
+
+  return last
+end
+
+function errorHandler:isRunawayLine(line)
+  local _, last = string.find(line, '^Runaway argument%?')
+  return last
+end
+
 function errorHandler:canDoit(position)
   if position == nil then position = 0 end
   local line = Lines:get(position)
@@ -1893,64 +1907,100 @@
   if line == nil then return false, {} end
 
   -- This error does not start with "! " or "file:line: "
-  local _, last = string.find(line, '^Runaway argument%?')
-  if last then return true, {} end
+  local last = self:isRunawayLine(line)
+  if last then return true, {numLines = 1} end
 
-  -- If the line does not start with "! " or "file:line: ", get out.
-  _, last = string.find(line, '^! ')
-  if not last then
-      _, last = string.find(line, '^' .. filepat .. ':%d+: ')
-      if not last then return false, {} end
-  end
+  last = self:isErrorLine(line)
+  if not last then return false, {} end
 
-  -- OK, this might be an error, but we need to be sure;
-  -- let's look for a known error message
-  local candidateText = string.sub(line, last +1)
-  for _, pat in ipairs(self.patterns) do
-      _, last = string.find(candidateText,  pat)
-      if last ~= nil then break end
-  end
-  if last then return true, {} end
-
-  -- Not a known error message; let's look for a line number
-  -- or "Type  H <return>  for immediate help"
+  -- Looks like an error; Let's look ahead to identify the other
+  -- lines that are part of the error message. We do not want to
+  -- look too much ahead, so we just scan the current buffer.
   position = position +1
-  local found = false
-  while not found and position < Lines:numLines() do
-      local first = string.find(Lines:get(position), '^l%.%d+ ')
-      if first then found = true end
+  local lastline = nil
+  while position < Lines:numLines() do
+      -- if there is a second error, don't look further ahead
+      if self:isErrorLine(Lines:get(position))
+              or self:isRunawayLine(Lines:get(position))
 
-      first = string.find(Lines:get(position),
-                         '^Type%s+H %<return%>%s+for immediate help%.')
-      if first then found = true end
+      then break end
 
+      if string.find(Lines:get(position), '^l%.%d+ ') then
+          local length = string.len(Lines:get(position))
+          if string.find(Lines:get(position +1),
+                         "^" .. string.rep(" ", length))
+          then
+              lastline = position +1 -- the following line is the last
+          else
+              -- the following line is empty, so it was skipped
+              -- when reading the file
+              lastline = position
+          end
+      end
+
+      if string.find(Lines:get(position),
+                         '^Type%s+H %<return%>%s+for immediate help%.') then
+          lastline = position
+      end
+
       position = position +1
   end
 
-  if found then
-      return true, {}
+  if lastline then
+      -- position starts at zero, so numlines needs +1
+      return true, {numLines = lastline +1}
   else
-      return false, {}
+      -- This looks like an error, but there is no "l.NUM" line following
+      -- it, so it is probably a false positive. Still, let's check for
+      -- some known error messages.
+      local candidateText = string.sub(line, last +1)
+      for _, pat in ipairs(self.patterns) do
+          _, last = string.find(candidateText, pat)
+          if last ~= nil then return true, {numLines = 1} end
+      end
   end
+
+  return false, {} -- this was really a false positive
 end
 
-function errorHandler:doit()
+function errorHandler:handleFirstLine()
   local myTurn, data = self:canDoit()
   if not myTurn then return false end
 
   flushUnrecognizedMessages()
 
-  local msg = self:newMessage()
-  msg.content = Lines.current
-  msg.severity = UNKNOWN
-  dispatch(msg)
+  ERRORS_DETECTED = true
 
+  self.message = self:newMessage()
+  self.message.severity = UNKNOWN
+  self.message.content = Lines.current
   Lines:handledChars()
-  ERRORS_DETECTED = true
+
+  self.processed = 1
+  self.numLines = data.numLines
+  self.doit = self.handleLines
+  nextHandler = self
+
   return true
 end
 
+errorHandler.doit = errorHandler.handleFirstLine
 
+function errorHandler:handleLines()
+  if self.processed >= self.numLines then
+      self.doit = self.handleFirstLine
+      dispatch(self.message)
+  else
+      self.message.content = self.message.content .. '\n' .. Lines.current
+      Lines:handledChars()
+      self.processed = self.processed +1
+      nextHandler = self
+  end
+
+  return true
+end
+
+
 -------------------------------------------------------------------------------
 -- epilogueHandler
 --
@@ -2687,6 +2737,10 @@
   '^%-%- Using %S+ output%.',
   '^%-%- Verifying Times compatible math font%.',
   '^%-%- %S+ loaded, OK%.',
+
+  -- From libertinust1math.sty
+  '^amsthm loaded',
+  '^amsthm NOT loaded',
 }
 
 

Modified: trunk/Master/texmf-dist/doc/man/man1/texlogsieve.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/texlogsieve.1	2022-04-23 21:11:35 UTC (rev 63114)
+++ trunk/Master/texmf-dist/doc/man/man1/texlogsieve.1	2022-04-23 21:11:56 UTC (rev 63115)
@@ -1,4 +1,4 @@
-.TH TEXLOGSIEVE "1" "March 2022" "texlogsieve 1.1.2" "User Commands"
+.TH TEXLOGSIEVE "1" "April 2022" "texlogsieve 1.1.3" "User Commands"
 
 .SH NAME
 

Modified: trunk/Master/texmf-dist/doc/man/man1/texlogsieve.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/texlogsieve/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/support/texlogsieve/README.md	2022-04-23 21:11:35 UTC (rev 63114)
+++ trunk/Master/texmf-dist/doc/support/texlogsieve/README.md	2022-04-23 21:11:56 UTC (rev 63115)
@@ -3,8 +3,13 @@
 `texlogsieve` reads a LaTeX log file (or the standard input if no file is
 specified), filters out less relevant messages, and displays a summary
 report. It is a `texlua` script, similar in spirit to tools such as
-`texfot`, `texloganalyser`, `rubber-info`, `textlog_extract`,
-`texlogparser`, and others. Highlights:
+[`texfot`](https://ctan.org/pkg/texfot),
+[`texloganalyser`](https://ctan.org/pkg/texloganalyser),
+[`rubber-info`](https://gitlab.com/latex-rubber/rubber),
+[`textlog_extract`](https://ctan.org/pkg/texlog-extract),
+[`texlogparser`](https://github.com/reitzig/texlogparser),
+[`texlogfilter`](https://gricad-gitlab.univ-grenoble-alpes.fr/labbeju/latex-packages),
+and others. Highlights:
 
 * Two reports: the most important messages from the log file followed by
   a summary of repeated messages, undefined references etc.;
@@ -16,10 +21,8 @@
 
 * Several options to control which messages should be filtered out;
 
-* No messages are accidentally removed;
+* No messages are accidentally removed.
 
-* The summary report is currently simple, but useful.
-
 `texlogsieve` **must** be run from the same directory as `[pdf|lua|xe]latex`,
 because it searches for the files used during compilation (packages loaded
 from the current directory, files included with `\input` etc.). Also, since
@@ -38,7 +41,8 @@
 texlogsieve myfile.log
 ```
 
-and be satisfied with the result.
+and be satisfied with the result (still, you should check the "Tips"
+section of the documentation).
 
 Since it needs to know what messages to expect, `texlogsieve` is
 currently geared towards LaTeX; I have no idea how it would work with

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

Modified: trunk/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex	2022-04-23 21:11:35 UTC (rev 63114)
+++ trunk/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex	2022-04-23 21:11:56 UTC (rev 63115)
@@ -75,12 +75,14 @@
 \changes{1.1.0}{2022/03/04}{Do not lose messages if the file is truncated}
 \changes{1.1.1}{2022/03/05}{Fix error in variable scope}
 \changes{1.1.2}{2022/03/14}{Fix bug unwrapping lines starting with ``]''}
+\changes{1.1.3}{2022/04/22}{Be more careful with continuation lines in error
+                            msgs}
 
 \begin{document}
 
 \title{\textsf{texlogsieve}:\thanks{This document
-corresponds to \textsf{texlogsieve}~1.1.2,
-dated~2022-03-14.}\\[.3\baselineskip]
+corresponds to \textsf{texlogsieve}~1.1.3,
+dated~2022-04-22.}\\[.3\baselineskip]
 {\normalsize(yet another program to)\\[-.6\baselineskip]}
 {\large filter and summarize \LaTeX\ log files}
 }
@@ -108,8 +110,7 @@
         wrapping and does a much better job at that than existing tools;
   \item Multiline messages are treated as a single entity;
   \item Several options to control which messages should be filtered out;
-  \item No messages are accidentally removed;
-  \item The summary report is currently simple, but useful.
+  \item No messages are accidentally removed.
 \end{itemize}
 
 \end{abstract}
@@ -122,9 +123,13 @@
 of less relevant messages. This program filters out such less relevant
 messages and outputs the rest, together with a final summary for the
 specially important ones. It is a \texttt{texlua} script, similar in
-spirit to tools such as \texttt{texfot}, \texttt{texloganalyser},
-\texttt{rubber-info}, \texttt{textlog\_extract}, \texttt{texlogparser},
-and others.
+spirit to tools such as \href{https://ctan.org/pkg/texfot}{\texttt{texfot}},
+\href{https://ctan.org/pkg/texloganalyser}{\texttt{texloganalyser}},
+\href{https://gitlab.com/latex-rubber/rubber}{\texttt{rubber-info}},
+\href{https://ctan.org/pkg/texlog-extract}{\texttt{textlog\_extract}},
+\href{https://github.com/reitzig/texlogparser}{\texttt{texlogparser}},
+\href{https://gricad-gitlab.univ-grenoble-alpes.fr/labbeju/latex-packages}
+{\texttt{texlogfilter}}, and others.
 
 Note that it does not try to do anything smart about error messages
 (but it shows a warning in the summary if one is detected); if there

Modified: trunk/Master/texmf-dist/scripts/texlogsieve/texlogsieve
===================================================================
--- trunk/Master/texmf-dist/scripts/texlogsieve/texlogsieve	2022-04-23 21:11:35 UTC (rev 63114)
+++ trunk/Master/texmf-dist/scripts/texlogsieve/texlogsieve	2022-04-23 21:11:56 UTC (rev 63115)
@@ -553,7 +553,7 @@
 offending text, if any, always starts at the beginning of a line and
 ends at the end of a line.
 
-About the description: https://tex.stackexchange.com/a/367589/217608
+About the description: https://tex.stackexchange.com/a/367589
 
 This all means that handling these messages from a pipe is different
 than from the log file, because in the log file you know there will
@@ -1002,7 +1002,7 @@
 
   --version
   if vars.version then
-      print("texlogsieve 1.1.2")
+      print("texlogsieve 1.1.3")
       print("Copyright (C) 2021, 2022 Nelson Lago <lago at ime.usp.br>")
       print("License GPLv3+: GNU GPL version 3 or later "
             .. "<https://gnu.org/licenses/gpl.html>.")
@@ -1887,6 +1887,20 @@
     'You already have nine',
 }
 
+function errorHandler:isErrorLine(line)
+  local _, last = string.find(line, '^! ')
+  if not last then
+      _, last = string.find(line, '^' .. filepat .. ':%d+: ')
+  end
+
+  return last
+end
+
+function errorHandler:isRunawayLine(line)
+  local _, last = string.find(line, '^Runaway argument%?')
+  return last
+end
+
 function errorHandler:canDoit(position)
   if position == nil then position = 0 end
   local line = Lines:get(position)
@@ -1893,64 +1907,100 @@
   if line == nil then return false, {} end
 
   -- This error does not start with "! " or "file:line: "
-  local _, last = string.find(line, '^Runaway argument%?')
-  if last then return true, {} end
+  local last = self:isRunawayLine(line)
+  if last then return true, {numLines = 1} end
 
-  -- If the line does not start with "! " or "file:line: ", get out.
-  _, last = string.find(line, '^! ')
-  if not last then
-      _, last = string.find(line, '^' .. filepat .. ':%d+: ')
-      if not last then return false, {} end
-  end
+  last = self:isErrorLine(line)
+  if not last then return false, {} end
 
-  -- OK, this might be an error, but we need to be sure;
-  -- let's look for a known error message
-  local candidateText = string.sub(line, last +1)
-  for _, pat in ipairs(self.patterns) do
-      _, last = string.find(candidateText,  pat)
-      if last ~= nil then break end
-  end
-  if last then return true, {} end
-
-  -- Not a known error message; let's look for a line number
-  -- or "Type  H <return>  for immediate help"
+  -- Looks like an error; Let's look ahead to identify the other
+  -- lines that are part of the error message. We do not want to
+  -- look too much ahead, so we just scan the current buffer.
   position = position +1
-  local found = false
-  while not found and position < Lines:numLines() do
-      local first = string.find(Lines:get(position), '^l%.%d+ ')
-      if first then found = true end
+  local lastline = nil
+  while position < Lines:numLines() do
+      -- if there is a second error, don't look further ahead
+      if self:isErrorLine(Lines:get(position))
+              or self:isRunawayLine(Lines:get(position))
 
-      first = string.find(Lines:get(position),
-                         '^Type%s+H %<return%>%s+for immediate help%.')
-      if first then found = true end
+      then break end
 
+      if string.find(Lines:get(position), '^l%.%d+ ') then
+          local length = string.len(Lines:get(position))
+          if string.find(Lines:get(position +1),
+                         "^" .. string.rep(" ", length))
+          then
+              lastline = position +1 -- the following line is the last
+          else
+              -- the following line is empty, so it was skipped
+              -- when reading the file
+              lastline = position
+          end
+      end
+
+      if string.find(Lines:get(position),
+                         '^Type%s+H %<return%>%s+for immediate help%.') then
+          lastline = position
+      end
+
       position = position +1
   end
 
-  if found then
-      return true, {}
+  if lastline then
+      -- position starts at zero, so numlines needs +1
+      return true, {numLines = lastline +1}
   else
-      return false, {}
+      -- This looks like an error, but there is no "l.NUM" line following
+      -- it, so it is probably a false positive. Still, let's check for
+      -- some known error messages.
+      local candidateText = string.sub(line, last +1)
+      for _, pat in ipairs(self.patterns) do
+          _, last = string.find(candidateText, pat)
+          if last ~= nil then return true, {numLines = 1} end
+      end
   end
+
+  return false, {} -- this was really a false positive
 end
 
-function errorHandler:doit()
+function errorHandler:handleFirstLine()
   local myTurn, data = self:canDoit()
   if not myTurn then return false end
 
   flushUnrecognizedMessages()
 
-  local msg = self:newMessage()
-  msg.content = Lines.current
-  msg.severity = UNKNOWN
-  dispatch(msg)
+  ERRORS_DETECTED = true
 
+  self.message = self:newMessage()
+  self.message.severity = UNKNOWN
+  self.message.content = Lines.current
   Lines:handledChars()
-  ERRORS_DETECTED = true
+
+  self.processed = 1
+  self.numLines = data.numLines
+  self.doit = self.handleLines
+  nextHandler = self
+
   return true
 end
 
+errorHandler.doit = errorHandler.handleFirstLine
 
+function errorHandler:handleLines()
+  if self.processed >= self.numLines then
+      self.doit = self.handleFirstLine
+      dispatch(self.message)
+  else
+      self.message.content = self.message.content .. '\n' .. Lines.current
+      Lines:handledChars()
+      self.processed = self.processed +1
+      nextHandler = self
+  end
+
+  return true
+end
+
+
 -------------------------------------------------------------------------------
 -- epilogueHandler
 --
@@ -2687,6 +2737,10 @@
   '^%-%- Using %S+ output%.',
   '^%-%- Verifying Times compatible math font%.',
   '^%-%- %S+ loaded, OK%.',
+
+  -- From libertinust1math.sty
+  '^amsthm loaded',
+  '^amsthm NOT loaded',
 }
 
 



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