[latex3-commits] [git/LaTeX3-latex3-latex2e] master: Only reset \tracingoutput if not set by \showoutput earlier (5e4a423)

Frank Mittelbach frank.mittelbach at latex-project.org
Sat Oct 13 12:20:53 CEST 2018


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/5e4a423fd4c33f7594213ab9b0a522a34d822a1d

>---------------------------------------------------------------

commit 5e4a423fd4c33f7594213ab9b0a522a34d822a1d
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Sat Oct 13 12:20:53 2018 +0200

    Only reset \tracingoutput if not set by \showoutput earlier


>---------------------------------------------------------------

5e4a423fd4c33f7594213ab9b0a522a34d822a1d
 required/tools/changes.txt                         |    5 +
 required/tools/testfiles/tlb-trace-001.lvt         |   20 ++++
 .../tools/testfiles/tlb-trace-001.tlg              |    7 +-
 required/tools/trace.dtx                           |  114 ++++++++++++--------
 4 files changed, 99 insertions(+), 47 deletions(-)

diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index c912d2f..4d82d69 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -5,6 +5,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2018-10-13  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* trace.dtx (section{Implementation}):
+	Only reset \tracingoutput if not set by \showoutput earlier
+
 2018-10-01  David Carlisle  <David.Carlisle at latex-project.org>
 
 	* xr.dtx: Update to handle \if tests in the aux file.
diff --git a/required/tools/testfiles/tlb-trace-001.lvt b/required/tools/testfiles/tlb-trace-001.lvt
new file mode 100644
index 0000000..1eb8b23
--- /dev/null
+++ b/required/tools/testfiles/tlb-trace-001.lvt
@@ -0,0 +1,20 @@
+% 't undo \showoutput when conditionally turning tracing off
+
+\input{test2e}
+
+\documentclass{article}
+
+\usepackage{trace}
+
+\begin{document}
+
+\START
+
+\showoutput
+\showthe\tracingoutput
+
+\textit{test} foo
+
+\showthe\tracingoutput
+
+\END
diff --git a/base/testfiles-TU/tu-texligs01.tlg b/required/tools/testfiles/tlb-trace-001.tlg
similarity index 59%
copy from base/testfiles-TU/tu-texligs01.tlg
copy to required/tools/testfiles/tlb-trace-001.tlg
index 2b9903b..e41bf52 100644
--- a/base/testfiles-TU/tu-texligs01.tlg
+++ b/required/tools/testfiles/tlb-trace-001.tlg
@@ -1,5 +1,6 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-``: ligature
-'': ligature
---: ligature
+> 1.
+l. ...\showthe\tracingoutput
+> 1.
+l. ...\showthe\tracingoutput
diff --git a/required/tools/trace.dtx b/required/tools/trace.dtx
index 422c43e..dabec8a 100644
--- a/required/tools/trace.dtx
+++ b/required/tools/trace.dtx
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright 1993-2016
+% Copyright 1993-2018
 %
 % The LaTeX3 Project and any individual authors listed elsewhere
 % in this file.
@@ -22,7 +22,7 @@
 % \fi
 % \iffalse
 %%
-%% (C) Copyright 1999-2014 Frank Mittelbach
+%% (C) Copyright 1999-2018 Frank Mittelbach
 %% All rights reserved.
 %%
 %<*dtx>
@@ -33,7 +33,7 @@
 %<driver>\ProvidesFile{trace.drv}
 % \fi
 %         \ProvidesFile{trace.dtx}
-          [2014/10/28 v1.1d trace LaTeX code]
+          [2018/10/13 v1.1e trace LaTeX code]
 %
 % \iffalse
 %<*driver>
@@ -355,13 +355,14 @@
 %  \changes{v1.1c}{2003/04/30}{Macro added}
 % \begin{macro}{\conditionally at traceoff}
 %    As stated in the introduction, the amount of tracing being done
-%    should depend on the formatter we use. So we first test if we are
+%    should depend on the formatter we use. Initially first test if we are
 %    running with \eTeX{} in extended mode. In the latter case the command
-%    |\tracinggroups| is defined.\footnote{If some package writer has defined
-%    that command name for some reason---too bad---then we make the
-%    wrong deduction from this fact and as a result the package will fail.}
+%    |\tracinggroups| is defined.
+%    But for a number of years now \LaTeX{} only works with \eTeX{} so
+%    we drop that part of the code. For now I leave it in the file
+%    together with its documentation, but commented out.
 %    \begin{macrocode}
-\ifx\tracinggroups\undefined
+%\ifx\tracinggroups\undefined
 %    \end{macrocode}
 %
 %    If we are using standard \TeX{} then |\tr at ce@n| is more or less
@@ -402,31 +403,31 @@
 %    nothing whatsoever since the noise generating switches are set at
 %    the very end.
 %    \begin{macrocode}
