[latex3-commits] [latex3/latex3] main: Expand (partial) file paths when searching (74424d860)

github at latex-project.org github at latex-project.org
Thu Jun 15 15:31:07 CEST 2023


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/74424d8606c6c16c34c6c5e4e0908ef851313646

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

commit 74424d8606c6c16c34c6c5e4e0908ef851313646
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Jun 15 14:31:07 2023 +0100

    Expand (partial) file paths when searching
    
    See latex3/latex2e#1086.


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

74424d8606c6c16c34c6c5e4e0908ef851313646
 l3kernel/CHANGELOG.md            |  4 ++++
 l3kernel/l3file.dtx              | 14 +++++---------
 l3kernel/testfiles/m3file001.lvt | 10 ++++++++++
 l3kernel/testfiles/m3file001.tlg |  2 ++
 4 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 7ca79b487..2e3324329 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -13,6 +13,10 @@ this project uses date-based 'snapshot' version identifiers.
 - Generate _dialytika_ if appropriate when uppercasing Greek words starting with a
   vowel taking a breathing mark (issue \#1228)
 - Retain stress diacritics when uppercasing Greek (issue \#1230)
+- Expand (partial) paths in `\l_file_search_path_seq` and `\input at path`
+  (see latex3/latex2e\#1086)
+
+
 ## [2023-06-05]
 
 ### Added
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 5e2d8ba74..80191307a 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -690,12 +690,11 @@
 %   |--jobname|, for example).
 % \end{variable}
 %
-% \begin{variable}[added = 2017-06-18]{\l_file_search_path_seq}
+% \begin{variable}[added = 2017-06-18, updated = 2023-06-15]
+%   {\l_file_search_path_seq}
 %   Each entry is the path to a directory which should be searched when
-%   seeking a file. Each path can be relative or absolute, and should
-%   not include the trailing slash. The entries are not expanded when
-%   used so may contain active characters but should not feature any
-%   variable content. Spaces need not be quoted.
+%   seeking a file. Each path can be relative or absolute, and need
+%   not include the trailing slash. Spaces need not be quoted.
 %
 %   \begin{texnote}
 %     When working as a package in \LaTeXe{}, \pkg{expl3} will
@@ -2962,10 +2961,7 @@
 \cs_new:Npn \@@_full_name_aux:Nnn #1#2#3
   {
     \exp_args:Ne \@@_full_name_aux:nN
-      {
-        \exp_args:Ne \@@_full_name_slash:n
-          { \tl_to_str:n {#3} } #2
-      }
+      { \@@_full_name_slash:n {#3} #2 }
       #1
   }
 \cs_new:Npn \@@_full_name_slash:n #1
diff --git a/l3kernel/testfiles/m3file001.lvt b/l3kernel/testfiles/m3file001.lvt
index d9f5c48cf..252492c87 100644
--- a/l3kernel/testfiles/m3file001.lvt
+++ b/l3kernel/testfiles/m3file001.lvt
@@ -69,6 +69,16 @@
       \cs_set:cpn { input at path } { { ./testpath } }
       \TYPE { Slashes:~\file_full_name:n { infolder.txt } }
     \group_end:
+    \group_begin:
+      \tl_set:Nn \l_tmpa_tl { ./testpath }
+      \seq_put_right:Nn \l_file_search_path_seq { \l_tmpa_tl }
+      \TYPE { l3~expansion:~\file_full_name:n { infolder.txt } }
+    \group_end:
+    \group_begin:
+      \tl_set:Nn \l_tmpa_tl { ./testpath/ }
+      \cs_set:cpn { input at path } { { \l_tmpa_tl } }
+      \TYPE { 2e~expansion:~\file_full_name:n { infolder.txt } }
+    \group_end:
   }
 
 \TEST { Getting~the~full~name~of~files }
diff --git a/l3kernel/testfiles/m3file001.tlg b/l3kernel/testfiles/m3file001.tlg
index cac34196c..39cdd5c67 100644
--- a/l3kernel/testfiles/m3file001.tlg
+++ b/l3kernel/testfiles/m3file001.tlg
@@ -27,6 +27,8 @@ TEST 3: Find files in the search path
 l3: ./testpath/infolder.txt
 2e: ./testpath/infolder.txt
 Slashes: ./testpath/infolder.txt
+l3 expansion: ./testpath/infolder.txt
+2e expansion: ./testpath//infolder.txt
 ============================================================
 ============================================================
 TEST 4: Getting the full name of files





More information about the latex3-commits mailing list.