From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 52763@debbugs.gnu.org
Subject: [bug#52763] [PATCH] etc: Match define-public only at line start.
Date: Fri, 24 Dec 2021 01:33:14 +0100 [thread overview]
Message-ID: <5c3dc22c35166190de3a5ce802131df4f718d73d.camel@gmail.com> (raw)
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.
---
etc/snippets/text-mode/guix-commit-message-update-package | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etc/snippets/text-mode/guix-commit-message-update-package b/etc/snippets/text-mode/guix-commit-message-update-package
index f187419aa2..b08df74a0b 100644
--- a/etc/snippets/text-mode/guix-commit-message-update-package
+++ b/etc/snippets/text-mode/guix-commit-message-update-package
@@ -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")
--
2.34.0
next reply other threads:[~2021-12-24 0:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-24 0:33 Liliana Marie Prikler [this message]
2022-01-05 22:25 ` [bug#52763] [PATCH] etc: Match define-public only at line start Ludovic Courtès
2022-01-19 20:17 ` bug#52763: " Liliana Marie Prikler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c3dc22c35166190de3a5ce802131df4f718d73d.camel@gmail.com \
--to=liliana.prikler@gmail.com \
--cc=52763@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).