texlive[69072] trunk: texlogsieve (8dec23)

commits+karl at tug.org commits+karl at tug.org
Fri Dec 8 22:37:59 CET 2023


Revision: 69072
          https://tug.org/svn/texlive?view=revision&revision=69072
Author:   karl
Date:     2023-12-08 22:37:59 +0100 (Fri, 08 Dec 2023)
Log Message:
-----------
texlogsieve (8dec23)

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	2023-12-08 21:37:47 UTC (rev 69071)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlogsieve/texlogsieve	2023-12-08 21:37:59 UTC (rev 69072)
@@ -2,7 +2,7 @@
 
 -- texlogsieve - filter and summarize LaTeX log files
 --
--- Copyright (C) 2021, 2022 Nelson Lago <lago at ime.usp.br>
+-- Copyright (C) 2021-2023 Nelson Lago <lago at ime.usp.br>
 --
 -- This program is free software: you can redistribute it and/or modify
 -- it under the terms of the GNU General Public License as published by
@@ -815,6 +815,7 @@
   table.insert(anywhereHandlers, closeParensHandler)
   table.insert(anywhereHandlers, openSquareBracketHandler)
   table.insert(anywhereHandlers, closeSquareBracketHandler)
+  table.insert(anywhereHandlers, shipoutFilesHandler)
 
   for _, handler in ipairs(beginningOfLineHandlers) do
       handler:init()
@@ -934,6 +935,7 @@
                                          cite-detail at once
   --heartbeat, --no-heartbeat            enable/disable progress gauge
   --color, --no-color                    enable/disable colored output
+  --tips, --no-tips                      enable/disable suggesting fixes
   -l LEVEL, --minlevel=LEVEL             filter out messages with severity
                                          level lower than [LEVEL]. Valid
                                          levels are DEBUG, INFO, WARNING,
@@ -972,8 +974,8 @@
   --version                              print program version]]
 
 versionmsg = [[
-texlogsieve 1.3.1
-Copyright (C) 2021, 2022 Nelson Lago <lago at ime.usp.br>
+texlogsieve 1.4.0
+Copyright (C) 2021-2023 Nelson Lago <lago at ime.usp.br>
 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.]]
@@ -992,6 +994,7 @@
   DETAILED_UNDEROVER_SUMMARY = true
   DETAILED_REFERENCE_SUMMARY = true
   DETAILED_CITATION_SUMMARY = true
+  TIPS = true
 
   COLOR = false
 
@@ -1295,6 +1298,18 @@
   vars['no-color'] = nil
 
 
+  --no-tips
+  --tips
+  --tips=true/false
+  if vars['no-tips'] or vars.tips ~= nil and not vars.tips then
+      TIPS = false
+  end
+  if vars.tips then TIPS = true end
+
+  vars.tips = nil
+  vars['no-tips'] = nil
+
+
   if vars.filename == nil then
       logfile = io.stdin
   else
@@ -1511,6 +1526,7 @@
     'Unused \\captionsetup%b[]',
     "Unknown feature `' in font %b`'", -- empty feature, not a problem
     "Package refcheck Warning: Unused label %b`'", -- we process these specially
+    "Token not allowed in a PDF string %(Unicode%):",
   }
 
   DEFAULT_FORCED_WARNING = {}
@@ -1602,11 +1618,50 @@
 end
 
 
+function addTip(msg)
+  formatted = trim(msg:realToString())
+  if formatted == "" then return end
+
+  tips = {
+      ["multiple pdfs with page group included"] =
+                   '** The message above is usually harmless\n'
+                .. '** (check https://tex.stackexchange.com/questions/76273 );\n'
+                .. '** processing your included PDF files (images etc.) with\n'
+                .. '** "gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite '
+                .. '-dCompatibilityLevel=1.5 -sOutputFile=out.pdf in.pdf"\n'
+                .. '** usually eliminates this warning with no ill effects.\n'
+                .. '** If that does not work, try 1.3 instead of 1.5 (note\n'
+                .. '** that 1.3 may affect output quality and file size).',
+      ["found PDF version %b<>, but at most version %b<> allowed"] =
+                   "** The message above is usually harmless;\n"
+                .. "** you may want to add \\pdfminorversion=7 (pdflatex) or\n"
+                .. "** \\pdfvariable minorversion 7 (lualatex) before\n"
+                .. "** \\documentclass in your document.",
+      ["I've expected \\MT_cramped_internal:Nn to have\nthe meaning"] =
+                   "** The message above indicates a bug that was fixed\n"
+                .. "** in version 1.26 of package mathtools together with\n"
+                .. "** version 1.10 of package lualatex-math (both from\n"
+                .. "** March/2021).",
+      ["Unable to apply patch `footnote' on input line"] =
+                   "** The message above indicates a bug in microtype\n"
+                .. "** fixed in version 3.0e (from June/2022)."
+  }
+
+  for msgtext, tip in pairs(tips) do
+      if string.find(formatted, msgtext) or string.find(msg.content, msgtext) then
+          msg.content = msg.content .. "\n** texlogsieve tip:\n" .. tip
+      end
+  end
+end
+
+
 function processMessage(msg)
   SHOULD_RERUN_LATEX = SHOULD_RERUN_LATEX or msg:checkMatch(msg.rerunMessages)
 
   adjustSeverity(msg)
 
