summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/filehook
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-12-22 00:05:02 +0000
committerKarl Berry <karl@freefriends.org>2010-12-22 00:05:02 +0000
commit4d94830abaa19630ce446cf73cd5d2dca75dfc2f (patch)
tree17c98d7a44735f6845a3014e3a373a64b2fe2e67 /Master/texmf-dist/tex/latex/filehook
parentacc3b35eec6064cf6c468aeed3a19f83813dde8d (diff)
filehook (21dec10)
git-svn-id: svn://tug.org/texlive/trunk@20822 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/filehook')
-rw-r--r--Master/texmf-dist/tex/latex/filehook/filehook.sty57
1 files changed, 52 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/filehook/filehook.sty b/Master/texmf-dist/tex/latex/filehook/filehook.sty
index c7a632929e5..ba3aee1e82d 100644
--- a/Master/texmf-dist/tex/latex/filehook/filehook.sty
+++ b/Master/texmf-dist/tex/latex/filehook/filehook.sty
@@ -18,10 +18,13 @@
%% This work consists of the files filehook.dtx, filehook.ins
%% and the derived file filehook.sty.
%%
-%% $Id: filehook.dtx 1905 2010-12-08 18:57:34Z martin $
+%% $Id: filehook.dtx 1926 2010-12-20 23:11:20Z martin $
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{filehook}
- [2010/12/08 v0.2 Hooks for input files]
+ [2010/12/20 v0.3 Hooks for input files]
+\newif\iffilehook@force
+\DeclareOption{force}{\filehook@forcetrue}
+\ProcessOptions\relax
\let\filehook@orig@@input@\@input@
\let\filehook@orig@@iinput\@iinput
\def\@input@#1{%
@@ -111,9 +114,25 @@
\else
\ifx\InputIfFileExists\latex@InputIfFileExists
\else
- \PackageWarning{filehook}
- {Changed definition of \string\InputIfFileExists\space detected!^^J%
- This macro will be redefined and this might break other packages or code.}%
+ \@ifpackageloaded{scrlfile}{%
+ \PackageWarning{filehook}{Detected 'scrlfile' package with unknown definition of \string\InputIfFileExists}%
+ }{}%
+
+ \@ifclassloaded{memoir}{%
+ \PackageWarning{filehook}{Detected 'memoir' class with unknown definition of \string\InputIfFileExists}%
+ }{}%
+
+ \iffilehook@force
+ \PackageWarning{filehook}
+ {Changed definition of \string\InputIfFileExists\space detected!^^J%
+ The 'force' option is in effect and therefore this macros is redefined.
+ This might break other packages or code}%
+ \else
+ \PackageError{filehook}
+ {Changed definition of \string\InputIfFileExists\space detected!^^J%
+ Use the 'force' option to force the redefinition of this macro.^^J%
+ This might break other packages or code}%
+ \fi
\fi
\fi
@@ -238,6 +257,34 @@
{\long\global\@namedef{\filehook@atend@#1}}%
{\expandafter\filehook@prefix\csname\filehook@atend@#1\endcsname}%
}
+\newcommand*\AtBeginOfPackageFile[1]{%
+ \AtBeginOfFile{#1.\@pkgextension}%
+}
+\newcommand*\AtEndOfPackageFile{%
+ \@ifnextchar*\AtEndOfPackageFile@star\AtEndOfPackageFile@normal
+}
+\def\AtEndOfPackageFile@star*#1#2{%
+ \@ifpackageloaded{#1}%
+ {#2}%
+ {\AtEndOfPackageFile@normal{#1}{#2}}%
+}
+\def\AtEndOfPackageFile@normal#1#2{%
+ \AtEndOfFile{#1.\@pkgextension}{\AtEndOfPackage{#2}}%
+}
+\newcommand*\AtBeginOfClassFile[1]{%
+ \AtBeginOfFile{#1.\@clsextension}%
+}
+\newcommand*\AtEndOfClassFile{%
+ \@ifnextchar*\AtEndOfClassFile@star\AtEndOfClassFile@normal
+}
+\def\AtEndOfClassFile@star*#1#2{%
+ \@ifclassloaded{#1}%
+ {#2}%
+ {\AtEndOfClassFile@normal{#1}{#2}}%
+}
+\def\AtEndOfClassFile@normal#1#2{%
+ \AtEndOfFile{#1.\@clsextension}{\AtEndOfClass{#2}}%
+}
\endinput
%%
%% End of file `filehook.sty'.