texlive[52115] Master/texmf-dist: snapshot (18sep19)

commits+karl at tug.org commits+karl at tug.org
Wed Sep 18 23:56:21 CEST 2019


Revision: 52115
          http://tug.org/svn/texlive?view=revision&revision=52115
Author:   karl
Date:     2019-09-18 23:56:20 +0200 (Wed, 18 Sep 2019)
Log Message:
-----------
snapshot (18sep19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/snapshot/snapshot.pdf
    trunk/Master/texmf-dist/source/latex/snapshot/snapshot.dtx
    trunk/Master/texmf-dist/source/latex/snapshot/snapshot.ins
    trunk/Master/texmf-dist/tex/latex/snapshot/snapshot.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/snapshot/README

Added: trunk/Master/texmf-dist/doc/latex/snapshot/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/snapshot/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/snapshot/README	2019-09-18 21:56:20 UTC (rev 52115)
@@ -0,0 +1,17 @@
+README for snapshot                                    2019/09/17
+https://www.ams.org/arc/resources/snapshot-about.html
+tech-support at ams.org
+
+The snapshot package helps the owner of a LaTeX document
+obtain a list of the external dependencies of the document, in a
+form that can be embedded at the top of the document. To put it
+another way, it provides a snapshot of the current processing
+context of the document, insofar as it can be determined from
+inside LaTeX.
+
+Originally written by Michael J. Downes, the snapshot package
+is currently maintained by the American Mathematical Society.
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3c
+of this license or (at your option) any later version.


Property changes on: trunk/Master/texmf-dist/doc/latex/snapshot/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/snapshot/snapshot.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/snapshot/snapshot.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/snapshot/snapshot.dtx	2019-09-18 21:53:06 UTC (rev 52114)
+++ trunk/Master/texmf-dist/source/latex/snapshot/snapshot.dtx	2019-09-18 21:56:20 UTC (rev 52115)
@@ -1,50 +1,55 @@
-%%% ====================================================================
-%%%  @LaTeX-doc-source-file{
-%%%     filename        = "snapshot.dtx",
-%%%     version         = "1.14",
-%%%     date            = "2002/03/05",
-%%%     time            = "15:29:00 EST",
-%%%     checksum        = "39090 807 3449 29761",
-%%%     author          = "American Mathematical Society",
-%%%     copyright       = "Copyright 2001 American Mathematical Society,
-%%%                        all rights reserved.  Copying of this file is
-%%%                        authorized only if either:
-%%%                        (1) you make absolutely no changes to your copy,
-%%%                        including name; OR
-%%%                        (2) if you do make changes, you first rename it
-%%%                        to some other name.",
-%%%     address         = "American Mathematical Society,
-%%%                        Electronic Products and Services,
-%%%                        PO Box 6248,
-%%%                        Providence, RI 02940,
-%%%                        USA",
-%%%     email           = "tech-support at ams.org",
-%%%     URL             = "http://www.ams.org/",
-%%%     supported       = "yes",
-%%%     keywords        = "version, compatibility, dependencies, LaTeX",
-%%%     abstract        = "This package provides a way for a LaTeX
-%%%                        document to specify, for each external file
-%%%                        on which the document depends, which version
-%%%                        is required to guarantee output fidelity.",
-%%%     docstring       = "The checksum field above contains a CRC-16
-%%%                        checksum as the first value, followed by the
-%%%                        equivalent of the standard UNIX wc (word
-%%%                        count) utility output of lines, words, and
-%%%                        characters.  This is produced by Robert
-%%%                        Solovay's checksum utility.",
-%%%  }
-%%% ====================================================================
+% \def\filename{snapshot.dtx}
+% \def\fileversion{2.13}
+% \def\filedate{2012/08/06}
+%
+% \iffalse meta-comment
+%
+% American Mathematical Society
+% Technical Support
+% Publications Technical Group
+% 201 Charles Street
+% Providence, RI 02904
+% USA
+% tel: (401) 455-4080
+%      (800) 321-4267 (USA and Canada only)
+% fax: (401) 331-3842
+% email: tech-support at ams.org
+%
+% Copyright 1999-2003, 2004, 2010, 2012 American Mathematical Society.
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+%   http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+% 
+% This work has the LPPL maintenance status `maintained'.
+% 
+% The Current Maintainer of this work is the American Mathematical
+% Society.
+%
+% \fi
+%
 % \iffalse
 %<*driver>
 \NeedsTeXFormat{LaTeX2e}
-\documentclass{amsdtx}
+\documentclass[oneside]{amsdtx}
 \providecommand{\qq}[1]{\textquotedblleft#1\textquotedblright}
-\providecommand{\mdash}{\textemdash}
+\providecommand{\mdash}{\textemdash\penalty\exhyphenpenalty}
+\providecommand{\lat}[1]{\protect\LaTeX{}}
+\providecommand{\strong}[1]{\textbf{#1}}
+\providecommand{\secref}[1]{Section~\ref{#1}}
+
+\CodelineIndex
+
 \begin{document}
 \title{The \pkg{snapshot} package}
 \author{American Mathematical Society\\Michael Downes}
 \date{Version \fileversion, \filedate}
-\hDocInput{snapshot.dtx}
+\DocInput{snapshot.dtx}
+\PrintIndex
 \end{document}
 %</driver>
 % \fi
@@ -82,7 +87,9 @@
 % \end{verbatim}
 %
 %    \item Run \latex/ on the document. This will produce a dependency
-%    list in a file \verb'\jobname.dep'.
+%    list in a file \verb'\jobname.dep'. (I.e., if the document name is
+%    \fn{vermont.ltx}, the dependency list will be named
+%    \fn{vermont.dep}.)
 %
 %    \item Insert the \fn{.dep} file at the top of the document, before
 %    \cn{documentclass}. The following example shows what you would end
@@ -132,7 +139,9 @@
 %    the dependency list, but standard \tex/ 3.x does not provide direct
 %    access to font checksums for macro programmers. This information
 %    could be added by a separate script that scans the DVI file.
+%    (Certain nontrivial complications are possible, however.)
 %
+% \section{Graphics files}
 %    When a graphics file is read in by a \latex/ document using the
 %    standard \cn{includegraphics} command, it gets a dummy version
 %    number string of
@@ -153,10 +162,12 @@
 %    It would be possible, for \fn{.eps} files at least, to read the
 %    CreationDate comment that is normally included in the file header
 %    and use that as the basis of comparison. Recording the bounding box
-%    numbers instead of a dummy version number would also be a possibly
-%    useful stratagem. But I have left these possibilities untouched for
-%    the time being [mjd,2001-05-14].
+%    numbers instead of a dummy version number is another possibility,
+%    which you can get with the
+%    \opt{bbinfo} option (as of \pkg{snapshot} version 2.05).
 %
+% \section{Formalities}
+%
 % \DescribeMacro{\RequireVersions} The \cn{RequireVersions} command
 %    scans its argument for file names and associated version number
 %    information. The syntax of a version line for a particular file is
@@ -182,14 +193,31 @@
 %    \opt{tfm} to turn on the logging of metric files. (Not yet
 %    implemented [mjd,1999/09/23])
 %
-% \item[format] This is almost always \fn{LaTeX2e}. Other possibilities
-%    would be \fn{elatex} or \fn{lambda}. The information comes from
-%    \cs{fmtname}.
-% \item[application] This is usually \fn{TeX} with version number
-%    \fn{3.x}. From inside \latex/ there is no reliable way to get the
-%    exact version number (one could check to see if version 2.x is in
-%    use, but this is unlikely to be relevant, nowadays, so I have not
-%    bothered).
+% \item[format] This is almost always \fn{LaTeX2e}. The information
+%    comes from \cs{fmtname}. Lambda, e\LaTeX{}, and pdf\LaTeX{} leave
+%    \cs{fmtname} unchanged, and although this may seem dubious at first
+%    sight, I guess they have little choice: the widespread use of
+%    \cs{NeedsTeXFormat} in existing package files makes them produce an
+%    error message if \cs{fmtname} is changed. (Maybe the thing to do
+%    would be to modify the definition of \cs{NeedsTeXFormat} as well.)
+%
+%    For a \LaTeX{} format that uses the Babel mechanism for preloading
+%    hyphenation patterns, the version number of \fn{babel.def} that was
+%    used in building the format might be of interest. But at first
+%    glance there does not seem to be any easy way of dealing with that,
+%    and in the normal course of things, a document that relies on Babel
+%    features will also have a \verb'\usepackage{babel}' statement at
+%    the top, and that will yield adequate (I think) information for the
+%    snapshot dependency list.
+%
+% \item[application] With standard \fn{TeX} there is no reliable way to
+%    get the exact version number from inside \LaTeX{}. If a document is
+%    processed with one of the recent variants that address this
+%    deficiency (such as e-\TeX{}, pdf\TeX{} and Omega) the available
+%    version info is used, but otherwise a presumptive value of
+%    \verb'1990/03/25 v3.x' is used (the official release date of \TeX{}
+%    3.0).
+%
 % \item[file] None of the above: some other file of miscellaneous type,
 %    e.g., \fn{.clo}, \fn{.cfg}, \fn{.tex}, or \fn{.def}.
 % \end{description}
@@ -200,8 +228,25 @@
 %    assign a label to particular groups of files in case that helps
 %    with external processing.
 %
-% \section{Warning and error options}
+% \section{Package options}
 %
+%    The list of options supported by the \pkg{snapshot} package is as
+%    follows:
+% \begin{center}\begin{tabular}{lll}
+% dep             & date\\
+% log             & version\\
+% tfm             & major-version\\
+% warning         & bbinfo \\
+% error           & test \\
+% self-warning
+% \end{tabular}
+% \end{center}
+%
+% \begin{description}
+% \item[dep, log] Write file date and version information to
+%    \textit{jobname}\fn{.dep} or to the \LaTeX{} log file, respectively.
+%
+% \item[error, warning, self-warning]
 %    If the \pkg{snapshot} package is invoked with the \opt{error}
 %    option \emph{and also} the document contains a \cn{RequireVersions}
 %    statement, then each subsequent \cn{ProvidesFile},
@@ -219,13 +264,69 @@
 %    comparing.
 % \end{description}
 %
+%    The \opt{self-warning} causes a warning to be given, instead of an
+%    error, if the \pkg{snapshot} package itself has a date or
+%    version mismatch.
+%
 %    \textbf{Note:} A file that doesn't have any sort of
 %    \cn{ProvidesFile} or \cn{ProvidesPackage} statement in it will show
 %    up in the dependency list, with a dummy date and version number of
-%    0000/00/00 v0.0, but there is no way, of course, to give any
-%    meaningful warning or error message about version mismatches for
-%    such a file.
+%    0000/00/00 v0.0, but testing for a version mismatch with such a
+%    file is then infeasible.
 %
+% \item[bbinfo] For files of type ``graphic'', include bounding-box info
+%    as the ``version number''. A normal date and version number are
+%    seldom available for such files, and \LaTeX{} does not attempt
+%    to read them, which means that the \pkg{snapshot} package could not
+%    obtain the information except by drastically modifying the
+%    low-level \LaTeX{} operations that read graphics file
+%    information\mdash which seems overly risky.
+%
+% \item[tfm] \emph{Not implemented yet!} Include information about which
+%    \TeX{} font metric files are called by \LaTeX{}. This list is
+%    usually somewhat different from the list of fonts that are actually
+%    used in the output file (\fn{.dvi} or \fn{.pdf}), primarily because
+%    the setup for math formulas will normally preload font metric
+%    information for all the fonts from which \LaTeX{}'s basic math
+%    symbols are drawn (the symbols documented in the \LaTeX{} book),
+%    even if the document does not use symbols from all of those fonts.
+%
+% \item[test] This option is for a special purpose. It drastically
+%    changes the action of the \cs{RequireVersions} command so that it
+%    does not merely record the information for later reference, but
+%    does a \qq{trial load attempt} for each file in the list, and then
+%    stops the \LaTeX{} job as soon as the list is finished, without
+%    continuing any further.
+%
+%    By \qq{trial load attempt} I mean that the \cs{RequireVersions}
+%    command will actually input each file, but with various bits
+%    redefined so that \cs{ProvidesPackage} and variants will execute
+%    \cs{endinput}\mdash in other words, only the first few lines of
+%    each file will be read.
+%
+%    What this means, practically speaking, is that if you run such a
+%    test on a document, it gives a relatively quick check on two useful
+%    pieces of information without having to retypeset the entire
+%    document (which for some documents might be very tedious)
+% \begin{enumerate}
+% \item The actual location on your system from which the file will be
+%    loaded.
+%
+% \item The date and version info from \cs{Provides...} line, if present.
+% \end{enumerate}
+%
+%    Similar results could be obtained by a combination of
+%    \fn{kpsewhich} and \fn{grep}, but because the \pkg{snapshot} \opt{test}
+%    option works through \LaTeX{}, it is a system-independent method.
+%
+%    Caveat: If a file does not contain any \cs{ProvidesSomething} line,
+%    it will be read in its entirety, which might lead to errors. Or if
+%    there is any weird stuff preceding the \cs{ProvidesWhatever} line.
+%    But for well-behaved files the option seemed useful enough to be
+%    worth implementing.
+%
+% \end{description}
+%
 % \StopEventually{}
 %
 % \section{Implementation}
@@ -232,13 +333,9 @@
 %    Standard declaration of package name and date.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{snapshot}[2002/03/05 v1.14]
+\ProvidesPackage{snapshot}[2012/08/06 v2.13]
 %    \end{macrocode}
 %
-%    \begin{macrocode}
-\let\@xp\expandafter \let\@nx\noexpand
-%    \end{macrocode}
-%
 %    Calling the \pkg{snapshot} package in a document causes \latex/ to
 %    list the file names and versions in the \tex/ log or in a \fn{.dep}
 %    file, so that the information may be easily copied into the
@@ -260,12 +357,32 @@
 %    available; if the second piece is not present, a dummy number
 %    \verb'0.0' is supplied. Similarly, files that don't include any
 %    \cn{ProvidesWhatever} statement will get a dummy date of
-%    \verb'0000/00/00'; \tex/ system administrators who want to ensure
+%    \verb'0000/00/00';
+% \begin{center}\begin{minipage}{.9\columnwidth}\bfseries
+%    \medskip
+%    \tex/ system administrators who want to ensure
 %    maximal accuracy of the snapshot information should therefore make
 %    it a practice to use \cn{ProvidesFile} in \fn{.cfg} files and other
 %    local files that might have an impact on the output fidelity of
 %    their documents.
+% \end{minipage}\end{center}
 %
+%    A couple of shorthand forms.
+%    \begin{macrocode}
+\let\@xp=\expandafter \let\@nx=\noexpand
+%    \end{macrocode}
+%
+%    A function to compare two strings and return FT or TT (for use with
+%    \cs{if}).
+%    \begin{macrocode}
+\def\str at cmp#1#2\str at cmp#3{%
+  \if #1#3\else F\@car\fi \str at cmp#2\str at cmp
+}
+\def\string at equal#1#2{%
+  \str at cmp#1\relax\str at cmp#2{\relax\@gobbletwo}\@nil TT%
+}
+%    \end{macrocode}
+%
 %  \begin{macro}{\RequireVersions}
 %
 %    Optional argument of \cn{RequireVersions} allows assigning a name to a
@@ -272,15 +389,47 @@
 %    particular collection of files. This might be useful for setting a
 %    \tex/ inputs path.
 %    \begin{macrocode}
-\newcommand{\RequireVersions}[2][]{%
-  \let\snap at check\snap at compare@versions
-  \let\snap at selfcheck\snap at selfcheck@a
-  \@ifnextchar *\snap at store@version\snap at store@error#2*{end}{}{}%
+\newcommand{\RequireVersions}[2][]{}%
+\renewcommand{\RequireVersions}[1][]{%
+  \def\snap at check{\snap at compare@versions}%
+  \toks@{#1}\afterassignment\snap at storem
+  \let\@let at token=
 }
+\def\snap at storem{%
+  \ifx\@let at token\bgroup
+  \else
+    \PackageError{snapshot}{Expected a `\@charlb' character here}\@ehc
+    \@xp\@gobblefour
+  \fi
+  \futurelet\@let at token\snap at branch
+}
 \@onlypreamble\RequireVersions
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+\let\snap at check\@gobble
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\snap at finish{\toks@\bgroup}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\snap at branch{%
+  \ifx\@let at token\egroup
+    \@xp\snap at finish
+  \else\ifx\@let at token *%
+    \let\reserved at c\snap at store@version
+  \else\ifx\@let at token\@sptoken
+    \lowercase{\def\reserved at c} {\futurelet\@let at token\snap at branch}%
+  \else
+    \let\reserved at c\snap at store@error
+  \fi\fi\fi
+  \reserved at c
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \def\snap at store@error#1{%
   \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc
 }
