Subject: Re: bug#62814: [PATCH] Clarify substitute* docstring with an additional example
From: Ludovic Courtès <[email-masked]>
To: "Wicki Gabriel (wicg)" <[email-masked]>
Cc: [email-masked]
Date: Thu, 11 May 2023 14:38:56 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

"Wicki Gabriel (wicg)" <[email-masked]> skribis:

> From 5ae3c5512e85189a47c859c6128adfd3bfc63159 Mon Sep 17 00:00:00 2001
> From: Gabriel Wicki <[email-masked]>
> Date: Thu, 13 Apr 2023 10:31:57 +0200
> Subject: [PATCH] guix: build: utils: Clarify substitute* docstring with an
>  example.
>
> * guix/build/utils.scm (substitute*):  Add an example on how to match
> end-of-line.
> * doc/guix.texi (Build Utilities): Update the corresponding passage.

[...]

>  Be careful about using @code{$} to match the end of a line; by itself it
> -won't match the terminating newline of a line.
> +won't match the terminating newline of a line, e.g. to match a whole
> +line ending with a backslash, one needs a regex like @code{"(.*)\\\\\n$"}.

Applied with a minor tweak and without the (guix build utils) change,
which would entail a world rebuild.

Thanks!

Ludo’.