[latex3-commits] [git/LaTeX3-latex3-latex2e] gh222: Update verbatim.dtx to make sure the right fiule is read by \verbatiminput (febec30e)

Johannes Braams texniek at braams.xs4all.nl
Sat Jun 6 11:25:05 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh222
Link       : https://github.com/latex3/latex2e/commit/febec30eb6c5647a0eabb95a0442705bc0a0b8cd

>---------------------------------------------------------------

commit febec30eb6c5647a0eabb95a0442705bc0a0b8cd
Author: Johannes Braams <texniek at braams.xs4all.nl>
Date:   Sat Jun 6 11:25:05 2020 +0200

    Update verbatim.dtx to make sure the right fiule is read by \verbatiminput


>---------------------------------------------------------------

febec30eb6c5647a0eabb95a0442705bc0a0b8cd
 required/tools/verbatim.dtx | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/required/tools/verbatim.dtx b/required/tools/verbatim.dtx
index 121e2d4b..fead414a 100644
--- a/required/tools/verbatim.dtx
+++ b/required/tools/verbatim.dtx
@@ -503,7 +503,7 @@
 %<*package>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{verbatim}
-     [2019/11/10 v1.5r LaTeX2e package for verbatim enhancements]
+     [2020-06-06 v1.5s LaTeX2e package for verbatim enhancements]
 \@ifundefined{verbatim@@@}{}{\endinput}
 %    \end{macrocode}
 %
@@ -1568,18 +1568,26 @@
 %    |\verbatim at input| first checks whether the file exists, using
 %    the standard macro |\IfFileExists| which leaves the name of the
 %    file found in |\@filef at und|. 
-%    Then everything is set up as in the |\verbatim| macro.
+%    Then everything is set up as in the |\verbatim| macro. But, as
+%    |\@verbatim| contains a call to |\every at verbatim| which
+%    \emph{might} contain an |\input| statement, which would overwrite
+%    the contents of |\@filef at und|, we need to save that filename
+%    temporarily. 
+% \changes{v1.5s}{2020-06-06}{Save the contents of \cs{@filef at und}
+%    before the call of \cs{@verbatim} (gh/222)}
 %    \begin{macrocode}
 \def\verbatim at input#1#2{%
-   \IfFileExists {#2}{\@verbatim #1\relax
+  \IfFileExists {#2}{%
+    \let\@verb at file\@filef at und
+    \@verbatim #1\relax
 %    \end{macrocode}
 %    Then it reads in the file, finishes off the \texttt{trivlist}
 %    environment started by |\@verbatim| and closes the group.
 %    This restores everything to its normal settings.
 %    \begin{macrocode}
-    \verbatim at readfile{\@filef at und}\endtrivlist\endgroup\@doendpe}%
+    \verbatim at readfile{\@verb at file}\endtrivlist\endgroup\@doendpe}%
 %    \end{macrocode}
-%   If the file is not found a more or less helpful message is
+%    If the file is not found a more or less helpful message is
 %    printed. The final |\endgroup| is  needed to close the group
 %    started in |\verbatiminput| above.
 %    \begin{macrocode}





More information about the latex3-commits mailing list.