Skip to content

Commit

Permalink
Add \changes entries and latexrelease guards
Browse files Browse the repository at this point in the history
  • Loading branch information
PhelypeOleinik committed Nov 17, 2020
1 parent 00a6123 commit b386903
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions base/ltfilehook.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@
% kernel we do this only now and not in \texttt{ltfiles}.
%
% \begin{macro}{\InputIfFileExists}
% \begin{macro}{\@input@file@exists@with@hooks}
% \begin{macro}{\unqu@tefilef@und}
% \cs{InputIfFileExists} loads any file if it is available so we
% have to add the hooks \texttt{file/before} and
% \texttt{file/after} in the right places. If the file doesn't
Expand Down Expand Up @@ -682,25 +684,35 @@
% the file name and extension are returned so that file hooks can
% refer to the file by their name only. The path to the file is
% returned in \cs{CurrentFilePath}.
%
% We pre-expand \cs{@filef@und} so that in case another file is
% loaded in the true branch of \cs{InputIfFileExists}, these don't
% change their value meanwhile. This isn't a worry with
% \cs[no-index]{CurrentFile...} because they are kept in a stack.
% \begin{macrocode}
\edef\reserved@a{%
\@expl@@@filehook@file@pop@assign@@nnnn
{\CurrentFilePathUsed}%
{\CurrentFileUsed}%
{\CurrentFilePath}%
{\CurrentFile}%
% \end{macrocode}
%
% We pre-expand \cs{@filef@und} so that in case another file is
% loaded in the true branch of \cs{InputIfFileExists}, these don't
% change their value meanwhile. This isn't a worry with
% \cs[no-index]{CurrentFile...} because they are kept in a stack.
%
% \changes{v1.0d}{2020/11/17}
% {Move loading to \cs{@input@file@exists@with@hooks} and expand
% \cs{@filef@und} to avoid getting the wrong file name in the case of
% a substitution.}
% \begin{macrocode}
\noexpand\@input@file@exists@with@hooks{\@filef@und}}%
\expandafter\@swaptwoargs\expandafter
{\reserved@a}%
{#2}%
\@expl@@@filehook@file@pop@@
}%
}
% \end{macrocode}
%
% \begin{macrocode}
\def\@input@file@exists@with@hooks#1{%
\@addtofilelist{\unqu@tefilef@und#1\@nil}%
\UseHook{file/before}%
Expand Down Expand Up @@ -743,6 +755,8 @@
%<latexrelease> {%
%<latexrelease> \expandafter\@swaptwoargs\expandafter
%<latexrelease> {\@filef@und}{#2\@addtofilelist{#1}\@@input}}}
%<latexrelease>\let\@input@file@exists@with@hooks\@undefined
%<latexrelease>\let\unqu@tefilef@und\@undefined
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
%
Expand All @@ -752,10 +766,14 @@
%<latexrelease>\long\def \InputIfFileExists#1#2{%
%<latexrelease> \IfFileExists{#1}%
%<latexrelease> {#2\@addtofilelist{#1}\@@input \@filef@und}}
%<latexrelease>\let\@input@file@exists@with@hooks\@undefined
%<latexrelease>\let\unqu@tefilef@und\@undefined
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
Expand Down

0 comments on commit b386903

Please sign in to comment.