summaryrefslogtreecommitdiff
path: root/emacs-debbugs-recognize-bugs.gnu.org.patch
blob: f188c08fea3c3f0a80101b00b053c3d725c29907 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>

This patch adds support for bugs.gnu.org URLs in debbugs.

Upstream bug URL:

https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00547.html

---
 packages/debbugs/debbugs-browse.el | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/debbugs-browse.el b/debbugs-browse.el
index 7e37eb6ec..ee0092610 100644
--- a/debbugs-browse.el
+++ b/debbugs-browse.el
@@ -1,6 +1,6 @@
 ;; debbugs-browse.el --- browse bug URLs with debbugs-gnu or debbugs-org
 
-;; Copyright (C) 2015-2017 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2018 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, hypermedia, maint
@@ -36,15 +36,18 @@ This can be either `debbugs-gnu-bugs' or `debbugs-org-bugs'."
 		 (const debbugs-org-bugs))
   :version "25.1")
 
+(defcustom debbugs-browse-url-regexp
+  (format "^%s\\(%s\\)?\\([[:digit:]]+\\)$"
+	  "https?://\\(debbugs\\|bugs\\)\\.gnu\\.org/"
+	  (regexp-quote "cgi/bugreport.cgi?bug="))
+  "Regexp matching Debbugs bug report URL."
+  :group 'debbugs-gnu
+  :type  'regexp)
+
 (defun debbugs-browse-url (url &optional _new-window)
   (when (and (stringp url)
-	     (string-match
-	      (format
-	       "^%s\\(%s\\)?\\([[:digit:]]+\\)$"
-	       "https?://debbugs\\.gnu\\.org/"
-	       (regexp-quote "cgi/bugreport.cgi?bug="))
-	      url))
-    (funcall debbugs-browse-function (string-to-number (match-string 2 url)))
+	     (string-match debbugs-browse-url-regexp url))
+    (funcall debbugs-browse-function (string-to-number (match-string 3 url)))
     ;; Return t for add-function mechanery.
     t))
 
-- 
2.15.1