[latex3-commits] [git/LaTeX3-latex3-latex2e] cmd: Simplify loading (expl3.ltx already checks for reload) (a39efc0a)

PhelypeOleinik phelype.oleinik at latex-project.org
Sat Jan 16 21:15:44 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : cmd
Link       : https://github.com/latex3/latex2e/commit/a39efc0a80693893ca16b3cc09484d0ac0d2f7e7

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

commit a39efc0a80693893ca16b3cc09484d0ac0d2f7e7
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Sat Jan 16 17:15:44 2021 -0300

    Simplify loading (expl3.ltx already checks for reload)


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

a39efc0a80693893ca16b3cc09484d0ac0d2f7e7
 base/ltexpl.dtx | 68 ++++++++++++++++++++++++++-------------------------------
 1 file changed, 31 insertions(+), 37 deletions(-)

diff --git a/base/ltexpl.dtx b/base/ltexpl.dtx
index b6811bba..cbf3409b 100644
--- a/base/ltexpl.dtx
+++ b/base/ltexpl.dtx
@@ -124,36 +124,25 @@
 %</2ekernel>
 %    \end{macrocode}
 %
-%    If we are doing a rollback with a format containing expl3 we
-%    aren't reloading it as that creates havoc. This may need a
-%    refined version!
 %    \begin{macrocode}
 %<*2ekernel|latexrelease>
 %<latexrelease>\IncludeInRelease{2021/05/01}%
 %<latexrelease>                 {expl3}{Pre-load expl3}%
-\expandafter\ifx\csname tex\string _let:D\endcsname\relax
-  \expandafter\@firstofone
-\else
-  \GenericInfo{}{Skipping: expl3 code already part of the format}%
-%<2ekernel>  \expandafter\endinput
-%<latexrelease>  \expandafter\@gobble
-\fi
 %    \end{macrocode}
 %
 %  Check for the required primitive/engine support and the existence of
 %  a loader.
 %    \begin{macrocode}
+\IfFileExists{expl3.ltx}
   {%
-    \IfFileExists{expl3.ltx}
-      {%
-        \ifnum0%
-          \ifdefined\pdffilesize 1\fi
-          \ifdefined\filesize 1\fi
-          \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi
-          \ifdefined\kanjiskip 1\fi
-            >0 %
-          \expandafter\@firstofone
-        \else
+    \ifnum0%
+      \ifdefined\pdffilesize 1\fi
+      \ifdefined\filesize 1\fi
+      \ifdefined\luatexversion\ifnum\luatexversion>94 1\fi\fi
+      \ifdefined\kanjiskip 1\fi
+        >0 %
+      \expandafter\@firstofone
+    \else
 %    \end{macrocode}
 %
 % In \texttt{2ekernel} mode, an error is fatal and building the format
@@ -167,29 +156,34 @@
 %<2ekernel>          \def~{ }\def\MessageBreak{^^J~~~~~~~~~~~~~~~}%
 %<2ekernel>          \errmessage{LaTeX Error:
 %<latexrelease>          \@latex at error{%
-            LaTeX requires the e-TeX primitives and additional\MessageBreak
-            functionality available in the engines:\MessageBreak
-              - pdfTeX v1.40\MessageBreak
-              - XeTeX v0.99992\MessageBreak
-              - LuaTeX v0.95\MessageBreak
-              - e-(u)pTeX mid-2012\MessageBreak
-            or later%
+        LaTeX requires the e-TeX primitives and additional\MessageBreak
+        functionality available in the engines:\MessageBreak
+          - pdfTeX v1.40\MessageBreak
+          - XeTeX v0.99992\MessageBreak
+          - LuaTeX v0.95\MessageBreak
+          - e-(u)pTeX mid-2012\MessageBreak
+        or later%
 %<latexrelease>          }\@ehd \expandafter\@gobble
 %<2ekernel>          }\batchmode \read -1 to \reserved at a
-        \fi
-      }
-      {%
+    \fi
+  }
+  {%
 %<*2ekernel>
-        \errmessage{LaTeX requires expl3}%
-        \batchmode \read -1 to \reserved at a
+    \errmessage{LaTeX requires expl3}%
+    \batchmode \read -1 to \reserved at a
 %</2ekernel>
 %<*latexrelease>
-        \@latex at error{LaTeX requires expl3}\@ehd
-        \@gobble
+    \@latex at error{LaTeX requires expl3}\@ehd
+    \@gobble
 %</latexrelease>
-      }%
-      {\input expl3.ltx }%
-  }
+  }%
+%    \end{macrocode}
+%   The code above checks if \texttt{expl3.ltx} exists and can be
+%   loaded, and if so uses \cs{input} below.  \texttt{expl3.ltx} does
+%   the right thing if being reloaded, so here we don't worry about that
+%   (otherwise it would be a problem in \texttt{latexrelease} mode).
+%    \begin{macrocode}
+  {\input expl3.ltx }%
 %<latexrelease>\EndIncludeInRelease
 %<latexrelease>
 %    \end{macrocode}





More information about the latex3-commits mailing list.