+  if TIPS then addTip(msg) end
+
   if ONLY_SUMMARY or PAGE_DELAY then
       heartbeat:tick()
   else
@@ -2712,6 +2767,8 @@
 
   '^Lua module: microtype ' .. datepat .. ' %S+ microtype module%.',
 
+  '^luaotfload | main : initialization completed in [%d.]+ seconds',
+
   '^luaotfload | init : Context OpenType loader version.*',
 
   '^luaotfload | init : Loading fontloader '
@@ -2731,6 +2788,7 @@
 
   '^Lua%-only attribute.-=%s*%S+',
   "^Inserting %b`' at position .- in %b`'%.",
+  "^Inserting %b`' in %b`'%.",
   "^Removing +%b`' from %b`'%.",
 
   "^For additional information on amsmath, use the `%?' option%.",
@@ -2791,6 +2849,21 @@
   '^Lua module: luaotfload%-multiscript ' .. datepat
                    .. ' [%d%.]+ luaotfload submodule / multiscript',
 
+  '^Lua module: luaotfload%-harf%-define ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / database',
+
+  '^Lua module: luaotfload%-script ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / Script helpers',
+
+  '^Lua module: luaotfload%-harf%-plug ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / database',
+
+  '^Lua module: luaotfload%-fallback ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / fallback',
+
+  '^Lua module: luaotfload%-tounicode ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / tounicode',
+
   '^' .. string.rep('%*', 37) .. '\n'
       .. '%* Using libertinus math %*\n'
       .. string.rep('%*', 37),
@@ -2831,6 +2904,9 @@
 
   -- refcheck
   '^options: showrefs, showcites, msgs, chckunlbld',
+
+  "^`newtxtext' v[%d%.]+, " .. datepat .. " Text macros taking advantage of "
+              .. "TeXGyre Termes and its extensions %(msharpe%)",
 }
 
 
@@ -2848,6 +2924,8 @@
   '^%s*ABD: EverySelectfont initializing macros',
   '^%s*ABD: EveryShipout initializing macros',
 
+  '^%s*<<.-%.cmap>>',
+
   '^%s*' .. string.rep('%*', 65) .. '%s*\n'
          .. 'GFS%-Solomos style file by A%. Tsolomitis%s*\n'
          .. string.rep('%*', 65),
@@ -2855,7 +2933,6 @@
   -- <blah.jpg, id=555, [...,] 722.7pt x 722.7pt>
   '^%s*%<' .. filepat .. ', id=.- [%d%.]+pt x [%d%.]+pt%>',
   '^%s*%<use ' .. filepat .. '%>', -- <use blah.jpg>
-  '^%s*%<' .. filepat .. '%>', -- <blah.jpg>
 
   "^%s*`Fixed Point Package', .- %(C%) Michael Mehlich",
 
@@ -2900,6 +2977,7 @@
   "^%*geometry%* driver:.*",
   "^%*geometry%* detected driver:.*",
   "^Driver file for pgf:.*%.def",
+  "^Package pgfplots: loading complementary utilities for your pgf version%.%.%.",
   "^%s*file:line:error style messages enabled%.",
   "^Applying: %b[] float order in 2%-column on input line .-%.",
   "^Already applied: %b[] float order in 2%-column on input line .-%.",
@@ -2973,6 +3051,8 @@
    .. '======================================================================',
   "^Label %b`' newly defined as it shall be overriden\n"
    .. "although it is yet undefined",
+
+   '^%* %* %* LNI %* %* %*',
 }
 
 
