[latex3-commits] [git/LaTeX3-latex3-latex3] earlier-expl3: \ProvidesExpl<thing> even if \Provides<thing> is not yet defined (791d52ab6)

PhelypeOleinik tex.phelype at gmail.com
Sat Jun 6 01:28:00 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : earlier-expl3
Link       : https://github.com/latex3/latex3/commit/791d52ab67f8e6517d7fcc741940830fe0186c87

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

commit 791d52ab67f8e6517d7fcc741940830fe0186c87
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Fri Jun 5 20:28:00 2020 -0300

    \ProvidesExpl<thing> even if \Provides<thing> is not yet defined


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

791d52ab67f8e6517d7fcc741940830fe0186c87
 l3kernel/expl3.dtx | 43 ++++++++++++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 13 deletions(-)

diff --git a/l3kernel/expl3.dtx b/l3kernel/expl3.dtx
index e15026922..3c445d5fa 100644
--- a/l3kernel/expl3.dtx
+++ b/l3kernel/expl3.dtx
@@ -1156,23 +1156,40 @@
 %
 % \begin{macro}{\ProvidesExplPackage, \ProvidesExplClass, \ProvidesExplFile}
 %   For other packages and classes building on this one it is convenient
-%   not to need \cs{ExplSyntaxOn} each time.
+%   not to need \cs{ExplSyntaxOn} each time.  All macros use the same
+%   internal one with the proper \LaTeXe{} command.
 %    \begin{macrocode}
-\protected\def\ProvidesExplPackage#1#2#3#4%
-  {%
-    \ProvidesPackage{#1}[#2 \ifx\relax#3\relax\else v#3\space\fi #4]%
-    \ExplSyntaxOn
-  }%
-\protected\def\ProvidesExplClass#1#2#3#4%
+\protected\def\ProvidesExplPackage
+  {\@expl at provides@file@@Nnnnnn\ProvidesPackage{Package}}
+\protected\def\ProvidesExplClass
+  {\@expl at provides@file@@Nnnnnn\ProvidesClass{Document Class}}
+\protected\def\ProvidesExplFile
+  {\@expl at provides@file@@Nnnnnn\ProvidesFile{File}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@expl at provides@file@@Nnnnnn, \@expl at provides@generic@@wnnw}
+%   We need to check the existence of the
+%   \cs[no-index]{Provides\meta{thing}}, since we need to load this very
+%   early in the \LaTeXe{} kernel.
+%    \begin{macrocode}
+\protected\long\def\@expl at provides@file@@Nnnnnn#1#2#3#4#5#6%
   {%
-    \ProvidesClass{#1}[#2 \ifx\relax#3\relax\else v#3\space\fi #4]%
+    \ifnum0%
+        \ifdefined#11\fi
+        \ifx\relax#1\else1\fi
+        =11
+      \expandafter#1%
+    \else
+      \@expl at provides@generic@@wnnw{#2}%
+    \fi
+      {#3}[{#4 \ifx\relax#5\relax\else v#5\space\fi #6}]%
     \ExplSyntaxOn
-  }%
-\protected\def\ProvidesExplFile#1#2#3#4%
+  }
+\protected\long\def\@expl at provides@generic@@wnnw#1\fi#2[#3]%
   {%
-    \ProvidesFile{#1}[#2 \ifx\relax#3\relax\else v#3\space\fi #4]%
-    \ExplSyntaxOn
-  }%
+    \immediate\write-1{#1: #2 #3}%
+  }
 %    \end{macrocode}
 % \end{macro}
 %





More information about the latex3-commits mailing list.