diff mbox series

[bug#70829,v2,1/2] doc: Document assume-valid-file-name in local-file

Message ID 23ca145e6087ea18559fdd71d0c92db572abc8a3.1715193167.git.richard@freakingpenguin.com
State New
Headers show
Series [bug#70829,v2,1/2] doc: Document assume-valid-file-name in local-file | expand

Commit Message

Richard Sent May 8, 2024, 6:32 p.m. UTC
doc/guix.texi (G-Expressions): Document the use of assume-valid-file-name with
local-file.
---

Missed a commit that my original revision depended on. I initially
submitted that previous commit to https://qa.guix.gnu.org/issue/70830,
but since both commits change the same guix.texi section on similar
subject matter, I'm resubmitting as a series.

 doc/guix.texi | 12 ++++++++++++
 1 file changed, 12 insertions(+)


base-commit: 7b7f299bb493e485c5534b8c554e51d4f3a8c026
diff mbox series

Patch

diff --git a/doc/guix.texi b/doc/guix.texi
index 1c1e0164e7..221db5c022 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -12154,6 +12154,18 @@  G-Expressions
 absolute file name and @var{stat} is the result of @code{lstat}; exclude
 entries for which @var{select?} does not return true.
 
+@var{file} can be wrapped in the @code{assume-valid-file-name} syntactic
+keyword. When this is done, there will not be a warning when
+@code{local-file} is used with a non-literal path.  The path is still
+looked up relative to the current working directory at run time.
+Wrapping is done like this:
+
+@lisp
+(define alice-key-file-path "alice.pub")
+;; ...
+(local-file (assume-valid-file-name alice-key-file-path))
+@end lisp
+
 This is the declarative counterpart of the @code{interned-file} monadic
 procedure (@pxref{The Store Monad, @code{interned-file}}).
 @end deffn