@@ -2988,22 +3068,27 @@
   "^%s*German Hyphenation Patterns %(Traditional Orthography%) "
                             .. "`dehyphts?%-x' " .. datepat .. " %(WL%)",
 
-  '^%s*UTF%-8 German hyphenation patterns %(traditional orthography%)',
-  '^%s*EC German hyphenation patterns %(traditional orthography%)',
-  '^%s*German Hyphenation Patterns %(Traditional Orthography%)',
+  '^%s*UTF%-8 German hyphenation patterns %(.- orthography%)',
+  '^%s*EC German hyphenation patterns %(.- orthography%)',
+  '^%s*German Hyphenation Patterns %(.- Orthography%)',
 
-  "^%s*Swiss%-German Hyphenation Patterns %(Traditional Orthography%) "
+  "^%s*Swiss%-German Hyphenation Patterns %(.- Orthography%) "
                             .. "`dehyphts?%-x' " .. datepat .. " %(WL%)",
 
-  '^%s*UTF%-8 Swiss%-German hyphenation patterns %(traditional orthography%)',
-  '^%s*EC Swiss%-German hyphenation patterns %(traditional orthography%)',
-  '^%s*Swiss%-German Hyphenation Patterns %(Traditional Orthography%)',
+  "^%s*German Hyphenation Patterns %(.- Orthography.-%) "
+                            .. "`dehyphn%-x' " .. datepat .. " %(WL%)",
 
+  '^%s*UTF%-8 Swiss%-German hyphenation patterns %(.- orthography%)',
+  '^%s*EC Swiss%-German hyphenation patterns %(.- orthography%)',
+  '^%s*Swiss%-German Hyphenation Patterns %(.- Orthography%)',
+  "^%s*dehyph%-exptl: using a TeX engine with native UTF%-8 support%.",
+
   '^%s*ASCII Hyphenation patterns for American English',
   '^%s*UTF%-8 %S+ hyphenation patterns',
   '^%s*EC %S+ hyphenation patterns',
 
-  "^%s*<Requested QR version '[^']+' is too small for desired text%.%s?Version increased to '[^']+' to fit text%.>",
+  "^%s*<Requested QR version '[^']+' is too small for desired "
+              .. "text%.%s?Version increased to '[^']+' to fit text%.>",
 
 }
 
@@ -3051,6 +3136,9 @@
   '^%*%* WARNING: \\IEEEPARstart is locked out for technotes %(line %S+%)%.',
   '^%*%* WARNING: %S+ is locked out when in conference mode %(line %S+%)%.',
   '^%*%* ATTENTION: %S+ is deprecated %(line %S+%)%. Use %S+ instead%.',
+
+  '^%a+TeX warning: %a+tex %(file ' .. filepat .. '%): PDF inclusion: '
+               .. 'multiple pdfs with page group included in a single page',
 }
 
 
@@ -3966,7 +4054,93 @@
   end
 end
 
+-- During a shipout, TeX sometimes puts some filenames inside a pair of
+-- "{}" or "<>" characters. Since there are no other messages inside these
+-- opening and closing characters, this handler may be simple: find the
+-- opening character and unwrap lines until finding the closing character.
+-- We even check for "{<" and "}>" at the same time, without verifying if
+-- they are actually paired, because they really should be.
+shipoutFilesHandler = HandlerPrototype:new()
+shipoutFilesHandler.strictPattern = "^(%s*)[%{%<]"
+shipoutFilesHandler.loosePattern = "%s*[%{%<]"
+shipoutFilesHandler.pattern = shipoutFilesHandler.strictPattern
+shipoutFilesHandler.closingPattern = "[%}%>]"
 
