From b3a11ba60a021bc8ec849629e75c578fa2d0da62 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sat, 23 Apr 2011 22:42:42 +0000
Subject: oberdiek (23apr11)

git-svn-id: svn://tug.org/texlive/trunk@22180 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/source/latex/oberdiek/atveryend.dtx | 127 ++++++++++++---------
 1 file changed, 76 insertions(+), 51 deletions(-)

(limited to 'Master/texmf-dist/source/latex/oberdiek/atveryend.dtx')

diff --git a/Master/texmf-dist/source/latex/oberdiek/atveryend.dtx b/Master/texmf-dist/source/latex/oberdiek/atveryend.dtx
index e5cf0e2515c..1479518f2be 100644
--- a/Master/texmf-dist/source/latex/oberdiek/atveryend.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/atveryend.dtx
@@ -1,7 +1,7 @@
 % \iffalse meta-comment
 % 
 % File: atveryend.dtx
-% Version: 2011/04/15 v1.6
+% Version: 2011/04/23 v1.7
 % 
 % Copyright (C) 2009-2011 by
 %    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
@@ -76,7 +76,7 @@
 \input docstrip.tex
 \Msg{************************************************************************}
 \Msg{* Installation}
-\Msg{* Package: atveryend 2011/04/15 v1.6 Hooks at very end of document (HO)}
+\Msg{* Package: atveryend 2011/04/23 v1.7 Hooks at very end of document (HO)}
 \Msg{************************************************************************}
 
 \keepsilent
@@ -88,7 +88,7 @@
 This is a generated file.
 
 Project: atveryend
-Version: 2011/04/15 v1.6
+Version: 2011/04/23 v1.7
 
 Copyright (C) 2009-2011 by
    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
@@ -148,7 +148,7 @@ and the derived files
 %<*driver>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{atveryend.drv}%
-  [2011/04/15 v1.6 Hooks at very end of document (HO)]%
+  [2011/04/23 v1.7 Hooks at very end of document (HO)]%
 \documentclass{ltxdoc}
 \usepackage{holtxdoc}[2011/02/04]
 \begin{document}
@@ -157,7 +157,7 @@ and the derived files
 %</driver>
 % \fi
 %
-% \CheckSum{1065}
+% \CheckSum{1084}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -178,7 +178,7 @@ and the derived files
 % \GetFileInfo{atveryend.drv}
 %
 % \title{The \xpackage{atveryend} package}
-% \date{2011/04/15 v1.6}
+% \date{2011/04/23 v1.7}
 % \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}}
 %
 % \maketitle
@@ -334,9 +334,24 @@ and the derived files
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{atveryend}%
-  [2011/04/15 v1.6 Hooks at very end of document (HO)]
+  [2011/04/23 v1.7 Hooks at very end of document (HO)]
 %    \end{macrocode}
 %
+% \subsection{Tools}
+%
+%    \begin{macro}{\AtVeryEnd@ifundefined}
+%    \begin{macrocode}
+\def\AtVeryEnd@ifundefined#1{%
+  \begingroup\expandafter\expandafter\expandafter\endgroup
+  \expandafter\ifx\csname #1\endcsname\relax
+    \expandafter\@firstoftwo
+  \else
+    \expandafter\@secondoftwo
+  \fi
+}
+%    \end{macrocode}
+%    \end{macro}
+%
 % \subsection{Hooks}
 %
 %    \begin{macro}{\AtVeryEnd@BeforeClearDocumentHook}
@@ -879,53 +894,28 @@ and the derived files
 \AtVeryEnd@RedefEndDocument\old@enddocument % uwthesis.cls
 %    \end{macrocode}
 %
