Subject: [PATCH v2 1/2] etc: snippets: Fix package name extraction.

From: Pierre Neidhardt <[email-masked]>
Date: Sat, 21 Nov 2020 12:05:32 +0100

* etc/snippets/text-mode/guix-commit-message-add-package: Properly extract
name when the diff contains a very short `define-public ...` above the actual
new package.  This can happen when the above package is a small inherited
definition or cl/ecl package.
---
 etc/snippets/text-mode/guix-commit-message-add-package | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/etc/snippets/text-mode/guix-commit-message-add-package b/etc/snippets/text-mode/guix-commit-message-add-package
index 0dff2cbcf5..e54a06de7e 100644
--- a/etc/snippets/text-mode/guix-commit-message-add-package
+++ b/etc/snippets/text-mode/guix-commit-message-add-package
@@ -7,7 +7,7 @@ gnu: Add ${1:`(with-temp-buffer
                 (magit-git-wash #'magit-diff-wash-diffs
                   "diff" "--staged")
                 (beginning-of-buffer)
-                (when (search-forward "(define-public " nil 'noerror)
+                (when (search-forward "+(define-public " nil 'noerror)
                   (thing-at-point 'sexp 'no-properties)))`}.
 
 * `(car (magit-staged-files))` ($1): New variable.
\ No newline at end of file
-- 
2.28.0