+-- Read the comment right before "closeParensHandler:lookahead()"
+--
+-- This handler only processes stuff if there is a pending shipout in the
+-- shipouts stack. However, we cannot check for this in lookahead() because
+-- the shipout may not have been processed yet. As a result, lookahead()
+-- may answer "yes" when in reality the handler won't do anything. This has
+-- a nasty consequence: if there is a { or < character at the beginning
+-- of a line, doit() may not handle it, but lookahead() may answer "yes",
+-- causing an endless loop. We solve this by answering "yes" ONLY if the
+-- open character is NOT at the beginning of the line.
+function shipoutFilesHandler:lookahead()
+  local line = Lines:get(0)
+  if line == nil then return false, {} end
+
+  local first = string.find(line, self.loosePattern)
+  if first == nil then return false, {} end
+
+  local strictFirst = string.find(line, self.pattern)
+  if first == strictFirst then return false, {} end
+
+  return true, {first = first}
+end
+
+function shipoutFilesHandler:canDoit(position)
+  if position == nil then position = 0 end
+  local line = Lines:get(position)
+  if line == nil then return false, {} end
+  if position == 0 and shipouts:size() == 0 then return false, {} end
+
+  local first, last = string.find(line, self.pattern)
+  if first == nil then return false, {} end
+
+  return true, {first = first}
+end
+
+function shipoutFilesHandler:doit()
+  local myTurn, data = self:canDoit()
+  if not myTurn then return false end
+
+  -- Look for the matching close character. It really
+  -- should be there and there should not be any nesting,
+  -- so no need to be overly cautious.
+  local last
+  for i = 0, 4 do -- 4 lines ahead is plenty!
+      line = Lines:get(i)
+      if line == nil then break end
+      _, last = string.find(line, self.closingPattern)
+      if last ~= nil then break end
+  end
+  if last == nil then return false end -- should never happen
+
+  local _, last, spaces = string.find(Lines.current, self.pattern)
+  unrecognizedBuffer = unrecognizedBuffer .. spaces
+
+  -- skip the spaces and the opening character
+  Lines:handledChars(last)
+  flushUnrecognizedMessages()
+
+  _, last = string.find(Lines.current, self.closingPattern)
+  while last == nil do
+      Lines:unwrapOneLine()
+      _, last = string.find(Lines.current, self.closingPattern)
+  end
+
+  local msg = shipoutFilesMessage:new()
+  msg.content = "Loading file at shipout: "
+  -- "-1" so that we do not include the closing character
+  msg.content = msg.content .. string.sub(Lines.current, 1, last -1)
+  Lines:handledChars(last)
+  dispatch(msg)
+
+  return true
+end
+
+
 -------------------------------------------------------------------------------
 -- utf8FontMapHandler
 --
@@ -4940,6 +5114,8 @@
   unusedLabelsSummary:add(self)
 end
 
+shipoutFilesMessage = Message:new()
+shipoutFilesMessage.severity = DEBUG
 
 --[[ ##################################################################### ]]--
 --[[ ############################ SUMMARIES ############################## ]]--

Modified: trunk/Master/texmf-dist/doc/man/man1/texlogsieve.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/texlogsieve.1	2023-12-08 21:37:47 UTC (rev 69071)
+++ trunk/Master/texmf-dist/doc/man/man1/texlogsieve.1	2023-12-08 21:37:59 UTC (rev 69072)
@@ -1,4 +1,4 @@
-.TH TEXLOGSIEVE "1" "September 2022" "texlogsieve 1.3.1" "User Commands"
+.TH TEXLOGSIEVE "1" "November 2023" "texlogsieve 1.4.0" "User Commands"
 
 .SH NAME
 
@@ -114,6 +114,10 @@
 an up-to-date Windows 10 or later (default disabled).
 
 .TP
+\fB\-\-tips\fR, \fB\-\-no\-tips\fR
+Enable/disable suggesting fixes for some known warnings (default enabled).
+
+.TP
 \fB\-l\fR \fI\,LEVEL\/\fR, \fB\-\-minlevel\fR=\fI\,LEVEL\/\fR
 Filter out messages with severity level lower than LEVEL. Valid levels
 are DEBUG (no filtering), INFO, WARNING, CRITICAL, and UNKNOWN (default
@@ -299,7 +303,7 @@
 
 .SH COPYRIGHT
 
-Copyright \[co] 2021, 2022 Nelson Lago <lago at ime.usp.br>
+Copyright \[co] 2021-2023 Nelson Lago <lago at ime.usp.br>
 .br
 License GPLv3+: GNU GPL version 3 or later
 .UR https://gnu.org/licenses/gpl.html

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	2023-12-08 21:37:47 UTC (rev 69071)
+++ trunk/Master/texmf-dist/doc/support/texlogsieve/README.md	2023-12-08 21:37:59 UTC (rev 69072)
@@ -56,7 +56,7 @@
 
 Code etc: <https://gitlab.com/lago/texlogsieve>
 
-Copyright (C) 2021, 2022 Nelson Lago <lago at ime.usp.br>
+Copyright (C) 2021-2023 Nelson Lago <lago at ime.usp.br>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by

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	2023-12-08 21:37:47 UTC (rev 69071)
+++ trunk/Master/texmf-dist/doc/support/texlogsieve/texlogsieve.tex	2023-12-08 21:37:59 UTC (rev 69072)
@@ -1,6 +1,6 @@
 % texlogsieve - filter and summarize LaTeX log files
 %
-% Copyright (C) 2021, 2022 Nelson Lago <lago at ime.usp.br>
+% Copyright (C) 2021-2023 Nelson Lago <lago at ime.usp.br>
 %
 % This program is free software: you can redistribute it and/or modify
 % it under the terms of the GNU General Public License as published by
@@ -93,12 +93,14 @@
 \changes{1.3.0}{2022/08/05}{Add \texttt{-\/-verbose} option}
 \changes{1.3.0}{2022/08/05}{Search for a config file in the user's homedir too}
 \changes{1.3.1}{2022/09/05}{Fix bug when searching for config files in Windows}
+\changes{1.4.0}{2023/11/30}{Add tips on how to fix some warnings}
+\changes{1.4.0}{2023/11/30}{Handle files opened during shipout}
 
 \begin{document}
 
 \title{\textsf{texlogsieve}:\thanks{This document
-corresponds to \textsf{texlogsieve}~1.3.1,
-dated~2022-09-05.}\\[.3\baselineskip]
+corresponds to \textsf{texlogsieve}~1.4.0,
+dated~2023-11-30.}\\[.3\baselineskip]
 {\normalsize(yet another program to)\\[-.6\baselineskip]}
 {\large filter and summarize \LaTeX\ log files}
 }
@@ -351,6 +353,11 @@
 \end{description}
 
 \begin{description}
+\item[\texttt{-\/-tips}, \texttt{-\/-no-tips}]~\\
+Enable/disable suggesting fixes for some known warnings (default enabled).
+\end{description}
+
+\begin{description}
 \item[\texttt{-l LEVEL}, \texttt{-\/-minlevel=LEVEL}]~\\
 Filter out messages with severity level lower than \texttt{LEVEL}. Valid
 levels are \texttt{DEBUG} (no filtering), \texttt{INFO}, \texttt{WARNING},
@@ -540,7 +547,7 @@
 
 \section{License}
 
-Copyright © 2021, 2022 Nelson Lago \textless lago at ime.usp.br\textgreater\\
+Copyright © 2021--2023 Nelson Lago \textless lago at ime.usp.br\textgreater\\
 License GPLv3+: GNU GPL version 3 or later
 \url{https://gnu.org/licenses/gpl.html}.\\
 This is free software: you are free to change and redistribute it.\\

Modified: trunk/Master/texmf-dist/scripts/texlogsieve/texlogsieve
===================================================================
--- trunk/Master/texmf-dist/scripts/texlogsieve/texlogsieve	2023-12-08 21:37:47 UTC (rev 69071)
+++ trunk/Master/texmf-dist/scripts/texlogsieve/texlogsieve	2023-12-08 21:37:59 UTC (rev 69072)
@@ -2,7 +2,7 @@
 
 -- texlogsieve - filter and summarize LaTeX log files
 --
--- Copyright (C) 2021, 2022 Nelson Lago <lago at ime.usp.br>
+-- Copyright (C) 2021-2023 Nelson Lago <lago at ime.usp.br>
 --
 -- This program is free software: you can redistribute it and/or modify
 -- it under the terms of the GNU General Public License as published by
@@ -815,6 +815,7 @@
   table.insert(anywhereHandlers, closeParensHandler)
   table.insert(anywhereHandlers, openSquareBracketHandler)
   table.insert(anywhereHandlers, closeSquareBracketHandler)
+  table.insert(anywhereHandlers, shipoutFilesHandler)
 
   for _, handler in ipairs(beginningOfLineHandlers) do
       handler:init()
@@ -934,6 +935,7 @@
                                          cite-detail at once
   --heartbeat, --no-heartbeat            enable/disable progress gauge
   --color, --no-color                    enable/disable colored output
+  --tips, --no-tips                      enable/disable suggesting fixes
   -l LEVEL, --minlevel=LEVEL             filter out messages with severity
                                          level lower than [LEVEL]. Valid
                                          levels are DEBUG, INFO, WARNING,
@@ -972,8 +974,8 @@
   --version                              print program version]]
 
 versionmsg = [[
-texlogsieve 1.3.1
-Copyright (C) 2021, 2022 Nelson Lago <lago at ime.usp.br>
+texlogsieve 1.4.0
+Copyright (C) 2021-2023 Nelson Lago <lago at ime.usp.br>
 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.]]
@@ -992,6 +994,7 @@
   DETAILED_UNDEROVER_SUMMARY = true
   DETAILED_REFERENCE_SUMMARY = true
   DETAILED_CITATION_SUMMARY = true
+  TIPS = true
 
   COLOR = false
 
@@ -1295,6 +1298,18 @@
   vars['no-color'] = nil
 
 
+  --no-tips
+  --tips
+  --tips=true/false
+  if vars['no-tips'] or vars.tips ~= nil and not vars.tips then
+      TIPS = false
+  end
+  if vars.tips then TIPS = true end
+
+  vars.tips = nil
+  vars['no-tips'] = nil
+
+
   if vars.filename == nil then
       logfile = io.stdin
   else
@@ -1511,6 +1526,7 @@
     'Unused \\captionsetup%b[]',
     "Unknown feature `' in font %b`'", -- empty feature, not a problem
     "Package refcheck Warning: Unused label %b`'", -- we process these specially
+    "Token not allowed in a PDF string %(Unicode%):",
   }
 
   DEFAULT_FORCED_WARNING = {}
@@ -1602,11 +1618,50 @@
 end
 
 
+function addTip(msg)
+  formatted = trim(msg:realToString())
+  if formatted == "" then return end
+
+  tips = {
+      ["multiple pdfs with page group included"] =
+                   '** The message above is usually harmless\n'
+                .. '** (check https://tex.stackexchange.com/questions/76273 );\n'
+                .. '** processing your included PDF files (images etc.) with\n'
+                .. '** "gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite '
+                .. '-dCompatibilityLevel=1.5 -sOutputFile=out.pdf in.pdf"\n'
+                .. '** usually eliminates this warning with no ill effects.\n'
+                .. '** If that does not work, try 1.3 instead of 1.5 (note\n'
+                .. '** that 1.3 may affect output quality and file size).',
+      ["found PDF version %b<>, but at most version %b<> allowed"] =
+                   "** The message above is usually harmless;\n"
+                .. "** you may want to add \\pdfminorversion=7 (pdflatex) or\n"
+                .. "** \\pdfvariable minorversion 7 (lualatex) before\n"
+                .. "** \\documentclass in your document.",
+      ["I've expected \\MT_cramped_internal:Nn to have\nthe meaning"] =
+                   "** The message above indicates a bug that was fixed\n"
+                .. "** in version 1.26 of package mathtools together with\n"
+                .. "** version 1.10 of package lualatex-math (both from\n"
+                .. "** March/2021).",
+      ["Unable to apply patch `footnote' on input line"] =
+                   "** The message above indicates a bug in microtype\n"
+                .. "** fixed in version 3.0e (from June/2022)."
+  }
+
+  for msgtext, tip in pairs(tips) do
+      if string.find(formatted, msgtext) or string.find(msg.content, msgtext) then
+          msg.content = msg.content .. "\n** texlogsieve tip:\n" .. tip
+      end
+  end
+end
+
+
 function processMessage(msg)
   SHOULD_RERUN_LATEX = SHOULD_RERUN_LATEX or msg:checkMatch(msg.rerunMessages)
 
   adjustSeverity(msg)
 
+  if TIPS then addTip(msg) end
+
   if ONLY_SUMMARY or PAGE_DELAY then
       heartbeat:tick()
   else
@@ -2712,6 +2767,8 @@
 
   '^Lua module: microtype ' .. datepat .. ' %S+ microtype module%.',
 
+  '^luaotfload | main : initialization completed in [%d.]+ seconds',
+
   '^luaotfload | init : Context OpenType loader version.*',
 
   '^luaotfload | init : Loading fontloader '
@@ -2731,6 +2788,7 @@
 
   '^Lua%-only attribute.-=%s*%S+',
   "^Inserting %b`' at position .- in %b`'%.",
+  "^Inserting %b`' in %b`'%.",
   "^Removing +%b`' from %b`'%.",
 
   "^For additional information on amsmath, use the `%?' option%.",
@@ -2791,6 +2849,21 @@
   '^Lua module: luaotfload%-multiscript ' .. datepat
                    .. ' [%d%.]+ luaotfload submodule / multiscript',
 
+  '^Lua module: luaotfload%-harf%-define ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / database',
+
+  '^Lua module: luaotfload%-script ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / Script helpers',
+
+  '^Lua module: luaotfload%-harf%-plug ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / database',
+
+  '^Lua module: luaotfload%-fallback ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / fallback',
+
+  '^Lua module: luaotfload%-tounicode ' .. datepat
+                   .. ' [%d%.]+ luaotfload submodule / tounicode',
+
   '^' .. string.rep('%*', 37) .. '\n'
       .. '%* Using libertinus math %*\n'
       .. string.rep('%*', 37),
@@ -2831,6 +2904,9 @@
 
   -- refcheck
   '^options: showrefs, showcites, msgs, chckunlbld',
+
+  "^`newtxtext' v[%d%.]+, " .. datepat .. " Text macros taking advantage of "
+              .. "TeXGyre Termes and its extensions %(msharpe%)",
 }
 
 
@@ -2848,6 +2924,8 @@
   '^%s*ABD: EverySelectfont initializing macros',
   '^%s*ABD: EveryShipout initializing macros',
 
+  '^%s*<<.-%.cmap>>',
+
   '^%s*' .. string.rep('%*', 65) .. '%s*\n'
          .. 'GFS%-Solomos style file by A%. Tsolomitis%s*\n'
          .. string.rep('%*', 65),
@@ -2855,7 +2933,6 @@
   -- <blah.jpg, id=555, [...,] 722.7pt x 722.7pt>
   '^%s*%<' .. filepat .. ', id=.- [%d%.]+pt x [%d%.]+pt%>',
   '^%s*%<use ' .. filepat .. '%>', -- <use blah.jpg>
-  '^%s*%<' .. filepat .. '%>', -- <blah.jpg>
 
   "^%s*`Fixed Point Package', .- %(C%) Michael Mehlich",
 
@@ -2900,6 +2977,7 @@
   "^%*geometry%* driver:.*",
   "^%*geometry%* detected driver:.*",
   "^Driver file for pgf:.*%.def",
+  "^Package pgfplots: loading complementary utilities for your pgf version%.%.%.",
   "^%s*file:line:error style messages enabled%.",
   "^Applying: %b[] float order in 2%-column on input line .-%.",
   "^Already applied: %b[] float order in 2%-column on input line .-%.",
@@ -2973,6 +3051,8 @@
    .. '======================================================================',
   "^Label %b`' newly defined as it shall be overriden\n"
    .. "although it is yet undefined",
+
+   '^%* %* %* LNI %* %* %*',
 }
 
 
@@ -2988,22 +3068,27 @@
   "^%s*German Hyphenation Patterns %(Traditional Orthography%) "
                             .. "`dehyphts?%-x' " .. datepat .. " %(WL%)",
 
-  '^%s*UTF%-8 German hyphenation patterns %(traditional orthography%)',
-  '^%s*EC German hyphenation patterns %(traditional orthography%)',
-  '^%s*German Hyphenation Patterns %(Traditional Orthography%)',
+  '^%s*UTF%-8 German hyphenation patterns %(.- orthography%)',
+  '^%s*EC German hyphenation patterns %(.- orthography%)',
+  '^%s*German Hyphenation Patterns %(.- Orthography%)',
 
-  "^%s*Swiss%-German Hyphenation Patterns %(Traditional Orthography%) "
+  "^%s*Swiss%-German Hyphenation Patterns %(.- Orthography%) "
                             .. "`dehyphts?%-x' " .. datepat .. " %(WL%)",
 
-  '^%s*UTF%-8 Swiss%-German hyphenation patterns %(traditional orthography%)',
-  '^%s*EC Swiss%-German hyphenation patterns %(traditional orthography%)',
-  '^%s*Swiss%-German Hyphenation Patterns %(Traditional Orthography%)',
+  "^%s*German Hyphenation Patterns %(.- Orthography.-%) "
+                            .. "`dehyphn%-x' " .. datepat .. " %(WL%)",
 
+  '^%s*UTF%-8 Swiss%-German hyphenation patterns %(.- orthography%)',
+  '^%s*EC Swiss%-German hyphenation patterns %(.- orthography%)',
+  '^%s*Swiss%-German Hyphenation Patterns %(.- Orthography%)',
+  "^%s*dehyph%-exptl: using a TeX engine with native UTF%-8 support%.",
+
   '^%s*ASCII Hyphenation patterns for American English',
   '^%s*UTF%-8 %S+ hyphenation patterns',
   '^%s*EC %S+ hyphenation patterns',
 
-  "^%s*<Requested QR version '[^']+' is too small for desired text%.%s?Version increased to '[^']+' to fit text%.>",
+  "^%s*<Requested QR version '[^']+' is too small for desired "
+              .. "text%.%s?Version increased to '[^']+' to fit text%.>",
 
 }
 
@@ -3051,6 +3136,9 @@
   '^%*%* WARNING: \\IEEEPARstart is locked out for technotes %(line %S+%)%.',
   '^%*%* WARNING: %S+ is locked out when in conference mode %(line %S+%)%.',
   '^%*%* ATTENTION: %S+ is deprecated %(line %S+%)%. Use %S+ instead%.',
+
+  '^%a+TeX warning: %a+tex %(file ' .. filepat .. '%): PDF inclusion: '
+               .. 'multiple pdfs with page group included in a single page',
 }
 
 
