me
/
guix
Archived
1
0
Fork 0

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 ...).
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
1 changed files with 1 additions and 1 deletions

View File

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