-  \def\tr at ce@n{%
+%  \def\tr at ce@n{%
 %    \end{macrocode}
 %    We start by setting the |@tracing| switch to signal that tracing
 %    is asked for. This is then followed by setting the various
 %    tracing primitives of \TeX.
 %    \begin{macrocode}
-    \@tracingtrue
-    \tracingstats\tw@
-    \tracingpages\@ne
-    \tracinglostchars\@ne
-    \tracingparagraphs\@ne
-    \errorcontextlines\maxdimen
-    \tracingoutput\@ne
-    \showboxbreadth\maxdimen
-    \showboxdepth\maxdimen
-    \errorstopmode
-    \tracingmacros\tw@
-    \tracingrestores\@ne
-    \tracingcommands\tw@
+%    \@tracingtrue
+%    \tracingstats\tw@
+%    \tracingpages\@ne
+%    \tracinglostchars\@ne
+%    \tracingparagraphs\@ne
+%    \errorcontextlines\maxdimen
+%    \tracingoutput\@ne
+%    \showboxbreadth\maxdimen
+%    \showboxdepth\maxdimen
+%    \errorstopmode
+%    \tracingmacros\tw@
+%    \tracingrestores\@ne
+%    \tracingcommands\tw@
 %    \end{macrocode}
 %    The setting of |\tracingonline| depends on the option
 %    \texttt{logonly}:
 %    \begin{macrocode}
-    \tracingonline\tracingonline at p
-  }
+%    \tracingonline\tracingonline at p
+%  }
 %    \end{macrocode}
 %
 %    Now what should |\conditionally at traceoff| do in this case? Should
@@ -454,15 +455,15 @@
 %    value they already have).
 %  \changes{v1.1c}{2003/04/30}{Turn off \cs{tracingoutput}}
 %    \begin{macrocode}
-  \def\conditionally at traceoff{%
-    \tracingrestores\z@
-    \tracingcommands\z@
-    \tracingpages\z@
-    \tracingmacros\z@
-    \tracingparagraphs\z@
-    \tracingoutput\z@
-    \showboxbreadth\m at ne
-    \showboxdepth\m at ne
+%  \def\conditionally at traceoff{%
+%    \tracingrestores\z@
+%    \tracingcommands\z@
+%    \tracingpages\z@
+%    \tracingmacros\z@
+%    \tracingparagraphs\z@
+%    \tracingoutput\z@
+%    \showboxbreadth\m at ne
+%    \showboxdepth\m at ne
 %    \end{macrocode}
 %
 %    As remarked above there are more tracing switches set by
@@ -470,22 +471,22 @@
 %    |\tracinglostchars| so we leave it alone.
 %  \changes{v1.1c}{2003/04/30}{Reset \cs{tracingstats} to one}
 %    \begin{macrocode}
-   \tracingstats\@ne
-% \tracinglostchars\z@
+%   \tracingstats\@ne
+%% \tracinglostchars\z@
 %    \end{macrocode}
 %    Since this is the command that only conditionally turns off
 %    tracing we do not touch the |@tracing| switch. This way a
 %    |\conditionally at traceon| will be able to turn the tracing on
 %    again.
 %    \begin{macrocode}
-  }
+%  }
 %    \end{macrocode}
 %
 %    That covers the case for the standard \TeX{} program. If
 %    |\tracingsgroups| was defined we assume that we are running with
 %    \eTeX{} in extended mode.
 %    \begin{macrocode}
-\else
+%\else
 %    \end{macrocode}
 %
 %    In that case |\tr at ce@n| does more than |\tracingall|: it also
@@ -504,9 +505,22 @@
     \tracinglostchars\@ne
     \tracingparagraphs\@ne
     \errorcontextlines\maxdimen
-    \tracingoutput\@ne
-    \showboxbreadth\maxdimen
-    \showboxdepth\maxdimen
+%    \end{macrocode}
+%    We only change |\tracingoutput| if it hasn't already been enabled by
+%    |\showoutput|. If that's not the case, we set it to 2 so that we
+%    can distingush the two cases.    
+%  \changes{v1.1e}{2018/10/13}{Only reset \cs{tracingoutput} if not
+%    set by \cs{showoutput} earlier}
+%    \begin{macrocode}
+    \ifnum\tracingoutput=\@ne
+    \else
+      \tracingoutput\tw@
+      \showboxbreadth\maxdimen
+      \showboxdepth\maxdimen
+    \fi
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
     \errorstopmode
     \tracingmacros\tw@
     \tracinggroups\@ne
@@ -536,9 +550,21 @@
     \tracingcommands\z@
     \tracingpages\z@
     \tracingmacros\z@
-    \tracingoutput\z@
-    \showboxbreadth\m at ne
-    \showboxdepth\m at ne
+%    \end{macrocode}
+%    If |\tracingoutput| is 2 it was set above, if it is 1 it was set
+%    by |\showoutput| and we leave it alone and if it is 0 there is
+%    nothing to do as well.
+%  \changes{v1.1e}{2018/10/13}{Only reset \cs{tracingoutput} if not
+%    set by \cs{showoutput} earlier}
+%    \begin{macrocode}
+    \ifnum\tracingoutput=\tw@
+      \tracingoutput\z@
+      \showboxbreadth\m at ne
+      \showboxdepth\m at ne
+    \fi
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
     \tracingstats\@ne
     \tracingparagraphs\z@
     \tracinggroups\z@
@@ -548,7 +574,7 @@
 %    This concludes the part that depends on the formatter being
 %    used.
 %    \begin{macrocode}
-\fi
+%\fi
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}





More information about the latex3-commits mailing list