[latex3-commits] [latex3/latex3] main: Make \file_if_exist:n(TF) expandable (9c6b10346)

github at latex-project.org github at latex-project.org
Mon Sep 18 18:11:16 CEST 2023


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/9c6b10346ee5c168eafd506481eaf6f6801b38b1

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

commit 9c6b10346ee5c168eafd506481eaf6f6801b38b1
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Sep 18 17:11:16 2023 +0100

    Make \file_if_exist:n(TF) expandable
    
    This also allows a predicate, which is added here.


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

9c6b10346ee5c168eafd506481eaf6f6801b38b1
 l3kernel/CHANGELOG.md |  2 ++
 l3kernel/l3file.dtx   | 10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 953a1481d..0bb6666ff 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -13,6 +13,8 @@ this project uses date-based 'snapshot' version identifiers.
 - l3doc.dtx: Support for footnotes in the function and variable environment  
 
 ### Changed
+- Convert `\file_if_exist:n(TF)` to expandable status,
+  adding predicate version
 - Standardise variants for `\prop_(g)pop:NnN(TF)`
 - Standardise variants for `\prop_(g)put:Nnn`
 - Standardise variants for `\prop_(g)put_if_new:Nnn`
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index a1dbb2060..e84bbbc68 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -705,7 +705,7 @@
 %   \end{texnote}
 % \end{variable}
 %
-% \begin{function}[TF, updated = 2012-02-10]
+% \begin{function}[EXP, pTF, updated = 2023-09-18]
 %   {\file_if_exist:n, \file_if_exist:V}
 %   \begin{syntax}
 %     \cs{file_if_exist:nTF} \Arg{file name} \Arg{true code} \Arg{false code}
@@ -3379,13 +3379,13 @@
 %   something, whereas if the file was not located then the return value
 %   is empty.
 %    \begin{macrocode}
-\prg_new_protected_conditional:Npnn \file_if_exist:n #1 { T , F , TF }
+\prg_new_conditional:Npnn \file_if_exist:n #1 { p , T , F , TF }
   {
-    \file_get_full_name:nNTF {#1} \l_@@_full_name_tl
-      { \prg_return_true: }
+    \tl_if_blank:eTF { \file_full_name:n {#1} }
       { \prg_return_false: }
+      { \prg_return_true: }
   }
-\prg_generate_conditional_variant:Nnn \file_if_exist:n { V } { T , F , TF }
+\prg_generate_conditional_variant:Nnn \file_if_exist:n { V } { p , T , F , TF }
 %    \end{macrocode}
 % \end{macro}
 %





More information about the latex3-commits mailing list.