[latex3-commits] [git/LaTeX3-latex3-latex3] master: Update \file_get:nnN return value (see #538) (8e1c26c)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sat Feb 16 11:25:30 CET 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/8e1c26c9915cdbe83385d4ad391ba86fa741e2a9
>---------------------------------------------------------------
commit 8e1c26c9915cdbe83385d4ad391ba86fa741e2a9
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sat Feb 16 10:03:28 2019 +0000
Update \file_get:nnN return value (see #538)
>---------------------------------------------------------------
8e1c26c9915cdbe83385d4ad391ba86fa741e2a9
l3kernel/CHANGELOG.md | 2 +-
l3kernel/l3file.dtx | 11 ++++++-----
l3kernel/testfiles/m3file002.tlg | 8 +-------
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 8cf575c..a2e7d5b 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -13,7 +13,7 @@ this project uses date-based 'snapshot' version identifiers.
### Changed
-- Return values from `\sys_shell_get:nnN`
+- Return values from `\file_get:nnN`, `\sys_shell_get:nnN`
## [2019-02-15]
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index a8262e7..0524433 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -592,7 +592,7 @@
% \cs{l_file_search_path_seq}.
% \end{function}
%
-% \begin{function}[added = 2019-01-16]{\file_get:nnN}
+% \begin{function}[added = 2019-01-16, updated = 2019-02-16]{\file_get:nnN}
% \begin{function}[TF, added = 2019-01-16]{\file_get:nnN}
% \begin{syntax}
% \cs{file_get:nnN} \Arg{filename} \Arg{setup} \meta{tl}
@@ -601,9 +601,10 @@
% Defines \meta{tl} to the contents of \meta{filename}.
% Category codes may need to be set appropriately via the \meta{setup}
% argument.
-% While \cs{file_get:nnN} produces an error if the file is not found,
-% \cs{file_get:nnNTF} runs the \meta{true code} (after the assignment
-% to \meta{tl}) if the file is found and \meta{false code} otherwise.
+% The non-branching verson sets teh \meta{tl} to |\q_no_value| if the file is
+% not found. The branching version runs the \meta{true code} after the
+% assignment to \meta{tl} if the file is found, and \meta{false code}
+% otherwise.
% \end{function}
% \end{function}
%
@@ -2190,7 +2191,7 @@
\cs_new_protected:Npn \file_get:nnN #1#2#3
{
\file_get:nnNF {#1} {#2} #3
- { \__kernel_file_missing:n {#1} }
+ { \tl_set:Nn #3 { \q_no_value } }
}
\prg_new_protected_conditional:Npnn \file_get:nnN #1#2#3 { T , F , TF }
{
diff --git a/l3kernel/testfiles/m3file002.tlg b/l3kernel/testfiles/m3file002.tlg
index c62540a..6c4581d 100644
--- a/l3kernel/testfiles/m3file002.tlg
+++ b/l3kernel/testfiles/m3file002.tlg
@@ -15,11 +15,5 @@ m3ior001.lvtandm3ior002.lvt:Pleaseleaveitalone!\ExplSyntaxOn |
============================================================
TEST 2: Get a non-existent file
============================================================
-! LaTeX3 Error: File 'NotAFile.xxx.yyy.zzz' not found.
-For immediate help type H <return>.
- ...
-l. ... }
-The requested file could not be found in the current directory, in the TeX
-search path or in the LaTeX search path.
-|A|
+|\q_no_value |
============================================================
More information about the latex3-commits
mailing list