summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2024-11-11 22:48:28 +0100
committerUlrich Müller <ulm@gentoo.org>2024-11-11 22:48:28 +0100
commit1e5216356931ac5287218f5d4da8356abc952b5d (patch)
tree4fdfba19410a8812f6e81ab58d029f3a0e7810c4
parentCall rng-locate-schema-file when locating a devbook schema (diff)
downloadebuild-mode-1e5216356931ac5287218f5d4da8356abc952b5d.tar.gz
ebuild-mode-1e5216356931ac5287218f5d4da8356abc952b5d.tar.bz2
ebuild-mode-1e5216356931ac5287218f5d4da8356abc952b5d.zip
Allow fragment identifier in bug regexp
* ebuild-mode.el (ebuild-mode-bug-regexp): Allow a fragment identifier, in order to refer to a specific comment. * test/ebuild-mode-tests.el (ebuild-mode-test-bug-url): Update. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog6
-rw-r--r--ebuild-mode.el2
-rw-r--r--test/ebuild-mode-tests.el7
3 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b06aee3..4083c98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-11-11 Ulrich Müller <ulm@gentoo.org>
+
+ * ebuild-mode.el (ebuild-mode-bug-regexp): Allow a fragment
+ identifier, in order to refer to a specific comment.
+ * test/ebuild-mode-tests.el (ebuild-mode-test-bug-url): Update.
+
2024-11-06 Ulrich Müller <ulm@gentoo.org>
* devbook-mode.el (devbook-set-schema): Renamed from
diff --git a/ebuild-mode.el b/ebuild-mode.el
index c1f8323..b3be725 100644
--- a/ebuild-mode.el
+++ b/ebuild-mode.el
@@ -920,7 +920,7 @@ This excludes `comment-start'. See `ebuild-mode-insert-tag-line'
for the format of the tag line.")
(defvar ebuild-mode-bug-regexp
- "\\(\\(?:\\b[Bb]ug *[ #]\\|#\\)\\([0-9]\\{4,\\}\\)\\)"
+ "\\(\\(?:\\b[Bb]ug *[ #]\\|#\\)\\([0-9]\\{4,\\}\\(?:#c[0-9]+\\)?\\)\\)"
"Regular expression matching bug references.
The format is the same as for `bug-reference-bug-regexp', which see.")
diff --git a/test/ebuild-mode-tests.el b/test/ebuild-mode-tests.el
index e81d4c8..9af48f6 100644
--- a/test/ebuild-mode-tests.el
+++ b/test/ebuild-mode-tests.el
@@ -257,7 +257,8 @@
(lambda (url &rest _args) (setq found url))))
(with-temp-buffer
(insert "# abc #876543 xyz\n"
- "# bug 765432\n")
+ "# bug 765432\n"
+ "# bug #654321#c10\n")
(ebuild-mode-test-run-silently
(ebuild-mode))
(bug-reference-fontify (point-min) (point-max))
@@ -270,6 +271,10 @@
(bug-reference-push-button (point))
(should (equal found "https://bugs.gentoo.org/765432"))
(setq found nil)
+ (search-forward "bug")
+ (bug-reference-push-button (point))
+ (should (equal found "https://bugs.gentoo.org/654321#c10"))
+ (setq found nil)
(bug-reference-push-button (point-min))
(bug-reference-push-button (point-max))
(should-not found))))