From: Tassilo Horn Date: Tue, 19 Oct 2021 05:05:18 +0000 (+0200) Subject: Adjust bug-reference-bug-regexp default values to match only at beg of word X-Git-Tag: emacs-28.0.90~251 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=380981ddb5dac675dafd9edb3d636d24e745c91c;p=emacs.git Adjust bug-reference-bug-regexp default values to match only at beg of word Previously, the "bug 1" in "(debug 1)" has also been highlighted. * lisp/progmodes/bug-reference.el (bug-reference-bug-regexp) (bug-reference--setup-from-vc-alist,bug-reference-setup-from-mail-alist) (bug-reference-setup-from-irc-alist): Adjust bug-reference-bug-regexp default values to match only at the beginning of a word. --- diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index fd014a38d95..fd435eadfe8 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -72,7 +72,7 @@ so that it is considered safe, see `enable-local-variables'.") (get s 'bug-reference-url-format))))) (defcustom bug-reference-bug-regexp - "\\(\\(?:[Bb]ug ?#?\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z+-]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)" + "\\(\\b\\(?:[Bb]ug ?#?\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z+-]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)" "Regular expression matching bug references. The first subexpression defines the region of the bug-reference overlay, i.e., the region being fontified and made clickable in @@ -350,7 +350,7 @@ generated from `bug-reference-forge-alist'." ;; `bug-reference-url-format' and ;; `bug-reference-bug-regexp' aren't set already. ("git\\.\\(?:sv\\|savannah\\)\\.gnu\\.org:" - "\\<\\(\\(?:[Bb]ug ?#?\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)\\>" + "\\(\\b\\(?:[Bb]ug ?#?\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)\\>" ,(lambda (_) "https://debbugs.gnu.org/%s")) ;; Entries for the software forges of @@ -395,7 +395,7 @@ applicable." ,(regexp-opt '("@debbugs.gnu.org" "-devel@gnu.org" ;; List-Id of Gnus devel mailing list. "ding.gnus.org")) - "\\([Bb]ug ?#?\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)" + "\\(\\b[Bb]ug ?#?\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)" "https://debbugs.gnu.org/%s")) "An alist for setting up `bug-reference-mode' in mail modes. @@ -526,7 +526,7 @@ From, and Cc against HEADER-REGEXP in `((,(concat "#" (regexp-opt '("emacs" "gnus" "org-mode" "rcirc" "erc") 'words)) "Libera.Chat" - "\\([Bb]ug ?#?\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)" + "\\(\\b[Bb]ug ?#?\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)" "https://debbugs.gnu.org/%s")) "An alist for setting up `bug-reference-mode' in IRC modes.