From 3c9b5c2960ae2455180bdb3a4e67bf10175b39af Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 12 Apr 2011 22:56:39 +0000
Subject: oberdiek (12apr11)

git-svn-id: svn://tug.org/texlive/trunk@22061 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/source/latex/oberdiek/auxhook.dtx   | 46 +++++++++++++++++-----
 1 file changed, 36 insertions(+), 10 deletions(-)

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

diff --git a/Master/texmf-dist/source/latex/oberdiek/auxhook.dtx b/Master/texmf-dist/source/latex/oberdiek/auxhook.dtx
index b5dadd8973d..be56a03798b 100644
--- a/Master/texmf-dist/source/latex/oberdiek/auxhook.dtx
+++ b/Master/texmf-dist/source/latex/oberdiek/auxhook.dtx
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 % 
-% Copyright (C) 2006, 2007, 2009 by
+% Copyright (C) 2006, 2007, 2009, 2011 by
 %    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
 % 
 % This work may be distributed and/or modified under the
@@ -71,7 +71,7 @@
 \input docstrip.tex
 \Msg{************************************************************************}
 \Msg{* Installation}
-\Msg{* Package: auxhook 2009/12/14 v1.2 Hooks for auxiliary files (HO)}
+\Msg{* Package: auxhook 2011/03/04 v1.3 Hooks for auxiliary files (HO)}
 \Msg{************************************************************************}
 
 \keepsilent
@@ -82,7 +82,7 @@
 
 This is a generated file.
 
-Copyright (C) 2006, 2007, 2009 by
+Copyright (C) 2006, 2007, 2009, 2011 by
    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
 
 This work may be distributed and/or modified under the
@@ -141,7 +141,7 @@ and the derived files
 %<*driver>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{auxhook.drv}%
-  [2009/12/14 v1.2 Hooks for auxiliary files (HO)]%
+  [2011/03/04 v1.3 Hooks for auxiliary files (HO)]%
 \documentclass{ltxdoc}
 \usepackage{holtxdoc}[2008/08/11]
 \begin{document}
@@ -150,7 +150,7 @@ and the derived files
 %</driver>
 % \fi
 %
-% \CheckSum{150}
+% \CheckSum{178}
 %
 % \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
@@ -171,7 +171,7 @@ and the derived files
 % \GetFileInfo{auxhook.drv}
 %
 % \title{The \xpackage{auxhook} package}
-% \date{2009/12/14 v1.2}
+% \date{2011/03/04 v1.3}
 % \author{Heiko Oberdiek\\\xemail{heiko.oberdiek at googlemail.com}}
 %
 % \maketitle
@@ -252,7 +252,7 @@ and the derived files
 %<*package>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{auxhook}%
-  [2009/12/14 v1.2 Hooks for auxiliary files (HO)]%
+  [2011/03/04 v1.3 Hooks for auxiliary files (HO)]%
 %    \end{macrocode}
 %
 % \subsection{Hook setup}
@@ -270,14 +270,35 @@ and the derived files
 %    \end{macrocode}
 %    \end{macro}
 %
+%    \begin{macrocode}
+\ifx\AtBeginDocument\@firstofone
+  \global\let\@beginmainauxhook\relax
+\else
+  \g@addto@macro{\@beginmainauxhook}{%
+    \global\let\@beginmainauxhook\relax
+  }%
+\fi
+%    \end{macrocode}
+%
 % \subsection{User macros}
 %
 %    \begin{macro}{\AddLineBeginMainAux}
 %    \begin{macrocode}
 \newcommand{\AddLineBeginMainAux}[1]{%
-  \g@addto@macro\@beginmainauxhook{%
-    \immediate\write\@mainaux{#1}%
-  }%
+  \ifx\@beginmainauxhook\relax
+    \if@filesw
+      \PackageInfo{auxhook}{%
+        \@backslashchar AddLineBeginMainAux comes a little late,%
+        \MessageBreak
+        because the main .aux file is already opened%
+      }%
+      \immediate\write\@mainaux{#1}%
+    \fi
+  \else
+    \g@addto@macro\@beginmainauxhook{%
+      \immediate\write\@mainaux{#1}%
+    }%
+  \fi
 }
 %    \end{macrocode}
 %    \end{macro}
@@ -595,6 +616,11 @@ and the derived files
 %   \item
 %     Support for package \xpackage{rerunfilecheck} added (\cs{@include}).
 %   \end{Version}
+%   \begin{Version}{2011/03/04 v1.3}
+%   \item
+%     \cs{AddLineBeginMainAux} also supports write requests after
+%     the main \xext{aux} file is opened.
+%   \end{Version}
 % \end{History}
 %
 % \PrintIndex
-- 
cgit v1.2.3

