[latex3-commits] [git/LaTeX3-latex3-latex3] master: Handle quotes in files for all XeTeX/LuaTeX cases (bf2a1a708)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Oct 23 16:20:38 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/bf2a1a708a5df4e311ca76831fe43f7f138023f8

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

commit bf2a1a708a5df4e311ca76831fe43f7f138023f8
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Oct 23 15:20:38 2019 +0100

    Handle quotes in files for all XeTeX/LuaTeX cases


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

bf2a1a708a5df4e311ca76831fe43f7f138023f8
 l3kernel/l3file.dtx | 41 ++++++++++++++++++++++++++++++++++++-----
 1 file changed, 36 insertions(+), 5 deletions(-)

diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index bc0a785e1..0c0837564 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -2561,6 +2561,23 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}[EXP]{\@@_strip_quotes:n}
+% \begin{macro}[EXP]{\@@_strip_quotes:w}
+%   For last-minute removal of quotes for \XeTeX{} and \LuaTeX{}, which
+%   in some places require these are absent.
+%    \begin{macrocode}
+\bool_lazy_or:nnT
+  { \sys_if_engine_luatex_p: }
+  { \sys_if_engine_xetex_p: }
+  {
+    \cs_new:Npn \@@_strip_quotes:n #1
+      { \@@_strip_quotes:w #1 " #1 " \q_stop }
+    \cs_new:Npn \@@_strip_quotes:w #1 " #2 " #3 \q_stop {#2}
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \begin{macro}{\@@_size:n}
 %   A copy of the primitive where it's available, or the \LuaTeX{}
 %   equivalent if relevant. \XeTeX{} treats any quote chars as part of
@@ -2572,9 +2589,8 @@
     \cs_new:Npn \@@_size:n #1
       {
         \exp_args:Ne \tex_filesize:D
-          { \@@_size:w #1 " #1 " \q_stop }
+          { \@@_strip_quotes:n {#1} }
       }
-    \cs_new:Npn \@@_size:w #1 " #2 " #3 \q_stop {#2}
   }
   { \cs_new_eq:NN \@@_size:n \tex_filesize:D }
 \sys_if_engine_luatex:T
@@ -2584,10 +2600,9 @@
         \lua_now:e
           {
             l3kernel.filesize
-              ( " \lua_escape:e { \@@_size:w #1 " #1 " \q_stop } " )
+              ( " \lua_escape:e { \@@_strip_quotes:n {#1} } " )
           }
       }
-    \cs_new:Npn \@@_size:w #1 " #2 " #3 \q_stop {#2}
   }
 %    \end{macrocode}
 % \end{macro}
@@ -2867,7 +2882,10 @@
     \cs_gset:Npn \@@_details_aux:nn #1#2
       {
         \lua_now:e
-          { l3kernel.file#2 ( " \lua_escape:e { #1 } " ) }
+          {
+            l3kernel.file#2
+              ( " \lua_escape:e { \@@_strip_quotes:n {#1} } " )
+          }
       }
   }
   {
@@ -2876,6 +2894,19 @@
     \cs_new:Npn \@@_mdfive_hash:n #1
       { \tex_mdfivesum:D file {#1} }
   }
+\sys_if_engine_xetex:T
+  {
+    \cs_gset:Npn \@@_details_aux:nn #1#2
+      {
+        \tl_if_blank:nF {#1}
+          {
+            \exp_args:Ne \use:c { tex_file #2 :D }
+              { \@@_strip_quotes:n {#1} }
+          }
+      }
+    \cs_gset:Npn \@@_mdfive_hash:n #1
+      { \tex_mdfivesum:D file { \@@_strip_quotes:n {#1} } }
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}





More information about the latex3-commits mailing list