@@ -294,7 +443,49 @@
 \@onlypreamble\snap at store@version
 %    \end{macrocode}
 %
+%    Detection of e-\LaTeX{}, pdf\LaTeX{}, pdfe\LaTeX{}, and Lambda
+%    [Omega]:
 %    \begin{macrocode}
+\ifx\OmegaVersion\@@undefined
+\else
+  \edef\snapshotApplication{%
+    {Omega}\space\space\space
+    {0000/00/00 v\OmegaVersion}%
+  }%
+\fi
+\ifx\eTeXversion\@@undefined
+\else
+  \edef\snapshotApplication{%
+    {eTeX}\space\space\space\space
+    {0000/00/00 v\number\eTeXversion\eTeXrevision}%
+  }%
+\fi
+\ifx\pdftexversion\@@undefined
+\else
+  \edef\snapshotApplication{%
+    \ifx\eTeXversion\@@undefined
+      {pdfTeX}\space\space
+    \else
+      {pdfeTeX}\space
+    \fi
+      {0000/00/00 v0.\number\pdftexversion\pdftexrevision}%
+  }%
+\fi
+%    \end{macrocode}
+%    If none of the above information is available, the exact version
+%    number of \TeX{} is not accessible from inside \latex/. We then
+%    fall back to using a nominal date of 1990/03/25, which is when
+%    version 3.0 of \fn{tex.web} was released by Knuth.
+%    \begin{macrocode}
+\@ifundefined{snapshotApplication}{%
+  \edef\snapshotApplication{%
+    {TeX}\space\space\space\space\space
+    {1990/03/25 v3.x}%
+  }%
+}{}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \def\@fmtextension{fmt}
 \def\@tfmextension{tfm}
 \edef\snapx at package{.\@pkgextension}
@@ -301,9 +492,11 @@
 \edef\snapx at class{.\@clsextension}
 \edef\snapx at format{.\@fmtextension}
 \edef\snapx at tfm{.\@tfmextension}
-\long\def\snapx at application{}
-\let\snap at file=\@empty
+\long\def\snapx at ignore{}
+\let\snapx at application=\snapx at ignore
+\let\snapx at file=\@empty
 \let\snapx at end\@@end
+\expandafter\let\csname snapx at -------\endcsname\snapx at end
 %    \end{macrocode}
 %
 %    For a package named \fn{foo.sty}, this function defines
@@ -311,7 +504,7 @@
 %    \begin{macrocode}
 \def\snap at store@b#1#2#3#4{%
   \ifx#1\snapx at end
-    \@xp\@gobblefour
+    \@xp\snap at finish
   \else
     \ifx#1\relax \let#1\@empty\fi
     \def\@tempa##1 ##2 ##3\@nil{##1 ##2}%
@@ -319,18 +512,23 @@
 %
 %    \begin{macrocode}
     \ifx#1\snapx at application
+      \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}%
     \else
