etc: snippets: Fix "gnu: Add ..." name when prefilling Common Lisp commits messages.
authorPierre Neidhardt <mail@ambrevar.xyz>
Wed, 25 Nov 2020 09:45:42 +0000 (10:45 +0100)
committerPierre Neidhardt <mail@ambrevar.xyz>
Wed, 25 Nov 2020 09:45:42 +0000 (10:45 +0100)
* etc/snippets/text-mode/guix-commit-message-add-cl-package: Fix name and
simplify the "New variables" line.

etc/snippets/text-mode/guix-commit-message-add-cl-package

index b0f7ef6..e255736 100644 (file)
@@ -8,6 +8,8 @@ gnu: Add ${1:`(with-temp-buffer
                   "diff" "--staged")
                 (beginning-of-buffer)
                 (when (search-forward "+(define-public " nil 'noerror)
-                  (thing-at-point 'sexp 'no-properties)))`}.
+                  (replace-regexp-in-string
+                  "^sbcl-" ""
+                  (thing-at-point 'sexp 'no-properties))))`}.
 
-* `(car (magit-staged-files))` (${1:$(replace-regexp-in-string (rx line-start "sbcl" (optional "-cl")) "cl" yas-text)}, ${1:$(replace-regexp-in-string "^sbcl" "ecl" yas-text)}, $1): New variables.
\ No newline at end of file
+* `(car (magit-staged-files))` (cl-${1:$(replace-regexp-in-string "^cl-" "" yas-text)}, ecl-$1, sbcl-$1): New variables.
\ No newline at end of file