-% \subsection{Using hooks of other packages}
-%
-% \subsubsection{Package \xpackage{scrlfile}}
-%
-%    \begin{macrocode}
-\AtBeginDocument{%
-  \@ifpackageloaded{scrlfile}{%
-    \@ifundefined{BeforeClosingMainAux}{}{%
-      \BeforeClosingMainAux{\Call@AfterLastShipout}%
-    }%
-    \@ifundefined{AfterReadingMainAux}{}{%
-      \AfterReadingMainAux{\Call@AtVeryEndDocument}%
-    }%
-  }{}%
-%    \end{macrocode}
-%
-% \subsubsection{Package \xpackage{etoolbox}}
-%
-%    \begin{macrocode}
-  \@ifpackageloaded{etoolbox}{%
-    \@ifundefined{AfterEndDocument}{}{%
-      \AfterEndDocument{\Call@AtVeryEndDocument}%
-    }%
-  }{}%
-%    \end{macrocode}
-%
 % \subsection{Hack into \cs{enddocument}}
 %
 %    \begin{macrocode}
-  \def\AtVeryEnd@document{document}%
-  \def\AtVeryEnd@RedefCheckEnd{%
-    \expandafter\def\expandafter\@checkend
-    \expandafter##\expandafter1\expandafter{%
-      \@checkend{##1}%
-      \def\AtVeryEnd@temp{##1}%
-      \ifx\AtVeryEnd@temp\AtVeryEnd@document
-        \let\AtVeryEnd@OrgClearpage\clearpage
-        \def\clearpage{%
-          \let\clearpage\AtVeryEnd@OrgClearpage
-          \Call@BeforeClearDocument
-          \clearpage
-          \Call@AfterLastShipout
-        }%
-      \fi
-    }%
-    \aftergroup\AtVeryEnd@RedefCheckEnd
+\def\AtVeryEnd@document{document}%
+\def\AtVeryEnd@RedefCheckEnd{%
+  \expandafter\def\expandafter\@checkend
+  \expandafter##\expandafter1\expandafter{%
+    \@checkend{##1}%
+    \def\AtVeryEnd@temp{##1}%
+    \ifx\AtVeryEnd@temp\AtVeryEnd@document
+      \let\AtVeryEnd@OrgClearpage\clearpage
+      \def\clearpage{%
+        \let\clearpage\AtVeryEnd@OrgClearpage
+        \Call@BeforeClearDocument
+        \clearpage
+        \Call@AfterLastShipout
+      }%
+    \fi
   }%
+  \aftergroup\AtVeryEnd@RedefCheckEnd
+}%
+\AtBeginDocument{%
   \AtEndDocument{%
     \AtVeryEnd@RedefCheckEnd
   }%
@@ -952,6 +942,35 @@ and the derived files
 }
 %    \end{macrocode}
 %
+% \subsection{Using hooks of other packages}
+%
+% \subsubsection{Package \xpackage{scrlfile}}
+%
+%    \begin{macrocode}
+\AtBeginDocument{%
+  \@ifpackageloaded{scrlfile}{%
+    \AtVeryEnd@ifundefined{BeforeClosingMainAux}{}{%
+      \BeforeClosingMainAux{\Call@AfterLastShipout}%
+    }%
+    \AtVeryEnd@ifundefined{AfterReadingMainAux}{}{%
+      \AfterReadingMainAux{\Call@AtVeryEndDocument}%
+    }%
+  }{}%
+%    \end{macrocode}
+%
+% \subsubsection{Package \xpackage{etoolbox}}
+%
+%    \begin{macrocode}
+  \@ifpackageloaded{etoolbox}{%
+    \AtVeryEnd@ifundefined{AfterEndDocument}{}{%
+      \AfterEndDocument{\Call@AtVeryEndDocument}%
+    }%
+  }{}%
+%    \end{macrocode}
+%    \begin{macrocode}
+}
+%    \end{macrocode}
+%
 % \subsection{Class \xclass{letter}}
 %
 %    The class \xclass{letter} and some similar classes
@@ -1043,7 +1062,7 @@ and the derived files
     }%
   }%
   \AtEndDocument{%
-    \@ifundefined{@startlabels}{%
+    \AtVeryEnd@ifundefined{@startlabels}{%
     }{%
       \clearpage
       \@startlabels
@@ -1448,6 +1467,12 @@ and the derived files
 %   \item
 %     \cs{Call@AtEndAfterFileList} and \cs{Call@AtVeryVeryEnd} added.
 %   \end{Version}
+%   \begin{Version}{2011/04/23 v1.7}
+%   \item
+%     Some fix for \cs{AtVeryEnd@RedefCheckEnd}
+%     to avoid error because of undefined control sequence
+%     in some circumstances (thanks to D.P. Story for bug report).
+%   \end{Version}
 % \end{History}
 %
 % \PrintIndex
-- 
cgit v1.2.3

