texlive[56479] Master/texmf-dist: filehook (29sep20)

commits+karl at tug.org commits+karl at tug.org
Tue Sep 29 23:25:47 CEST 2020


Revision: 56479
          http://tug.org/svn/texlive?view=revision&revision=56479
Author:   karl
Date:     2020-09-29 23:25:46 +0200 (Tue, 29 Sep 2020)
Log Message:
-----------
filehook (29sep20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/filehook/filehook.pdf
    trunk/Master/texmf-dist/source/latex/filehook/filehook.dtx
    trunk/Master/texmf-dist/tex/latex/filehook/filehook-2019.sty
    trunk/Master/texmf-dist/tex/latex/filehook/filehook-2020.sty
    trunk/Master/texmf-dist/tex/latex/filehook/filehook.sty

Modified: trunk/Master/texmf-dist/doc/latex/filehook/filehook.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/filehook/filehook.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/filehook/filehook.dtx	2020-09-29 21:25:25 UTC (rev 56478)
+++ trunk/Master/texmf-dist/source/latex/filehook/filehook.dtx	2020-09-29 21:25:46 UTC (rev 56479)
@@ -26,10 +26,10 @@
 %<*driver>
 \ProvidesFile{filehook.dtx}[%
 %<=*DATE>
-    2020/09/27
+    2020/09/29
 %<=/DATE>
 %<=*VERSION>
-    v0.8
+    v0.8a
 %<=/VERSION>
     Hooks for input files]
 \documentclass{ydoc}
@@ -57,7 +57,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{1478}
+% \CheckSum{1494}
 %
 % \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
@@ -100,6 +100,8 @@
 % \changes{v0.5e}{2019/08/19}{Fix for new LaTeX format.}
 % \changes{v0.6}{2019/10/03}{Fix for InputIfFileExists for LaTeX format 2019/10/01.}
 % \changes{v0.7}{2020/02/03}{Further fixes for InputIfFileExists for LaTeX format 2019/10/01.}
+% \changes{v0.8}{2020/09/27}{Support for LaTeX format 2020/10/01.}
+% \changes{v0.8a}{2020/09/29}{Further fixes for LaTeX format 2020/10/01.}
 %
 % \GetFileInfo{filehook.dtx}
 %
@@ -114,9 +116,24 @@
 % execute code at begin or the end of specific or all input files.
 % \end{abstract}
 %
+% \section{Changes due to new \LaTeX\ core hooks}
+% With the \LaTeX\ release 2020/10/01 file hooks are now provided by the \LaTeX\ core. This package has been adjusted to use these hooks
+% while trying to provide the same interface and behaviour than before. Simpler usages should work without any differences but advanced
+% usages which rely on the exact hook order and position might see some unwanted changes.
+% Users should try to use the \LaTeX\ hooks instead for new documents.
+% Please see \LaTeX\ core filehook documentation
+% \href{http://mirrors.ctan.org/macros/latex-dev/base/ltfilehook-doc.pdf}{\texttt{ltfilehook-doc}} for
+% the new hook system.
 %
+% Support of other hooking systems in other packages and classes has been dropped as this package no longer installs own hooks.
+%
+% If this package is run under a \LaTeX\ release prior to 2020/10/01 the old implementation will be loaded.
+% For this switch two sub-packages \pkg{filehook-2019} and \pkg{filehook-2020} are used and loaded according to the \LaTeX\ release version.
+% Please do not load these packages directly as they might be changes or disappear on later releases.
+%
+%
 % \section{Introduction}
-% These package changes some internal \LaTeX{} macros used to load input files so that they include `hooks'.
+% These package (under \LaTeX\ prior 2020/10/01) changes some internal \LaTeX{} macros used to load input files so that they include `hooks'.
 % A hook is an (internal) macro executed at specific points. Normally it is initially empty, but can be extended using
 % an user level macro. The most common hook in \LaTeX{} is the `At-Begin-Document' hook. Code can be added to this hook
 % using \Macro\AtBeginDocument{<\TeX\ code>}.
@@ -528,7 +545,7 @@
 %
 % \subsection{Options}
 %    \begin{macrocode}
-\DeclareOption{force}{\PassOptionsToPackage{forse}{filehook-2019}}
+\DeclareOption{force}{\PassOptionsToPackage{force}{filehook-2019}}
 \ProcessOptions\relax
 %    \end{macrocode}
 %
@@ -547,7 +564,7 @@
 %    \begin{macrocode}
 %<!COPYRIGHT>
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{filehook-2019}[%
+\ProvidesPackage{filehook-2019}[% filehook subpackage, do not load directly
 %<!DATE>
 %<!VERSION>
 %<*DRIVER>
@@ -1353,7 +1370,7 @@
 %    \begin{macrocode}
 %<!COPYRIGHT>
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{filehook-2020}[%
+\ProvidesPackage{filehook-2020}[% filehook subpackage, do not load directly
 %<!DATE>
 %<!VERSION>
 %<*DRIVER>
@@ -1917,10 +1934,25 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\filehook at set@CurrentFile}
+%    \begin{macrocode}
+\def\filehook at set@CurrentFile{%
+    \edef\filehook at CurrentFile{%
+        \ifx\CurrentFilePath\empty
+        \else
+            \CurrentFilePath/%
+        \fi
+        \CurrentFile
+    }%
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\Hook}
 %    \begin{macrocode}
 \AddToHook{include/before}{%
-    \filehook at include@atbegin{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at include@atbegin{\filehook at CurrentFile}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -1928,7 +1960,8 @@
 % \begin{macro}{\Hook}
 %    \begin{macrocode}
 \AddToHook{include/end}{%
-    \filehook at include@atend{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at include@atend{\filehook at CurrentFile}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -1936,7 +1969,8 @@
 % \begin{macro}{\Hook}
 %    \begin{macrocode}
 \AddToHook{include/after}{%
-    \filehook at include@after{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at include@after{\filehook at CurrentFile}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -1973,9 +2007,10 @@
 % \begin{macro}{\Hook}
 %    \begin{macrocode}
 \AddToHook{file/before}{%
-    \filehook at every@atbegin{\CurrentFile}%
-    \filehook at istexfile\CurrentFile{\filehook at input@atbegin{\CurrentFile}}{}%
-    \filehook at atbegin{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at every@atbegin{\filehook at CurrentFile}%
+    \filehook at istexfile\filehook at CurrentFile{\filehook at input@atbegin{\filehook at CurrentFile}}{}%
+    \filehook at atbegin{\filehook at CurrentFile}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -1983,9 +2018,10 @@
 % \begin{macro}{\Hook}
 %    \begin{macrocode}
 \AddToHook{file/after}{%
-    \filehook at atend{\CurrentFile}%
-    \filehook at istexfile\CurrentFile{\filehook at input@atend{\CurrentFile}}{}%
-    \filehook at every@atend{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at atend{\filehook at CurrentFile}%
+    \filehook at istexfile\filehook at CurrentFile{\filehook at input@atend{\filehook at CurrentFile}}{}%
+    \filehook at every@atend{\filehook at CurrentFile}%
 }
 %    \end{macrocode}
 % \end{macro}

Modified: trunk/Master/texmf-dist/tex/latex/filehook/filehook-2019.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/filehook/filehook-2019.sty	2020-09-29 21:25:25 UTC (rev 56478)
+++ trunk/Master/texmf-dist/tex/latex/filehook/filehook-2019.sty	2020-09-29 21:25:46 UTC (rev 56479)
@@ -18,9 +18,9 @@
 %% and pgf-filehook.sty
 %%
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{filehook-2019}[%
-    2020/09/27
-    v0.8
+\ProvidesPackage{filehook-2019}[% filehook subpackage, do not load directly
+    2020/09/29
+    v0.8a
     Hooks for input files]
 \newif\iffilehook at force
 \DeclareOption{force}{\filehook at forcetrue}

Modified: trunk/Master/texmf-dist/tex/latex/filehook/filehook-2020.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/filehook/filehook-2020.sty	2020-09-29 21:25:25 UTC (rev 56478)
+++ trunk/Master/texmf-dist/tex/latex/filehook/filehook-2020.sty	2020-09-29 21:25:46 UTC (rev 56479)
@@ -18,9 +18,9 @@
 %% and pgf-filehook.sty
 %%
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{filehook-2020}[%
-    2020/09/27
-    v0.8
+\ProvidesPackage{filehook-2020}[% filehook subpackage, do not load directly
+    2020/09/29
+    v0.8a
     Hooks for input files]
 \DeclareOption{force}{}
 \ProcessOptions\relax
@@ -238,14 +238,26 @@
     \expandafter\filehook@@ensuretex#1\empty.tex\empty\empty
 }
 \def\filehook@@ensuretex#1.tex\empty#2\empty{#1.tex}
+\def\filehook at set@CurrentFile{%
+    \edef\filehook at CurrentFile{%
+        \ifx\CurrentFilePath\empty
+        \else
+            \CurrentFilePath/%
+        \fi
+        \CurrentFile
+    }%
+}
 \AddToHook{include/before}{%
-    \filehook at include@atbegin{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at include@atbegin{\filehook at CurrentFile}%
 }
 \AddToHook{include/end}{%
-    \filehook at include@atend{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at include@atend{\filehook at CurrentFile}%
 }
 \AddToHook{include/after}{%
-    \filehook at include@after{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at include@after{\filehook at CurrentFile}%
 }
 \begingroup
 \edef\dottex{\expandafter\expandafter\expandafter\@gobble\expandafter\string\csname.tex\endcsname}
@@ -266,14 +278,16 @@
 }
 \endgroup
 \AddToHook{file/before}{%
-    \filehook at every@atbegin{\CurrentFile}%
-    \filehook at istexfile\CurrentFile{\filehook at input@atbegin{\CurrentFile}}{}%
-    \filehook at atbegin{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at every@atbegin{\filehook at CurrentFile}%
+    \filehook at istexfile\filehook at CurrentFile{\filehook at input@atbegin{\filehook at CurrentFile}}{}%
+    \filehook at atbegin{\filehook at CurrentFile}%
 }
 \AddToHook{file/after}{%
-    \filehook at atend{\CurrentFile}%
-    \filehook at istexfile\CurrentFile{\filehook at input@atend{\CurrentFile}}{}%
-    \filehook at every@atend{\CurrentFile}%
+    \filehook at set@CurrentFile
+    \filehook at atend{\filehook at CurrentFile}%
+    \filehook at istexfile\filehook at CurrentFile{\filehook at input@atend{\filehook at CurrentFile}}{}%
+    \filehook at every@atend{\filehook at CurrentFile}%
 }
 \endinput
 %%

Modified: trunk/Master/texmf-dist/tex/latex/filehook/filehook.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/filehook/filehook.sty	2020-09-29 21:25:25 UTC (rev 56478)
+++ trunk/Master/texmf-dist/tex/latex/filehook/filehook.sty	2020-09-29 21:25:46 UTC (rev 56479)
@@ -19,10 +19,10 @@
 %%
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{filehook}[%
-    2020/09/27
-    v0.8
+    2020/09/29
+    v0.8a
     Hooks for input files]
-\DeclareOption{force}{\PassOptionsToPackage{forse}{filehook-2019}}
+\DeclareOption{force}{\PassOptionsToPackage{force}{filehook-2019}}
 \ProcessOptions\relax
 \@ifl at t@r\fmtversion{2020/10/01}{\RequirePackage{filehook-2020}}{\RequirePackage{filehook-2019}}
 \endinput



More information about the tex-live-commits mailing list.