-      \xdef\rqv at list{\rqv at list
-        \ifx\@empty\rqv at list\else,\fi
-        #3#1%
-      }%
+      \xdef\rqv at list{\rqv at list{#3#1}}%
+      \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}%
+      \snap at intest{#3}{#1}%
+      \ifx#1\snapx at format \snap at check{#3.fmt}%
+%    \end{macrocode}
+%    Test if current file is \fn{snapshot.sty}. Need to pre-expand the
+%    extension part to ensure the test is correct.
+%    \begin{macrocode}
+      \else
+        \edef\@tempa{\@nx\string at equal{snapshot.sty}{#3#1}}%
+        \if\@tempa \snap at selfcheck \fi
+      \fi
     \fi
-    \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}%
-    \ifx#1\snapx at format \snap at check{#3.fmt}%
-    \else \snap at selfcheck{#3.sty}%
-    \fi
   \fi
-  \@ifnextchar *\snap at store@version\snap at store@error
+  \futurelet\@let at token\snap at branch
 }
 \@onlypreamble\snap at store@b
 %    \end{macrocode}
@@ -356,21 +554,11 @@
 %    \end{macrocode}
 %
 %    The purpose of the `test' option is to support a separate testing
-%    procedure that resolves file names. If the \cs{RequireVersions}
-%    data is extracted to a separate file, and
-%\begin{verbatim}
-%\RequirePackage[test]{snapshot}
-%\end{verbatim}
-%    is added at the top, then the file can be run as a small separate
-%    \LaTeX{} job whose sole purpose is to produce in the log file a
-%    nice list of fully resolved file names. A limited, but
-%    system-independent variant of the \fn{kpsewhich} idea.
-%
+%    procedure for resolving file names and pre-checking version
+%    numbers. See \secref{test} for more information.
 %    \begin{macrocode}
-\let\snap at fake@b\relax
-\DeclareOption{test}{%
-  \def\snap at fake@b{\endinput \futurelet\@let at token\snap at ignoline}%
-}
+\let\snap at intest=\@gobbletwo
+\DeclareOption{test}{\def\snap at intest{True}}
 %    \end{macrocode}
 %
 %    For each font used by a document, we would like to list the
@@ -402,6 +590,7 @@
 %    \begin{macrocode}
 \DeclareOption{error}{%
   \def\snap at mismatch{\PackageError}%
+  \def\snap at selfcheck{\snap at selfcheck@a}%
   \ifx\snap at select\@empty \let\snap at select\snap at select@all \fi
 }
 %    \end{macrocode}
@@ -409,26 +598,35 @@
 %    \begin{macrocode}
 \DeclareOption{warning}{%
   \def\snap at mismatch{\snap at mismatch@warning}%
+  \def\snap at selfcheck{\snap at selfcheck@a}%
   \ifx\snap at select\@empty \let\snap at select\snap at select@all \fi
 }
 %    \end{macrocode}
 %
 %    Because the exact form of the version number is not mandated by
-%    LaTeX, just take the first two ``words'' delimited by spaces. And
-%    take a little extra care to properly handle multiple spaces between
-%    the words.
+%    \LaTeX{}, just take the first two ``words'' delimited by spaces.
+%    And take a little extra care to properly handle multiple spaces
+%    between the words.
 %    \begin{macrocode}
 \def\snap at select@all#1#2 #3#4 #5\@nil{#1#2 #3#4}
 \let\snap at select\@empty
 %    \end{macrocode}
 %
+%    If the naming conventions seem a little peculiar here, it's because
+%    I had to add some pieces later that I didn't think of initially,
+%    and I wanted to minimize the chances of compatibility problems for
+%    client packages [mjd,2002-11-04].
 %    \begin{macrocode}
-\DeclareOption{date}{%
-  \def\snap at select#1#2 #3\@nil{#1#2}%
-}
+\def\snap at seldate#1#2 #3\@nil{#1#2}%
+\def\snap at selversion#1#2 #3{\snap at select@version #3}%
+\def\snap at selmajor#1#2 #3{\snap at select@major #3}%
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+\DeclareOption{date}{\let\snap at select=\snap at seldate}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \def\snap at select@version#1{%
   \ifodd 0#11 \@xp\snap at sva\@xp#1\else\@xp\snap at select@version\fi
 }
@@ -440,19 +638,45 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareOption{version}{%
-  \def\snap at select#1#2 #3{\snap at select@version #3}%
+\DeclareOption{version}{\let\snap at select\snap at selversion}
+\DeclareOption{major-version}{\let\snap at select\snap at selmajor}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\snap at bbinfo{01}
+\DeclareOption{bbinfo}{\def\snap at bbinfo{00}}
+%    \end{macrocode}
+%
+%    Give this an inert definition, for the time being, until we are
+%    ready to do the split.
+%    \begin{macrocode}
+\let\snap at splitter=?
+\AtBeginDocument{%
+  \xdef\@filelist{\@filelist\snap at splitter}%
 }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareOption{major-version}{%
-  \def\snap at select#1#2 #3{\snap at select@major #3}%
+\let\snap at selfcheck\@empty
+\let\snap at selfcheck@a\@empty
+%    \end{macrocode}
+%
+%    The \opt{self-warning} option would normally be used in conjunction
+%    with the \opt{error} option.
+%    \begin{macrocode}
+\DeclareOption{self-warning}{%
+  \def\snap at selfcheck{%
+    \begingroup
+    \def\snap at mismatch{\snap at mismatch@warning}%
+    \snap at selfcheck@a
+    \endgroup
+  }
 }
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\ProcessOptions\par
+\ExecuteOptions{warning}
+\ProcessOptions\relax
 %    \end{macrocode}
 %
 %    We need the following patch to make up for the fact that
@@ -510,54 +734,36 @@
     v\ifx\@tempc\fmtname 2.e\else ?.?\fi
   }%
 \fi
+%    \end{macrocode}
+%    Ensure that files get recorded.
+%    \begin{macrocode}
 \listfiles
-\def\@dofilelist{%
-  \snap at restore@extensions
-  \ifx\rqv at list\@empty
-  \else \rqv at compare@lists
-  \fi
-  \ifx\snap at write\typeout
-  \else
-    \newwrite\snap at out
-    \immediate\openout\snap at out=\jobname.dep \relax
-  \fi
-  \snap at write{\string\RequireVersions\@charlb}%
 %    \end{macrocode}
-%    Since the exact version number of \TeX{} is not normally accessible
-%    from inside \latex/, we use a nominal date of 1990/03/25, which is
-%    when version 3.0 of \fn{tex.web} was released by Knuth.
+%
 %    \begin{macrocode}
-  \snap at write{\space\space *{application}{TeX}%
-             \space\space\space\space\space{1990/03/25 v3.x}}%
-  \@for\@currname:=\@filelist\do{%
-    \filename at parse\@currname
+\def\snap at doit#1{%
+  \begingroup
+  \ifx\delimiter#1\delimiter
+  \else
+    \filename at parse{#1}%
+    \let\@tempd\@empty
     \ifx\filename at ext\relax
-      \def\@tempa{file}\def\@tempd{.tex}\def\filename at ext{tex}%
-      \def\@tempb{~~~}%
+      \def\@tempa{file}\def\@tempb{~~~}%
     \else\ifx\filename at ext\@pkgextension
-      \def\@tempa{package}\let\@tempd\@empty
-      \def\@tempb{}%
+      \def\@tempa{package}\let\@tempb\@empty
     \else\ifx\filename at ext\@clsextension
-      \def\@tempa{class}\let\@tempd\@empty
-      \def\@tempb{~~}%
+      \def\@tempa{class}\def\@tempb{~~}%
     \else\ifx\filename at ext\@fmtextension
-      \def\@tempa{format}\let\@tempd\@empty
-      \def\@tempb{~}%
+      \def\@tempa{format}\def\@tempb{~}%
     \else\ifx\filename at ext\@tfmextension
-      \def\@tempa{tfm}\let\@tempd\@empty
-      \def\@tempb{~~~~}%
+      \def\@tempa{tfm}\def\@tempb{~~~~}%
     \else
       \def\@tempa{file}\edef\@tempd{.\filename at ext}%
       \def\@tempb{~~~}%
     \fi\fi\fi\fi\fi
     \@xp\let\@xp\@tempe
-      \csname ver@\filename at base.\filename at ext\endcsname
-%    \end{macrocode}
-%    If a file contains just \verb'\ProvidesFoo{xyz}' without \emph{any}
-%    optional argument, then \cs{ver at xyz} ends up empty. Resetting it to
-%    \cs{relax} is the easiest way to get the fallback version
-%    number in that case also.
-%    \begin{macrocode}
+      \csname ver@\filename at base %
+        \ifx\filename at ext\relax\else.\filename at ext\fi\endcsname
     \ifx\@tempe\@empty \let\@tempe\relax \fi
     \edef\@tempe{%
       \ifx\@tempe\relax 0000/00/00 v0.0%
@@ -567,10 +773,91 @@
     }%
     \edef\@tempc{\filename at area\filename at base\@tempd}% full file name
     \@xp\snap at pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd
-    \begingroup \let~\space
-      \snap at write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}%
-    \endgroup
+    \let~\space
+    \snap at write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}%
+  \fi
+  \aftergroup\snap at doit
+  \endgroup
+}%
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\snap at bracify#1#2,{%
+  \ifx\@empty#1\expandafter\@gobble\else {#1#2}\fi \snap at bracify
+}
+\def\snap at splitter@a{%
+  \iffalse{{\fi }}% close current file name, end definition
+  \xdef\specific at files{%
+    \iffalse}\fi
+    \specific at files
+    \expandafter\@gobble\string % discard one closing brace
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\snap at fdcheck#1{%
+  \ifx\delimiter#1\@xp\@gobble
+  \else\snap at fda#1\@empty.fd\@empty ?\@nil
+  \fi
+  \snap at fdcheck
+}
+\def\snap at fda#1.fd\@empty#2#3\@nil{%
+  \if ?#2%
+    \xdef\specific at files{\specific at files {#1}}%
+  \else
+    \xdef\general at files{\general at files {#1.fd}}%
+  \fi
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\let\general at files\@empty
+\let\specific at files\@empty
+%    \end{macrocode}
+%
+%    The \cn{SpecialInput} command is related to the \opt{packages-only}
+%    option. Apart from some ad hoc handling for \fn{.fd} files that get
+%    loaded on demand, all files that are input after
+%    \verb'\begin{document}' are put into the specific-files list, and
+%    all files before \verb'\begin{document}' go into the general-files
+%    (packages-only) list. If there is a macro file for a book (say),
+%    that contains definitions specific to that book, and that is loaded
+%    in the preamble, loading it with \cs{SpecialInput} will cause it to
+%    go in the specific-files list.
+%    \begin{macrocode}
+\newcommand{\SpecialInput}[1]{%
+  \xdef\specific at files{\specific at files{#1}}%
+  \@@input#1\relax
+}
+%    \end{macrocode}
+%
+%    Our definition of \cs{@dofilelist} does not retain much resemblance
+%    to the original in the \LaTeX{} kernel.
+%    \begin{macrocode}
+\def\@dofilelist{%
+  \snap at restore@extensions
+  \xdef\general at files{\@xp\snap at bracify \@filelist \@empty,\@empty,}%
+  \let\snap at splitter\snap at splitter@a
+  \xdef\general at files{\general at files}%
+  \let\@tempa\specific at files \global\let\specific at files\@empty
+  \@xp\snap at fdcheck\@tempa{\delimiter}%
+  \ifx\rqv at list\@empty
+  \else \rqv at compare@lists
+  \fi
+  \ifx\snap at write\typeout
+  \else
+    \newwrite\snap at out
+    \immediate\openout\snap at out=\jobname.dep \relax
+  \fi
+  \snap at write{\string\RequireVersions\@charlb}%
+  \snap at write{\space\space *{application}%
+    \snapshotApplication
   }%
+  \@xp\snap at doit\general at files{\delimiter\aftergroup\@gobble\@gobble}%
+  \ifx\specific at files\@empty
+  \else
+    \snap at specific
+  \fi
   \snap at write{\@charrb}%
   \ifx\snap at write\typeout
   \else \immediate\closeout\snap at out
@@ -579,102 +866,86 @@
 }%
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+\def\snap at specific{%
+  \snap at write{ \space *{-------}{Document-specific files:}{----}}%
+  \@xp\snap at doit\specific at files{\delimiter\aftergroup\@gobble\@gobble}%
+}
+%    \end{macrocode}
+%
 %    The \cs{rqv at compare@lists} function checks to see if any files
-%    are found only in the RequireVersions list or only in
-%    \cs{@filelist}. To see which files are only in \cs{@filelist}, we
-%    map the \cs{rqv at condense} function across both lists, reinitializing
-%    \cs{L} (used here as a scratch variable) in between. As a side
-%    effect this leaves the desired file names in \cs{L}. Then the same
-%    process with the order of the lists reversed tells us which ones
-%    are only in \cs{rqv at list}.
+%    are found only in the RequireVersions list or only in the
+%    \cs{general at files} list.
 %    \begin{macrocode}
-\def\rqv at condense#1,{%
-  \if ,#1,%
+\def\rqv at condense#1{%
+  \@xp\ifx\csname ver@#1\endcsname\N
   \else
-    \@xp\ifx\csname ver@#1\endcsname\N
-    \else
-      \edef\L{\L,#1}%
-      \@xp\let\csname ver@#1\endcsname=\N
-    \fi
+    \edef\L{\L{#1}}%
+    \@xp\let\csname ver@#1\endcsname=\N
   \fi
   \rqv at condense
 }
+\def\rqv at condend{\endcsname ?\fi
+  \@xp\@xp\@xp\@gobbletwo\csname @xp\iftrue}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\def\rqv at compare@lists{%
-  \begingroup
-  \def\N{1}\let\L=\@gobble
-  \@xp\rqv at condense \rqv at list,TeX,{,\relax\@xp\@gobbletwo\@xp},%
-  \ifx\L\@gobble\let\L\@empty\fi
-  \let\rqv at list=\L
-  \let\L=\@gobble
-  \@xp\rqv at condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},%
-  \ifx\L\@gobble\let\L\@empty\fi
-  \@for\@currname:=\L\do{%
-    \snap at mismatch{snapshot}{^^J%
-      File \@currname\space loaded though not in
-      \noexpand\RequireVersions list%
-    }\@ehc
-  }%
-  \def\N{2}\let\L=\@gobble
-  \@xp\rqv at condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},%
-  \let\L=\@gobble
-  \@xp\rqv at condense\rqv at list,{,\relax\@xp\@gobbletwo\@xp},%
-  \ifx\L\@gobble\let\L\@empty\fi
-  \@for\@currname:=\L\do{%
-    \snap at mismatch{snapshot}{^^J%
-      File \@currname\space [\csname rqv@\@currname\endcsname]
-      required but not loaded%
-    }\@ehc
-  }%
-  \endgroup
+\def\rqv at overloaded#1{%
+  \snap at mismatch{snapshot}{^^J%
+    File #1 loaded though not in \noexpand\RequireVersions list%
+  }\@ehc
 }
 %    \end{macrocode}
 %
-%    See the documentation above for the `test' option.
 %    \begin{macrocode}
-\begingroup \catcode\endlinechar=12\relax %
-\long\gdef\snap at ignoline#1
-{}\endgroup %
+\def\rqv at notloaded#1{%
+  \snap at mismatch{snapshot}{^^J%
+    File #1 [\csname rqv@#1\endcsname] required but not loaded%
+  }\@ehc
+}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\def\snap at fake@input#1#2#3#4{%
-  \ifx#1\snapx at end
-    \aftergroup\@@end \@xp\@gobblefour
-  \else
-    \ifx#1\snapx at format
-    \else
-      \message{^^J}%
-      \@xp\snap at fake@b\@@input #3#1\relax
-    \fi
-  \fi
-  \@ifnextchar *\snap at store@version\snap at store@error
-}
+\def\rqv at set#1{\@xp\let\csname ver@#1\endcsname\N \rqv at set}
+\def\rqv at test#1{\csname ver@#1\endcsname{#1}\rqv at test}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\newcommand{\rqvTest}[2][]{%
-  \begingroup \catcode\endlinechar=12
-  \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax
+\def\rqv at compare@lists{%
+  \begingroup
 %    \end{macrocode}
-%    Since \cs{snap at fake@input} just compares \cs{snapx at foo} with
-%    \cs{ifx}, making \cs{snapx at application}
-%    and \cs{snapx at tfm} compare equal to \cs{snap at format}
-%    ensures that only one comparison is needed to tell if
-%    we shouldn't attempt to input the current file type.
+%    Clear up duplicate file names (just in case) to avoid redundant
+%    warning messages. This should seldom be necessary in practice.
 %    \begin{macrocode}
-  \let\snapx at application=\snapx at format \let\snapx at tfm=\snap at format
-  \@ifnextchar *\snap at store@version\snap at store@error#2*{end}{}{}%
-  \endgroup
-}
+  \def\N{1}\let\L\@empty
+  \@xp\rqv at condense\rqv at list\rqv at condend
+  \global\let\rqv at list=\L
+  \def\N{2}\let\L\@empty
+  \@xp\rqv at condense\general at files\rqv at condend
+  \global\let\general at files=\L
 %    \end{macrocode}
-%
+%    Let's make a shorthand for the code that terminates our recursion.
 %    \begin{macrocode}
-\@ifundefined{snap at fake@b}{}{%
-  \let\snap at store@b\snap at fake@input
-  \let\RequireVersions\rqvTest
+  \def\T{\@firstoftwo{\endcsname\@empty\@gobbletwo}}%
+%    \end{macrocode}
+%    Set all the loaded general files to an error function.
+%    \begin{macrocode}
+  \let\N\rqv at overloaded \@xp\rqv at set\general at files \T
+%    \end{macrocode}
+%    Set all the required files to an ignore function.
+%    \begin{macrocode}
+  \let\N\@gobble \@xp\rqv at set\rqv at list \T
+%    \end{macrocode}
+%    Execute all the general files.
+%    \begin{macrocode}
+  \@xp\rqv at test\general at files{\endcsname\csname @gobbletwo}%
+%    \end{macrocode}
+%    And now do essentially the same thing in the reverse direction.
+%    \begin{macrocode}
+  \let\N\rqv at notloaded \@xp\rqv at set\rqv at list \T
+  \let\N\@gobble \@xp\rqv at set\general at files \T
+  \@xp\rqv at test\rqv at list{\endcsname\csname @gobbletwo}%
+  \endgroup
 }
 %    \end{macrocode}
 %
@@ -694,27 +965,97 @@
 }
 %    \end{macrocode}
 %
