[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh422: Maintain a stack for \@currpath (cd128bf4)

PhelypeOleinik phelype.oleinik at latex-project.org
Sat Nov 7 16:07:49 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh422
Link       : https://github.com/latex3/latex2e/commit/cd128bf44b4b877fbd024ee073ee51d329dac265

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

commit cd128bf44b4b877fbd024ee073ee51d329dac265
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Sat Nov 7 12:07:49 2020 -0300

    Maintain a stack for \@currpath
    
    This one should be integrated in the main file stack, but this is a much
    larger change, so I'll leave it for a future release for proper testing.


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

cd128bf44b4b877fbd024ee073ee51d329dac265
 base/ltclass.dtx | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index a868028e..ce5398d2 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -593,6 +593,16 @@
     {\@currext}%
     {\the\catcode`\@}%
     \@currnamestack}%
+%    \end{macrocode}
+%   Temporarily add a stack for \cs{@currpath} here.  This should be
+%   integrated in the main file stack eventually, but other packages
+%   rely on \cs{@currnamestack} having three elements per file, so that
+%   isn't a trivial change.  The prefix \cs{@kernel at ...} hopefully
+%   discourages people from using it.
+%    \begin{macrocode}
+  \xdef\@kernel at currpathstack{%
+    {\@currpath}%
+    \@kernel at currpathstack}%
   \@expl at push@filename at aux@@}
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
@@ -640,6 +650,10 @@
 %<latexrelease>  {Add \@expl at pop@filename@@}%
 \def\@popfilename{\@expl@@@hook at curr@name at pop@@
   \expandafter\@p at pfilename\@currnamestack\@nil
+%    \end{macrocode}
+%   Same for popping:
+%    \begin{macrocode}
+  \expandafter\@p at pfilepath\@kernel at currpathstack\@nil
   \@expl at pop@filename@@}
 %<latexrelease>\EndIncludeInRelease
 %<latexrelease>
@@ -680,6 +694,19 @@
 % \end{macro}
 % \end{macro}
 %
+%
+% \begin{macro}{\@kernel at currpathstack}
+%   Path to the current file if explicitly given.
+%   \changes{v1.3u}{2020/11/07}{Macro added}
+%    \begin{macrocode}
+\gdef\@kernel at currpathstack{}
+\def\@p at pfilepath#1#2\@nil{%
+  \gdef\@currpath{#1}%
+  \gdef\@kernel at currpathstack{#2}}
+%    \end{macrocode}
+% \end{macro}
+%
+%
 % \begin{macro}{\@ptionlist}
 %    Returns the option list of the file.
 %    \begin{macrocode}





More information about the latex3-commits mailing list.