build: emacs-utils: Fix `emacs-substitute-variables'.

* guix/build/emacs-utils.scm (emacs-substitute-variables): Fix the regexp
matching variable name.

With end-of-word regexp ("\>"), the previous regexp may match the prefix of
a variable only, effectively deleting the rest of its name.

For example,

  (emacs-substitute-variables "file.el"
    ("foo" ...))

could match (defvar foo-bar ...) and replace it with (defvar foo ...).
This commit is contained in:
Nicolas Goaziou 2022-10-13 21:40:56 +02:00
parent cf98a72774
commit 00fa377710
No known key found for this signature in database
GPG Key ID: DA00B4F048E92F2D

View File

@ -220,7 +220,7 @@ useful to avoid double quotes being added when the replacement is provided as
a string."
((_ file (variable replacement modifier ...) ...)
(emacs-substitute-sexps file
((string-append "(def[a-z]+[[:space:]\n]+" variable "\\>")
((string-append "(def[a-z]+[[:space:]\n]+" variable "\\_>")
replacement
modifier ...)
...))))