[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh422: Add \changes entries and latexrelease guards (b386903e)
PhelypeOleinik
phelype.oleinik at latex-project.org
Wed Nov 18 00:49:53 CET 2020
Repository : https://github.com/latex3/latex2e
On branch : hotfix/gh422
Link : https://github.com/latex3/latex2e/commit/b386903e5438adad6fe7cdd59a336b8551513857
>---------------------------------------------------------------
commit b386903e5438adad6fe7cdd59a336b8551513857
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Tue Nov 17 20:49:53 2020 -0300
Add \changes entries and latexrelease guards
>---------------------------------------------------------------
b386903e5438adad6fe7cdd59a336b8551513857
base/ltfilehook.dtx | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/base/ltfilehook.dtx b/base/ltfilehook.dtx
index bb1bbd60..95f8e14d 100644
--- a/base/ltfilehook.dtx
+++ b/base/ltfilehook.dtx
@@ -643,6 +643,8 @@
% kernel we do this only now and not in \texttt{ltfiles}.
%
% \begin{macro}{\InputIfFileExists}
+% \begin{macro}{\@input at file@exists at with@hooks}
+% \begin{macro}{\unqu at 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
@@ -682,11 +684,6 @@
% 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 at 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 at a{%
\@expl@@@filehook at file@pop at assign@@nnnn
@@ -694,6 +691,18 @@
{\CurrentFileUsed}%
{\CurrentFilePath}%
{\CurrentFile}%
+% \end{macrocode}
+%
+% We pre-expand \cs{@filef at 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 at file@exists at with@hooks} and expand
+% \cs{@filef at und} to avoid getting the wrong file name in the case of
+% a substitution.}
+% \begin{macrocode}
\noexpand\@input at file@exists at with@hooks{\@filef at und}}%
\expandafter\@swaptwoargs\expandafter
{\reserved at a}%
@@ -701,6 +710,9 @@
\@expl@@@filehook at file@pop@@
}%
}
+% \end{macrocode}
+%
+% \begin{macrocode}
\def\@input at file@exists at with@hooks#1{%
\@addtofilelist{\unqu at tefilef@und#1\@nil}%
\UseHook{file/before}%
@@ -743,6 +755,8 @@
%<latexrelease> {%
%<latexrelease> \expandafter\@swaptwoargs\expandafter
%<latexrelease> {\@filef at und}{#2\@addtofilelist{#1}\@@input}}}
+%<latexrelease>\let\@input at file@exists at with@hooks\@undefined
+%<latexrelease>\let\unqu at tefilef@und\@undefined
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
%
@@ -752,10 +766,14 @@
%<latexrelease>\long\def \InputIfFileExists#1#2{%
%<latexrelease> \IfFileExists{#1}%
%<latexrelease> {#2\@addtofilelist{#1}\@@input \@filef at und}}
+%<latexrelease>\let\@input at file@exists at with@hooks\@undefined
+%<latexrelease>\let\unqu at tefilef@und\@undefined
%<latexrelease>\EndIncludeInRelease
%<*2ekernel>
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
%
%
More information about the latex3-commits
mailing list.