From f3ea876895f19b7460c2d3647578905cc80e0cfe Mon Sep 17 00:00:00 2001 From: Richard Sent Date: Sun, 2 Jun 2024 15:44:27 -0400 Subject: gexp: Add ‘assume-source-relative-file-name’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/gexp.scm (assume-source-relative-file-name): New macro. (local-file): Use assume-source-relative-file-name to look up a non-literal file relative to the current source directory. * doc/guix.texi (G-expressions): Document it. * tests/gexp.scm ("local-file, non-literal source relative file name"): New test. Signed-off-by: Ludovic Courtès Change-Id: I18573c8c7a6c87e8351b34412f9d26bb23b068b4 --- doc/guix.texi | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 16c697586a..cb8efa1e50 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12251,6 +12251,11 @@ Wrapping is done like this: (local-file (assume-valid-file-name alice-key-file-path)) @end lisp +@var{file} can be wrapped in the @code{assume-source-relative-file-name} +syntactic keyword. When this is done, the file name will be looked up +relative to the source file where it appears even when it is not a +string literal. + This is the declarative counterpart of the @code{interned-file} monadic procedure (@pxref{The Store Monad, @code{interned-file}}). @end deffn -- cgit 1.4.1