% \iffalse
%%
%% (C) Copyright 1999-2000 Frank Mittelbach, David Carlisle, Chris Rowley
%% All rights reserved.
%%
%% Not for general distribution. In its present form it is not allowed
%% to put this package onto CD or an archive without consulting the
%% the authors.
%% 
% \fi
%

%    \begin{macrocode}
\def\@tempa#1: #2.dtx,v #3 #4 #5 #6 #7${
  \ProvidesPackage{#2}[#4 #3 #5 #6]}
\@tempa$Id: xo-trace.dtx,v 1.9 2000/08/11 07:14:29 latex3 Exp $
%    \end{macrocode}
%
% Ignore white space in this package.
%    \begin{macrocode}
\IgnoreWhiteSpace
%    \end{macrocode}
%
%
%    \begin{macrocode}
\def\showmarks{
  \toks@\expandafter{\topmark}\typeout{topmark:\the\toks@}
  \toks@\expandafter{\firstmark}\typeout{firstmark:\the\toks@}
  \toks@\expandafter{\botmark}\typeout{botmark:\the\toks@}
}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\showfloatlists{{
  \let\@elt\@empty
  \typeout{free:~\@freelist}
  \typeout{active:~\@activelist}
  \typeout{mvl:~\@mvllist}
  \typeout{defer:~\area@ddd}
  \typeout{assigned:}
  \showfloatarea{t13}
  \showfloatarea{t12}
  \showfloatarea{t22}
  \showfloatarea{t11}
  \showfloatarea{t21}
  \showfloatarea{t31}
  \showfloatarea{b11}
  \showfloatarea{b21}
  \showfloatarea{b31}
  \edef\@tempa{currbox\expandafter\strip@prefix\meaning\@currbox>\space
              this@float\expandafter\strip@prefix\meaning\this@float@box>}
  \show\@tempa}}

\def\showfloatarea#1{
  \@ifundefined{area@#1}{}
     {\expandafter
      \ifx\csname area@#1\endcsname\@empty
      \else
        \typeout{~\space\space #1:~\csname area@#1\endcsname}
      \fi
     }
}
%    \end{macrocode}
%
%    \begin{macrocode}
%<*trace>
\def \@tracemessage #1{%
  \begingroup\let\@elt\space\typeout{:~\tf@indent~#1}\endgroup}
%    \end{macrocode}
%
%    \begin{macrocode}
\let\tf@indent\@empty
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@tracepush#1{%
  \tr@ce{entering~#1}
  \xdef\tf@indent{-\tf@indent}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@tracepop#1{%
  \tr@ce{leaving~#1}
  \xdef\tf@indent{\expandafter\@gobble\tf@indent}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def \tracefloats{\global\let \tr@ce \@tracemessage}
%    \end{macrocode}
%
%    \begin{macrocode}
\def \notrace {\global\let \tr@ce \@gobble}
%\notrace
%    \end{macrocode}
%
%    \begin{macrocode}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\traceonly#1{
  \notrace
  \def\@trace@command{#1}
  \gdef\@tracepush##1{
    \def\@trace@this{##1}
    \ifx\@trace@this\@trace@command
      \global\let\@this@tf@indent\tf@indent
      \tracefloats
      \tr@ce{entering~##1}
    \fi
    \xdef\tf@indent{-\tf@indent}}
  \def\@tracepop##1{
    \tr@ce{leaving~##1}
    \xdef\tf@indent{\expandafter\@gobble\tf@indent}
    \ifx\@this@tf@indent\tf@indent
      \global\let\@this@tf@indent\relax
      \notrace
    \fi}
}
%    \end{macrocode}
%
%    \begin{macrocode}
\tracefloats
%    \end{macrocode}
%
%    \begin{macrocode}
\def \@traceval #1{\tr@ce{\string #1~=~\the #1}}
%</trace>
%<-trace>\let\tr@ce\@gobble
%    \end{macrocode}
%
%    \begin{macrocode}
%<*progress>
\def \progress #1{\message{#1}}
\def \progress@separator{
       \progress{===============================
        ========================================^^J}}
\def \progress@nl #1{\progress{~ #1^^J}}
\def \progress@failed #1{\progress@nl{ ->~ failed:~ #1}}
%</progress>
%    \end{macrocode}
