3
4
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00

etc: Match define-public only at line start.

The current regexp simply matches the first occurence, which more often than
not points to the *previous* variable.

* etc/snippets/text-mode/guix-commit-message-update-package ($1): Restrict
match to beginning of line with optional indentation.
This commit is contained in:
Liliana Marie Prikler 2021-12-24 01:33:14 +01:00
parent f758ede583
commit 2c9f13ba63
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -8,7 +8,7 @@ gnu: ${1:`(with-temp-buffer
(magit-git-wash #'magit-diff-wash-diffs
"diff" "--staged")
(goto-char (point-min))
(when (re-search-forward "(define-public \\(\\S-+\\)" nil 'noerror)
(when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
(match-string-no-properties 1)))`}: Update to ${2:`(with-temp-buffer
(magit-git-wash #'magit-diff-wash-diffs
"diff" "--staged")