[latex3-commits] [git/LaTeX3-latex3-latex3] LaTeX2020: Set \g_file_curr_name_str properly when pre-loading (4a5087ea2)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Oct 4 23:15:23 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : LaTeX2020
Link       : https://github.com/latex3/latex3/commit/4a5087ea2da660a940814fbc74f0fb99ae064825

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

commit 4a5087ea2da660a940814fbc74f0fb99ae064825
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Oct 4 22:15:23 2019 +0100

    Set \g_file_curr_name_str properly when pre-loading


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

4a5087ea2da660a940814fbc74f0fb99ae064825
 l3kernel/l3file.dtx | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 7e78c3357..eb5f44ab6 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -2254,22 +2254,29 @@
 %   The name of the current file should be available at all times.
 %   For the format the file name needs to be picked up at the start of the
 %   run. In \LaTeXe{} package mode the current file name is collected from
-%   \tn{@currname}.
+%   \tn{@currname}. If \pkg{expl3} is pre-loaded, things look a lot
+%   more like format mode.
 %    \begin{macrocode}
 \str_new:N \g_file_curr_dir_str
 \str_new:N \g_file_curr_ext_str
 \str_new:N \g_file_curr_name_str
 %<*initex>
-\tex_everyjob:D \exp_after:wN
-  {
-    \tex_the:D \tex_everyjob:D
-    \str_gset:Nx \g_file_curr_name_str { \tex_jobname:D }
-  }
+\use:n
 %</initex>
 %<*package>
-\cs_if_exist:NT \@currname
-  { \str_gset_eq:NN \g_file_curr_name_str \@currname }
+\cs_if_exist:cTF { ver at expl3.sty }
+  {
+    \cs_if_exist:NT \@currname
+      { \str_gset_eq:NN \g_file_curr_name_str \@currname }
+  }
 %</package>
+  {
+    \tex_everyjob:D \exp_after:wN
+      {
+        \tex_the:D \tex_everyjob:D
+        \str_gset:Nx \g_file_curr_name_str { \tex_jobname:D }
+      }
+  }
 %    \end{macrocode}
 % \end{variable}
 %





More information about the latex3-commits mailing list