-%    Terminate here without touching \LaTeX{} internals, unless
-%    one of the relevant snapshot options was chosen.
+%    Because \cs{ProvidesFile} is used in \fn{.fd} files which are
+%    normally read with special catcodes, there tend to
+%    be problems with whitespace characters being erroneously lost from
+%    the second argument. Since we have to put in a \cs{snap at check} call
+%    anyway, while we're at it let's fix a bug of this type that
+%    affected some older versions of \latex/.
 %    \begin{macrocode}
-\let\snap at compare@versions\@gobble \let\snap at check\@gobble
-\let\snap at selfcheck\@gobble \let\snap at selfcheck@a\@gobble
-\ifx\snap at select\@empty \endinput \fi
+\def\ProvidesFile#1{%
+  \def\snap at checker{\snap at check{#1}}%
+  \begingroup
+    \aftergroup\snap at checker
+    \catcode`\ 10
 %    \end{macrocode}
+%    Added guards from 2001/06/01 version of \latex/.  These are
+%    necessary because, for example, \pkg{inputenc} sets
+%    \cs{endlinechar} to a large (nonvalid character) value when
+%    reading input encoding files.  The guards prevent an ``invalid
+%    character'' error.
+%    \begin{macrocode}
+    \ifnum\endlinechar < 256
+        \ifnum \endlinechar>\m at ne
+            \catcode\endlinechar 10
+        \fi
+    \fi
+    \@makeother\/%
+    \@makeother\&%
+    \kernel at ifnextchar[{\snap at providesfile{#1}}{\snap at providesfile{#1}[]}%
+}
+%    \end{macrocode}
 %
+%    Normally the string found in the second arg of \cs{ProvidesFile}
+%    (for a nongraphics file) would begin with the usual date string.
+%    The \cs{includegraphics} command, however, begins the second arg
+%    with \texttt{Graphic file} instead. This test therefore just checks
+%    if the first two letters are \texttt{Gr}; this is enough,
+%    ordinarily, for us to conclude that we are dealing with a graphic
+%    file.
 %    \begin{macrocode}
-\begingroup \catcode`\.=11\relax
-\gdef\snap at selfcheck@b#1\rqv at snapshot.sty#2#3\@nil{T#2}
-\gdef\snap at selfcheck@a#1{%
-  \if\@xp\snap at selfcheck@b\csname rqv@#1\endcsname T%
-         \rqv at snapshot.sty F\@nil
-    \snap at check{#1}%
+\def\snap at graphic@test#1#2#3\@nil{r\if G#1#2\else X\fi}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\snap at providesfile#1[#2]{%
+  \wlog{File: #1 #2}%
+  \if\snap at graphic@test#2@@\@nil
+    \snap at record@graphic#1\relax #2 (type ??)\@nil
+  \else
+    \expandafter\xdef\csname ver@#1\endcsname{#2}%
   \fi
+  \endgroup
 }
-\endgroup
 %    \end{macrocode}
 %
+%    This is what \cn{includegraphics} does to record graphic file
+%    information.
+%\begin{verbatim}
+%\@providesfile #1[#2]->
+%\wlog {File: #1 #2}\expandafter \xdef \csname ver@#1\endcsname {#2}
+%\endgroup
+%#1<-\Gin at base \Gin at ext
+%#2<-Graphic file (type eps)
+%\end{verbatim}
+%
+%    Check the graphics info.
 %    \begin{macrocode}
+\def\snap at record@graphic#1\relax #2(type #3)#4\@nil{%
+  \expandafter\xdef\csname ver@#1\endcsname{%
+    Graphic%
+    \if\snap at bbinfo :bb=\Gin at llx/\Gin at lly/\Gin at urx/\Gin at ury\fi
+    \space v0.0%
+  }%
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\@pr at videpackage [#1]{%
+  \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}%
+  \ifx\@currext\@clsextension
+    \typeout{Document Class: \@gtempa\space#1}%
+  \else
+    \wlog{Package: \@gtempa\space#1}%
+  \fi
+  \snap at check{\@currname.\@currext}%
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\snap at selfcheck@a{\snap at check{snapshot.sty}}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \def\@nofmt#1.fmt.#2 {#1 }
 %    \end{macrocode}
 %
@@ -747,39 +1088,205 @@
       \fi
     }%
   \endgroup
+%    \end{macrocode}
+%    When the \opt{test} option is in effect, jump out of the current
+%    file instead of continuing.
+%    \begin{macrocode}
+  \snap at test@abort
 }
 %    \end{macrocode}
 %
-%    Because \cs{ProvidesFile} is used in \fn{.fd} files which are
-%    normally read with special catcodes, there tend to
-%    be problems with whitespace characters being erroneously lost from
-%    the second argument. Since we have to put in a \cs{snap at check} call
-%    anyway, while we're at it let's fix a bug of this type that
-%    affected some older versions of \latex/.
 %    \begin{macrocode}
-\def\ProvidesFile#1{%
-  \def\snap at checker{\snap at check{#1}}%
-  \begingroup
-    \aftergroup\snap at checker
-    \catcode`\ 10\catcode\endlinechar 10 %
-    \@makeother\/%
-    \@makeother\&%
-    \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}%
+\let\snap at test@abort=\@empty
+%    \end{macrocode}
+%
+% \section{Compatibility}
+%
+%    Suppose that I have a \lat/ document containing a
+%    \cs{RequireVersions} statement generated by \pkg{snapshot} and I
+%    send this to my colleague who, we believe, has a \lat/ setup that
+%    is for our purposes identical. Suppose that our belief is erroneous
+%    in the following way: My colleague has a newer version of
+%    \pkg{snapshot} and a newer version of one of the affected files.
+%
+%    Here is what we \strong{don't} want to happen: That the differing
+%    version of snapshot would cause the other differing file to be
+%    accepted without demur.
+%
+%    Conversely, if it is I who have the newer version of
+%    \pkg{snapshot}, the main concern is that some difference in the
+%    contents of the \cs{RequireVersions} statement would lead to an
+%    error when my colleague attempts to process the document.
+%
+% \section{In conclusion}
+%
+%    \begin{macrocode}
+\ifx\snap at select\@empty
+  \let\snap at compare@versions\@gobble
+  \let\snap at check\@gobble
+\fi
+%    \end{macrocode}
+%
+%    Fallback for a command that is sometimes used in AMS journal
+%    production.
+%    \begin{macrocode}
+\providecommand{\controldates}[1]{}
+%    \end{macrocode}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \section{And finally \dots}\label{test}
+%
+%    If the embedded \cs{RequireVersions}
+%    data in a \lat/ document is extracted to a separate file, and
+%\begin{verbatim}
+%\RequirePackage[test]{snapshot}
+%\end{verbatim}
+%    is added at the top, then the file can be run as a small separate
+%    \LaTeX{} job that will, among other things, produce in the log file
+%    a nice list of fully resolved file names\mdash sort of a limited,
+%    but system-independent variant of the \fn{kpsewhich} idea.
+%    \begin{macrocode}
+\ifx\snap at intest\@gobbletwo \endinput \fi
+%    \end{macrocode}
+%
+%    Some old, ill-behaved packages might throw in a \cs{makeatother} at
+%    the end which can cause problems for the next file that comes along
+%    when testing.
+%    \begin{macrocode}
+\def\restore at some@catcodes{}
+\def\save at some@catcodes{%
+  \edef\restore at some@catcodes{%
+    \catcode\number`\@=\number\catcode`\@
+    \catcode\number`\"=\number\catcode`\"
+    \catcode\number`\^=\number\catcode`\^
+    \catcode\number`\_=\number\catcode`\_
+    \relax
+  }%
 }
 %    \end{macrocode}
 %
+%    Some typical calls of \cs{snap at intest}:
+%\begin{verbatim}
+% \snap at intest{LaTeX2e}{\snapx at format}
+% \snap at intest{snapshot}{\snapx at package}
+% \snap at intest{mcom-l}{\snapx at class}
+% \snap at intest{amsmath}{\snapx at package}
+% \snap at intest{umsa.fd}{\snapx at file}
+% \snap at intest{pictex}{\snapx at file}
+%\end{verbatim}
+%
+%    The extant public versions of the following files (in the teTeX
+%    distribution, at least) are known to be problematic when we are
+%    trying to read a \cs{ProvidesWhatever} line from the top of the
+%    file: psfig.sty, pictex.sty, pictex.tex, epic.sty, amstex.sty,
+%    xy.tex. Either (a) they don't have a \cs{ProvidesWhatever} line at
+%    all, or (b) they include some code before the \cs{ProvidesWhatever}
+%    line that makes some assumption true in normal processing but false
+%    in snapshot-test processing. E.g., there is code in \fn{amstex.sty}
+%    that assumes \cs{documentstyle} or \cs{documentclass} was already
+%    executed and that the \cs{if at compatibility} switch got set
+%    accordingly.
+%
 %    \begin{macrocode}
-\def\@pr at videpackage[#1]{%
-  \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}%
-  \ifx\@currext\@clsextension
-    \typeout{Document Class: \@gtempa\space#1}%
+\def\snap at intest#1#2{%
+  \message{^^J}%
+  \begingroup \edef\0{#1#2}\def\9{latex209.def}%
+  \ifx\0\9\global\@compatibilitytrue \fi
+  \ifx#2\snapx at format
+%    \end{macrocode}
+%    If arg1 + arg2 = ``LaTeX2e.fmt'', the calling function
+%    \cs{snap at storeb} will run \cs{snap at check} separately.
+%    This is a crude way of making things work in that case without
+%    much extra trouble.
+%    \begin{macrocode}
+    \def\snap at test@abort{\endgroup}%
   \else
-    \wlog{Package: \@gtempa\space#1}%
+    \edef\N{%
+      \noexpand\snap at intest@b{#1#2}%
+        {#1}{\@xp\@gobble#2\@empty}%
+        {\csname rqv@#1#2\endcsname}}%
+    \expandafter\endgroup\N
   \fi
-  \snap at check{\@currname.\@currext}%
 }
 %    \end{macrocode}
 %
+%    \begin{macrocode}
+\def\snap at intest@b#1#2#3#4{%
+  \def\@currname{#2}\def\@currext{#3}%
+  \begingroup \lccode`\/=`\0\relax\lowercase{\endgroup
+  \ifnum\snap at seldate#4 00 0\@nil>\z@
+    }% matches \lowercase
+    \save at some@catcodes
+    \@@input #1 \relax
+    \restore at some@catcodes
+  \else
+    \snap at specialtest{#1}{#4}%
+  \fi
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\snap at specialtest#1#2{%
+  \fake at input{#1}%
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\fake at input#1{%
+  \begingroup
+  % Ensure that outer \foo or unmatched braces don't trip us up
+  \catcode`\\=12 \catcode`\{=12 \catcode`\}=12
+  \endinput
+%    \end{macrocode}
+%    Note that these definitions of \cs{G} and \cs{?} are local, and
+%    recall that one-letter cs names don't use up hash table entries.
+%    \begin{macrocode}
+  \def\G{\@car\endgroup}%
+  \expandafter\futurelet\expandafter\?\expandafter\G\@@input#1 \relax\@nil
+}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\let\snap at test@abort=\endinput
+\let\snap at selfcheck=\@empty
+%    \end{macrocode}
+%
+%    There's an extra close-brace left hanging around at the end, but I
+%    guess we don't care.
+%    \begin{macrocode}
+\def\snap at finish{%%
+  \endgroup \message{^^J}%
+  \def\X##1{##1,\X}%
+  \edef\@filelist{\@xp\X\rqv at list{\@gobbletwo}}%
+  \def\X##1,?{##1}\edef\@filelist{\@xp\X\@filelist ?}%
+  \@dofilelist
+  \@@end
+}%
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\def\snap at mismatch#1#2#3{}
+%    \end{macrocode}
+%
+%    Problematic: xy.sty, because it calls xy.tex before it calls
+%    \cs{ProvidesPackage}. And pictex.tex because it doesnt use
+%    \cs{ProvidesFile} at all.
+%    \begin{macrocode}
+\renewcommand{\RequireVersions}[2][]{%
+  \begingroup
+  \makeatletter
+  \def\snap at check{\snap at compare@versions}%%
+  \let\snapx at tfm=\snap at ignore
+%    \end{macrocode}
+%    This seems to help, with english.ldf for example, to prevent an
+%    endless loop when attempting to load babel.def.
+%    \begin{macrocode}
+  \def\ProvidesLanguage##1{\ProvidesFile{##1.ldf}}%
+  \iffalse{\fi \futurelet\@let at token\snap at branch #2}%
+  \endgroup
+}
+%    \end{macrocode}
+%
 %    The usual \cs{endinput} to ensure that random garbage at the end of
 %    the file doesn't get copied by \fn{docstrip}.
 %    \begin{macrocode}
@@ -786,22 +1293,5 @@
 \endinput
 %    \end{macrocode}
 %
-% \section*{To Do}
-%
-% \begin{itemize}
-% \item Provide a test to distinguish between shared-use files and
-%    document-specific files? Document-specific files would be things
-%    like graphics files loaded via \cs{includegraphics} or book
-%    chapters loaded via \cs{include}. But there might also be something
-%    like \verb'\input{my-book-macros}' in the preamble. Maybe authors
-%    should be encouraged to put this after \verb'\begin{document}'? Or,
-%    even, after \verb'\begin{abstract}' so that the abstract will
-%    contain only lowest-common-denominator \LaTeX{} commands?
-%
-%    The non-document-specific files most commonly loaded after
-%    \verb'\begin{document}' would be \fn{.fd} files, but there is also
-%    the possibility of autoloaded stuff (\fn{alatex} format).
-% \end{itemize}
-%
-% \CheckSum{777}
+% \CheckSum{1209}
 % \Finale

Modified: trunk/Master/texmf-dist/source/latex/snapshot/snapshot.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/snapshot/snapshot.ins	2019-09-18 21:53:06 UTC (rev 52114)
+++ trunk/Master/texmf-dist/source/latex/snapshot/snapshot.ins	2019-09-18 21:56:20 UTC (rev 52115)
@@ -1,12 +1,77 @@
-% Normal installation of this package in a standard TDS texmf tree:
-% Put snapshot.sty into the directory texmf/tex/latex/misc.
-% Put snapshot.dvi (produced by running LaTeX on snapshot.dtx) into
-% texmf/doc/latex/misc.
+%% filename: snapshot.ins
+%% version: 1.00
+%% date: 2010/08/13
+%%
+%% American Mathematical Society
+%% Technical Support
+%% Publications Technical Group
+%% 201 Charles Street
+%% Providence, RI 02904
+%% USA
+%% tel: (401) 455-4080
+%%      (800) 321-4267 (USA and Canada only)
+%% fax: (401) 331-3842
+%% email: tech-support at ams.org
+%% 
+%% Copyright 2010 American Mathematical Society.
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This work has the LPPL maintenance status `maintained'.
+%% 
+%% The Current Maintainer of this work is the American Mathematical
+%% Society.
+%%
+%% ====================================================================
 
-\def\batchfile{snapshot.ins}
-\input docstrip.tex
+\input docstrip
+
+\askforoverwritefalse
+
+\keepsilent
+
 \preamble
+
+Copyright 2001, 2004, 2006, 2007, 2010, 2012 American Mathematical Society.
+
+American Mathematical Society
+Technical Support
+Publications Technical Group
+201 Charles Street
+Providence, RI 02904
+USA
+tel: (401) 455-4080
+     (800) 321-4267 (USA and Canada only)
+fax: (401) 331-3842
+email: tech-support at ams.org
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3c
+of this license or (at your option) any later version.
+The latest version of this license is in
+  http://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is the American Mathematical
+Society.
+
 \endpreamble
-\keepsilent
+
+\usedir{tex/latex/snapshot}
+
+\generate{%
+    \file{snapshot.sty}{\from{snapshot.dtx}{}}
+}
+
 \generateFile{snapshot.sty}{f}{\from{snapshot.dtx}{}}
-\endinput
+
+\endbatchfile

Modified: trunk/Master/texmf-dist/tex/latex/snapshot/snapshot.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/snapshot/snapshot.sty	2019-09-18 21:53:06 UTC (rev 52114)
+++ trunk/Master/texmf-dist/tex/latex/snapshot/snapshot.sty	2019-09-18 21:56:20 UTC (rev 52115)
@@ -6,51 +6,70 @@
 %%
 %% snapshot.dtx 
 %% 
-%%% ====================================================================
-%%%  @LaTeX-doc-source-file{
-%%%     filename        = "snapshot.dtx",
-%%%     version         = "1.14",
-%%%     date            = "2002/03/05",
-%%%     time            = "15:29:00 EST",
-%%%     checksum        = "39090 807 3449 29761",
-%%%     author          = "American Mathematical Society",
-%%%     copyright       = "Copyright 2001 American Mathematical Society,
-%%%                        all rights reserved.  Copying of this file is
-%%%                        authorized only if either:
-%%%                        (1) you make absolutely no changes to your copy,
-%%%                        including name; OR
-%%%                        (2) if you do make changes, you first rename it
-%%%                        to some other name.",
-%%%     address         = "American Mathematical Society,
-%%%                        Electronic Products and Services,
-%%%                        PO Box 6248,
-%%%                        Providence, RI 02940,
-%%%                        USA",
-%%%     email           = "tech-support at ams.org",
-%%%     URL             = "http://www.ams.org/",
-%%%     supported       = "yes",
-%%%     keywords        = "version, compatibility, dependencies, LaTeX",
-%%%     abstract        = "This package provides a way for a LaTeX
-%%%                        document to specify, for each external file
-%%%                        on which the document depends, which version
-%%%                        is required to guarantee output fidelity.",
-%%%     docstring       = "The checksum field above contains a CRC-16
-%%%                        checksum as the first value, followed by the
-%%%                        equivalent of the standard UNIX wc (word
-%%%                        count) utility output of lines, words, and
-%%%                        characters.  This is produced by Robert
-%%%                        Solovay's checksum utility.",
-%%%  }
-%%% ====================================================================
+%% Copyright 2001, 2004, 2006, 2007, 2010, 2012 American Mathematical Society.
+%% 
+%% American Mathematical Society
+%% Technical Support
+%% Publications Technical Group
+%% 201 Charles Street
+%% Providence, RI 02904
+%% USA
+%% tel: (401) 455-4080
+%%      (800) 321-4267 (USA and Canada only)
+%% fax: (401) 331-3842
+%% email: tech-support at ams.org
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This work has the LPPL maintenance status `maintained'.
+%% 
+%% The Current Maintainer of this work is the American Mathematical
+%% Society.
+%% 
 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{snapshot}[2002/03/05 v1.14]
-\let\@xp\expandafter \let\@nx\noexpand
-\newcommand{\RequireVersions}[2][]{%
-  \let\snap at check\snap at compare@versions
-  \let\snap at selfcheck\snap at selfcheck@a
-  \@ifnextchar *\snap at store@version\snap at store@error#2*{end}{}{}%
+\ProvidesPackage{snapshot}[2012/08/06 v2.13]
+\let\@xp=\expandafter \let\@nx=\noexpand
+\def\str at cmp#1#2\str at cmp#3{%
+  \if #1#3\else F\@car\fi \str at cmp#2\str at cmp
 }
+\def\string at equal#1#2{%
+  \str at cmp#1\relax\str at cmp#2{\relax\@gobbletwo}\@nil TT%
+}
+\newcommand{\RequireVersions}[2][]{}%
+\renewcommand{\RequireVersions}[1][]{%
+  \def\snap at check{\snap at compare@versions}%
+  \toks@{#1}\afterassignment\snap at storem
+  \let\@let at token=
+}
+\def\snap at storem{%
+  \ifx\@let at token\bgroup
+  \else
+    \PackageError{snapshot}{Expected a `\@charlb' character here}\@ehc
+    \@xp\@gobblefour
+  \fi
+  \futurelet\@let at token\snap at branch
+}
 \@onlypreamble\RequireVersions
+\let\snap at check\@gobble
+\def\snap at finish{\toks@\bgroup}
+\def\snap at branch{%
+  \ifx\@let at token\egroup
+    \@xp\snap at finish
+  \else\ifx\@let at token *%
+    \let\reserved at c\snap at store@version
+  \else\ifx\@let at token\@sptoken
+    \lowercase{\def\reserved at c} {\futurelet\@let at token\snap at branch}%
+  \else
+    \let\reserved at c\snap at store@error
+  \fi\fi\fi
+  \reserved at c
+}
 \def\snap at store@error#1{%
   \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc
 }
@@ -59,6 +78,37 @@
   \@xp\snap at store@b\csname snapx@#2\endcsname{#2}{#3}{#4}%
 }
 \@onlypreamble\snap at store@version
+\ifx\OmegaVersion\@@undefined
+\else
+  \edef\snapshotApplication{%
+    {Omega}\space\space\space
+    {0000/00/00 v\OmegaVersion}%
+  }%
+\fi
+\ifx\eTeXversion\@@undefined
+\else
+  \edef\snapshotApplication{%
+    {eTeX}\space\space\space\space
+    {0000/00/00 v\number\eTeXversion\eTeXrevision}%
+  }%
+\fi
+\ifx\pdftexversion\@@undefined
+\else
+  \edef\snapshotApplication{%
+    \ifx\eTeXversion\@@undefined
+      {pdfTeX}\space\space
+    \else
+      {pdfeTeX}\space
+    \fi
+      {0000/00/00 v0.\number\pdftexversion\pdftexrevision}%
+  }%
+\fi
+\@ifundefined{snapshotApplication}{%
+  \edef\snapshotApplication{%
+    {TeX}\space\space\space\space\space
+    {1990/03/25 v3.x}%
+  }%
+}{}
 \def\@fmtextension{fmt}
 \def\@tfmextension{tfm}
 \edef\snapx at package{.\@pkgextension}
@@ -65,28 +115,31 @@
 \edef\snapx at class{.\@clsextension}
 \edef\snapx at format{.\@fmtextension}
 \edef\snapx at tfm{.\@tfmextension}
-\long\def\snapx at application{}
-\let\snap at file=\@empty
+\long\def\snapx at ignore{}
+\let\snapx at application=\snapx at ignore
+\let\snapx at file=\@empty
 \let\snapx at end\@@end
+\expandafter\let\csname snapx at -------\endcsname\snapx at end
 \def\snap at store@b#1#2#3#4{%
   \ifx#1\snapx at end
-    \@xp\@gobblefour
+    \@xp\snap at finish
   \else
     \ifx#1\relax \let#1\@empty\fi
     \def\@tempa##1 ##2 ##3\@nil{##1 ##2}%
     \ifx#1\snapx at application
+      \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}%
     \else
-      \xdef\rqv at list{\rqv at list
-        \ifx\@empty\rqv at list\else,\fi
-        #3#1%
-      }%
+      \xdef\rqv at list{\rqv at list{#3#1}}%
+      \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}%
+      \snap at intest{#3}{#1}%
+      \ifx#1\snapx at format \snap at check{#3.fmt}%
+      \else
+        \edef\@tempa{\@nx\string at equal{snapshot.sty}{#3#1}}%
+        \if\@tempa \snap at selfcheck \fi
+      \fi
     \fi
-    \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}%
-    \ifx#1\snapx at format \snap at check{#3.fmt}%
-    \else \snap at selfcheck{#3.sty}%
-    \fi
   \fi
-  \@ifnextchar *\snap at store@version\snap at store@error
+  \futurelet\@let at token\snap at branch
 }
 \@onlypreamble\snap at store@b
 \def\snap at write{\immediate\write\snap at out}
@@ -97,10 +150,8 @@
 \DeclareOption{log}{%
   \let\snap at write\typeout
 }
-\let\snap at fake@b\relax
-\DeclareOption{test}{%
-  \def\snap at fake@b{\endinput \futurelet\@let at token\snap at ignoline}%
-}
+\let\snap at intest=\@gobbletwo
+\DeclareOption{test}{\def\snap at intest{True}}
 \DeclareOption{tfm}{%
   \typeout{Option 'tfm' not implemented yet [1999/09/23]}%
 }
@@ -108,17 +159,20 @@
 \def\snap at mismatch{\snap at mismatch@warning}
 \DeclareOption{error}{%
   \def\snap at mismatch{\PackageError}%
+  \def\snap at selfcheck{\snap at selfcheck@a}%
   \ifx\snap at select\@empty \let\snap at select\snap at select@all \fi
 }
 \DeclareOption{warning}{%
   \def\snap at mismatch{\snap at mismatch@warning}%
+  \def\snap at selfcheck{\snap at selfcheck@a}%
   \ifx\snap at select\@empty \let\snap at select\snap at select@all \fi
 }
 \def\snap at select@all#1#2 #3#4 #5\@nil{#1#2 #3#4}
 \let\snap at select\@empty
-\DeclareOption{date}{%
-  \def\snap at select#1#2 #3\@nil{#1#2}%
-}
+\def\snap at seldate#1#2 #3\@nil{#1#2}%
+\def\snap at selversion#1#2 #3{\snap at select@version #3}%
+\def\snap at selmajor#1#2 #3{\snap at select@major #3}%
+\DeclareOption{date}{\let\snap at select=\snap at seldate}
 \def\snap at select@version#1{%
   \ifodd 0#11 \@xp\snap at sva\@xp#1\else\@xp\snap at select@version\fi
 }
@@ -127,13 +181,26 @@
   \ifodd 0#11 \@xp\snap at svm\@xp#1\else\@xp\snap at select@major\fi
 }
 \def\snap at svm#1.#2\@nil{#1}
-\DeclareOption{version}{%
-  \def\snap at select#1#2 #3{\snap at select@version #3}%
+\DeclareOption{version}{\let\snap at select\snap at selversion}
+\DeclareOption{major-version}{\let\snap at select\snap at selmajor}
+\def\snap at bbinfo{01}
+\DeclareOption{bbinfo}{\def\snap at bbinfo{00}}
+\let\snap at splitter=?
+\AtBeginDocument{%
+  \xdef\@filelist{\@filelist\snap at splitter}%
 }
-\DeclareOption{major-version}{%
-  \def\snap at select#1#2 #3{\snap at select@major #3}%
+\let\snap at selfcheck\@empty
+\let\snap at selfcheck@a\@empty
+\DeclareOption{self-warning}{%
+  \def\snap at selfcheck{%
+    \begingroup
+    \def\snap at mismatch{\snap at mismatch@warning}%
+    \snap at selfcheck@a
+    \endgroup
+  }
 }
-\ProcessOptions\par
+\ExecuteOptions{warning}
+\ProcessOptions\relax
 \edef\snap at restore@extensions{%
   \def\@nx\@pkgextension{\@pkgextension}%
   \def\@nx\@clsextension{\@clsextension}%
@@ -157,42 +224,29 @@
   }%
 \fi
 \listfiles
-\def\@dofilelist{%
-  \snap at restore@extensions
-  \ifx\rqv at list\@empty
-  \else \rqv at compare@lists
-  \fi
-  \ifx\snap at write\typeout
+\def\snap at doit#1{%
+  \begingroup
+  \ifx\delimiter#1\delimiter
   \else
-    \newwrite\snap at out
-    \immediate\openout\snap at out=\jobname.dep \relax
-  \fi
-  \snap at write{\string\RequireVersions\@charlb}%
-  \snap at write{\space\space *{application}{TeX}%
-             \space\space\space\space\space{1990/03/25 v3.x}}%
-  \@for\@currname:=\@filelist\do{%
-    \filename at parse\@currname
+    \filename at parse{#1}%
+    \let\@tempd\@empty
     \ifx\filename at ext\relax
-      \def\@tempa{file}\def\@tempd{.tex}\def\filename at ext{tex}%
-      \def\@tempb{~~~}%
+      \def\@tempa{file}\def\@tempb{~~~}%
     \else\ifx\filename at ext\@pkgextension
-      \def\@tempa{package}\let\@tempd\@empty
-      \def\@tempb{}%
+      \def\@tempa{package}\let\@tempb\@empty
     \else\ifx\filename at ext\@clsextension
-      \def\@tempa{class}\let\@tempd\@empty
-      \def\@tempb{~~}%
+      \def\@tempa{class}\def\@tempb{~~}%
     \else\ifx\filename at ext\@fmtextension
-      \def\@tempa{format}\let\@tempd\@empty
-      \def\@tempb{~}%
+      \def\@tempa{format}\def\@tempb{~}%
     \else\ifx\filename at ext\@tfmextension
-      \def\@tempa{tfm}\let\@tempd\@empty
-      \def\@tempb{~~~~}%
+      \def\@tempa{tfm}\def\@tempb{~~~~}%
     \else
       \def\@tempa{file}\edef\@tempd{.\filename at ext}%
       \def\@tempb{~~~}%
     \fi\fi\fi\fi\fi
     \@xp\let\@xp\@tempe
-      \csname ver@\filename at base.\filename at ext\endcsname
+      \csname ver@\filename at base %
+        \ifx\filename at ext\relax\else.\filename at ext\fi\endcsname
     \ifx\@tempe\@empty \let\@tempe\relax \fi
     \edef\@tempe{%
       \ifx\@tempe\relax 0000/00/00 v0.0%
@@ -202,10 +256,65 @@
     }%
     \edef\@tempc{\filename at area\filename at base\@tempd}% full file name
     \@xp\snap at pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd
-    \begingroup \let~\space
-      \snap at write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}%
-    \endgroup
+    \let~\space
+    \snap at write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}%
+  \fi
+  \aftergroup\snap at doit
+  \endgroup
+}%
+\def\snap at bracify#1#2,{%
+  \ifx\@empty#1\expandafter\@gobble\else {#1#2}\fi \snap at bracify
+}
+\def\snap at splitter@a{%
+  \iffalse{{\fi }}% close current file name, end definition
+  \xdef\specific at files{%
+    \iffalse}\fi
+    \specific at files
+    \expandafter\@gobble\string % discard one closing brace
+}
+\def\snap at fdcheck#1{%
+  \ifx\delimiter#1\@xp\@gobble
+  \else\snap at fda#1\@empty.fd\@empty ?\@nil
+  \fi
+  \snap at fdcheck
+}
+\def\snap at fda#1.fd\@empty#2#3\@nil{%
+  \if ?#2%
+    \xdef\specific at files{\specific at files {#1}}%
+  \else
+    \xdef\general at files{\general at files {#1.fd}}%
+  \fi
+}
+\let\general at files\@empty
+\let\specific at files\@empty
+\newcommand{\SpecialInput}[1]{%
+  \xdef\specific at files{\specific at files{#1}}%
+  \@@input#1\relax
+}
+\def\@dofilelist{%
+  \snap at restore@extensions
+  \xdef\general at files{\@xp\snap at bracify \@filelist \@empty,\@empty,}%
+  \let\snap at splitter\snap at splitter@a
+  \xdef\general at files{\general at files}%
+  \let\@tempa\specific at files \global\let\specific at files\@empty
+  \@xp\snap at fdcheck\@tempa{\delimiter}%
+  \ifx\rqv at list\@empty
+  \else \rqv at compare@lists
+  \fi
+  \ifx\snap at write\typeout
+  \else
+    \newwrite\snap at out
+    \immediate\openout\snap at out=\jobname.dep \relax
+  \fi
+  \snap at write{\string\RequireVersions\@charlb}%
+  \snap at write{\space\space *{application}%
+    \snapshotApplication
   }%
+  \@xp\snap at doit\general at files{\delimiter\aftergroup\@gobble\@gobble}%
+  \ifx\specific at files\@empty
+  \else
+    \snap at specific
+  \fi
   \snap at write{\@charrb}%
   \ifx\snap at write\typeout
   \else \immediate\closeout\snap at out
@@ -212,71 +321,49 @@
     \typeout{Dependency list written on \jobname.dep.}%
   \fi
 }%
-\def\rqv at condense#1,{%
-  \if ,#1,%
+\def\snap at specific{%
+  \snap at write{ \space *{-------}{Document-specific files:}{----}}%
+  \@xp\snap at doit\specific at files{\delimiter\aftergroup\@gobble\@gobble}%
+}
+\def\rqv at condense#1{%
+  \@xp\ifx\csname ver@#1\endcsname\N
   \else
-    \@xp\ifx\csname ver@#1\endcsname\N
-    \else
-      \edef\L{\L,#1}%
-      \@xp\let\csname ver@#1\endcsname=\N
-    \fi
+    \edef\L{\L{#1}}%
+    \@xp\let\csname ver@#1\endcsname=\N
   \fi
   \rqv at condense
 }
+\def\rqv at condend{\endcsname ?\fi
+  \@xp\@xp\@xp\@gobbletwo\csname @xp\iftrue}
+\def\rqv at overloaded#1{%
+  \snap at mismatch{snapshot}{^^J%
+    File #1 loaded though not in \noexpand\RequireVersions list%
+  }\@ehc
+}
+\def\rqv at notloaded#1{%
+  \snap at mismatch{snapshot}{^^J%
+    File #1 [\csname rqv@#1\endcsname] required but not loaded%
+  }\@ehc
+}
+\def\rqv at set#1{\@xp\let\csname ver@#1\endcsname\N \rqv at set}
+\def\rqv at test#1{\csname ver@#1\endcsname{#1}\rqv at test}
 \def\rqv at compare@lists{%
   \begingroup
-  \def\N{1}\let\L=\@gobble
-  \@xp\rqv at condense \rqv at list,TeX,{,\relax\@xp\@gobbletwo\@xp},%
-  \ifx\L\@gobble\let\L\@empty\fi
-  \let\rqv at list=\L
-  \let\L=\@gobble
-  \@xp\rqv at condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},%
-  \ifx\L\@gobble\let\L\@empty\fi
-  \@for\@currname:=\L\do{%
-    \snap at mismatch{snapshot}{^^J%
-      File \@currname\space loaded though not in
-      \noexpand\RequireVersions list%
-    }\@ehc
-  }%
-  \def\N{2}\let\L=\@gobble
-  \@xp\rqv at condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},%
-  \let\L=\@gobble
-  \@xp\rqv at condense\rqv at list,{,\relax\@xp\@gobbletwo\@xp},%
-  \ifx\L\@gobble\let\L\@empty\fi
-  \@for\@currname:=\L\do{%
-    \snap at mismatch{snapshot}{^^J%
-      File \@currname\space [\csname rqv@\@currname\endcsname]
-      required but not loaded%
-    }\@ehc
-  }%
+  \def\N{1}\let\L\@empty
+  \@xp\rqv at condense\rqv at list\rqv at condend
+  \global\let\rqv at list=\L
+  \def\N{2}\let\L\@empty
+  \@xp\rqv at condense\general at files\rqv at condend
+  \global\let\general at files=\L
+  \def\T{\@firstoftwo{\endcsname\@empty\@gobbletwo}}%
+  \let\N\rqv at overloaded \@xp\rqv at set\general at files \T
+  \let\N\@gobble \@xp\rqv at set\rqv at list \T
+  \@xp\rqv at test\general at files{\endcsname\csname @gobbletwo}%
+  \let\N\rqv at notloaded \@xp\rqv at set\rqv at list \T
+  \let\N\@gobble \@xp\rqv at set\general at files \T
+  \@xp\rqv at test\rqv at list{\endcsname\csname @gobbletwo}%
   \endgroup
 }
-\begingroup \catcode\endlinechar=12\relax %
-\long\gdef\snap at ignoline#1
-{}\endgroup %
-\def\snap at fake@input#1#2#3#4{%
-  \ifx#1\snapx at end
-    \aftergroup\@@end \@xp\@gobblefour
-  \else
-    \ifx#1\snapx at format
-    \else
-      \message{^^J}%
-      \@xp\snap at fake@b\@@input #3#1\relax
-    \fi
-  \fi
-  \@ifnextchar *\snap at store@version\snap at store@error
-}
-\newcommand{\rqvTest}[2][]{%
-  \begingroup \catcode\endlinechar=12
-  \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax
-  \let\snapx at application=\snapx at format \let\snapx at tfm=\snap at format
-  \@ifnextchar *\snap at store@version\snap at store@error#2*{end}{}{}%
-  \endgroup
-}
-\@ifundefined{snap at fake@b}{}{%
-  \let\snap at store@b\snap at fake@input
-  \let\RequireVersions\rqvTest
-}
 \AtBeginDocument{%
   \@ifundefined{ver at amsgen}{}{%
     \@xp\let\csname ver at amsgen.sty\@xp\endcsname
@@ -283,18 +370,47 @@
                     \csname ver at amsgen\endcsname
   }%
 }
-\let\snap at compare@versions\@gobble \let\snap at check\@gobble
-\let\snap at selfcheck\@gobble \let\snap at selfcheck@a\@gobble
-\ifx\snap at select\@empty \endinput \fi
-\begingroup \catcode`\.=11\relax
-\gdef\snap at selfcheck@b#1\rqv at snapshot.sty#2#3\@nil{T#2}
-\gdef\snap at selfcheck@a#1{%
-  \if\@xp\snap at selfcheck@b\csname rqv@#1\endcsname T%
-         \rqv at snapshot.sty F\@nil
-    \snap at check{#1}%
+\def\ProvidesFile#1{%
+  \def\snap at checker{\snap at check{#1}}%
+  \begingroup
+    \aftergroup\snap at checker
+    \catcode`\ 10
+    \ifnum\endlinechar < 256
+        \ifnum \endlinechar>\m at ne
+            \catcode\endlinechar 10
+        \fi
+    \fi
+    \@makeother\/%
+    \@makeother\&%
+    \kernel at ifnextchar[{\snap at providesfile{#1}}{\snap at providesfile{#1}[]}%
+}
+\def\snap at graphic@test#1#2#3\@nil{r\if G#1#2\else X\fi}
+\def\snap at providesfile#1[#2]{%
+  \wlog{File: #1 #2}%
+  \if\snap at graphic@test#2@@\@nil
+    \snap at record@graphic#1\relax #2 (type ??)\@nil
+  \else
+    \expandafter\xdef\csname ver@#1\endcsname{#2}%
   \fi
+  \endgroup
 }
-\endgroup
+\def\snap at record@graphic#1\relax #2(type #3)#4\@nil{%
+  \expandafter\xdef\csname ver@#1\endcsname{%
+    Graphic%
+    \if\snap at bbinfo :bb=\Gin at llx/\Gin at lly/\Gin at urx/\Gin at ury\fi
+    \space v0.0%
+  }%
+}
+\def\@pr at videpackage [#1]{%
+  \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}%
+  \ifx\@currext\@clsextension
+    \typeout{Document Class: \@gtempa\space#1}%
+  \else
+    \wlog{Package: \@gtempa\space#1}%
+  \fi
+  \snap at check{\@currname.\@currext}%
+}
+\def\snap at selfcheck@a{\snap at check{snapshot.sty}}
 \def\@nofmt#1.fmt.#2 {#1 }
 \def\snap at mismatch@a#1#2#3{%
   \snap at mismatch{snapshot}{^^J%
@@ -317,25 +433,83 @@
       \fi
     }%
   \endgroup
+  \snap at test@abort
 }
-\def\ProvidesFile#1{%
-  \def\snap at checker{\snap at check{#1}}%
-  \begingroup
-    \aftergroup\snap at checker
-    \catcode`\ 10\catcode\endlinechar 10 %
-    \@makeother\/%
-    \@makeother\&%
-    \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}%
+\let\snap at test@abort=\@empty
+\ifx\snap at select\@empty
+  \let\snap at compare@versions\@gobble
+  \let\snap at check\@gobble
+\fi
+\providecommand{\controldates}[1]{}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ifx\snap at intest\@gobbletwo \endinput \fi
+\def\restore at some@catcodes{}
+\def\save at some@catcodes{%
+  \edef\restore at some@catcodes{%
+    \catcode\number`\@=\number\catcode`\@
+    \catcode\number`\"=\number\catcode`\"
+    \catcode\number`\^=\number\catcode`\^
+    \catcode\number`\_=\number\catcode`\_
+    \relax
+  }%
 }
-\def\@pr at videpackage[#1]{%
-  \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}%
-  \ifx\@currext\@clsextension
-    \typeout{Document Class: \@gtempa\space#1}%
+\def\snap at intest#1#2{%
+  \message{^^J}%
+  \begingroup \edef\0{#1#2}\def\9{latex209.def}%
+  \ifx\0\9\global\@compatibilitytrue \fi
+  \ifx#2\snapx at format
+    \def\snap at test@abort{\endgroup}%
   \else
-    \wlog{Package: \@gtempa\space#1}%
+    \edef\N{%
+      \noexpand\snap at intest@b{#1#2}%
+        {#1}{\@xp\@gobble#2\@empty}%
+        {\csname rqv@#1#2\endcsname}}%
+    \expandafter\endgroup\N
   \fi
-  \snap at check{\@currname.\@currext}%
 }
+\def\snap at intest@b#1#2#3#4{%
+  \def\@currname{#2}\def\@currext{#3}%
+  \begingroup \lccode`\/=`\0\relax\lowercase{\endgroup
+  \ifnum\snap at seldate#4 00 0\@nil>\z@
+    }% matches \lowercase
+    \save at some@catcodes
+    \@@input #1 \relax
+    \restore at some@catcodes
+  \else
+    \snap at specialtest{#1}{#4}%
+  \fi
+}
+\def\snap at specialtest#1#2{%
+  \fake at input{#1}%
+}
+\def\fake at input#1{%
+  \begingroup
+  % Ensure that outer \foo or unmatched braces don't trip us up
+  \catcode`\\=12 \catcode`\{=12 \catcode`\}=12
+  \endinput
+  \def\G{\@car\endgroup}%
+  \expandafter\futurelet\expandafter\?\expandafter\G\@@input#1 \relax\@nil
+}
+\let\snap at test@abort=\endinput
+\let\snap at selfcheck=\@empty
+\def\snap at finish{%%
+  \endgroup \message{^^J}%
+  \def\X##1{##1,\X}%
+  \edef\@filelist{\@xp\X\rqv at list{\@gobbletwo}}%
+  \def\X##1,?{##1}\edef\@filelist{\@xp\X\@filelist ?}%
+  \@dofilelist
+  \@@end
+}%
+\def\snap at mismatch#1#2#3{}
+\renewcommand{\RequireVersions}[2][]{%
+  \begingroup
+  \makeatletter
+  \def\snap at check{\snap at compare@versions}%%
+  \let\snapx at tfm=\snap at ignore
+  \def\ProvidesLanguage##1{\ProvidesFile{##1.ldf}}%
+  \iffalse{\fi \futurelet\@let at token\snap at branch #2}%
+  \endgroup
+}
 \endinput
 %%
 %% End of file `snapshot.sty'.



More information about the tex-live-commits mailing list