@@ -3966,7 +4054,93 @@
   end
 end
 
+-- During a shipout, TeX sometimes puts some filenames inside a pair of
+-- "{}" or "<>" characters. Since there are no other messages inside these
+-- opening and closing characters, this handler may be simple: find the
+-- opening character and unwrap lines until finding the closing character.
+-- We even check for "{<" and "}>" at the same time, without verifying if
+-- they are actually paired, because they really should be.
+shipoutFilesHandler = HandlerPrototype:new()
+shipoutFilesHandler.strictPattern = "^(%s*)[%{%<]"
+shipoutFilesHandler.loosePattern = "%s*[%{%<]"
+shipoutFilesHandler.pattern = shipoutFilesHandler.strictPattern
+shipoutFilesHandler.closingPattern = "[%}%>]"
 
+-- Read the comment right before "closeParensHandler:lookahead()"
+--
+-- This handler only processes stuff if there is a pending shipout in the
+-- shipouts stack. However, we cannot check for this in lookahead() because
+-- the shipout may not have been processed yet. As a result, lookahead()
+-- may answer "yes" when in reality the handler won't do anything. This has
+-- a nasty consequence: if there is a { or < character at the beginning
+-- of a line, doit() may not handle it, but lookahead() may answer "yes",
+-- causing an endless loop. We solve this by answering "yes" ONLY if the
+-- open character is NOT at the beginning of the line.
+function shipoutFilesHandler:lookahead()
+  local line = Lines:get(0)
+  if line == nil then return false, {} end
+
+  local first = string.find(line, self.loosePattern)
+  if first == nil then return false, {} end
+
+  local strictFirst = string.find(line, self.pattern)
+  if first == strictFirst then return false, {} end
+
+  return true, {first = first}
+end
+
+function shipoutFilesHandler:canDoit(position)
+  if position == nil then position = 0 end
+  local line = Lines:get(position)
+  if line == nil then return false, {} end
+  if position == 0 and shipouts:size() == 0 then return false, {} end
+
+  local first, last = string.find(line, self.pattern)
+  if first == nil then return false, {} end
+
+  return true, {first = first}
+end
+
+function shipoutFilesHandler:doit()
+  local myTurn, data = self:canDoit()
+  if not myTurn then return false end
+
+  -- Look for the matching close character. It really
+  -- should be there and there should not be any nesting,
+  -- so no need to be overly cautious.
+  local last
+  for i = 0, 4 do -- 4 lines ahead is plenty!
+      line = Lines:get(i)
+      if line == nil then break end
+      _, last = string.find(line, self.closingPattern)
+      if last ~= nil then break end
+  end
+  if last == nil then return false end -- should never happen
+
+  local _, last, spaces = string.find(Lines.current, self.pattern)
+  unrecognizedBuffer = unrecognizedBuffer .. spaces
+
+  -- skip the spaces and the opening character
+  Lines:handledChars(last)
+  flushUnrecognizedMessages()
+
+  _, last = string.find(Lines.current, self.closingPattern)
+  while last == nil do
+      Lines:unwrapOneLine()
+      _, last = string.find(Lines.current, self.closingPattern)
+  end
+
+  local msg = shipoutFilesMessage:new()
+  msg.content = "Loading file at shipout: "
+  -- "-1" so that we do not include the closing character
+  msg.content = msg.content .. string.sub(Lines.current, 1, last -1)
+  Lines:handledChars(last)
+  dispatch(msg)
+
+  return true
+end
+
+
 -------------------------------------------------------------------------------
 -- utf8FontMapHandler
 --
@@ -4940,6 +5114,8 @@
   unusedLabelsSummary:add(self)
 end
 
+shipoutFilesMessage = Message:new()
+shipoutFilesMessage.severity = DEBUG
 
 --[[ ##################################################################### ]]--
 --[[ ############################ SUMMARIES ############################## ]]--



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