From 00144cda27d8c6a935f1d3116b45cace30430f90 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov
Date: Wed, 17 Jan 2018 13:38:41 +0300 Subject: [PATCH] Recognize bugs.gnu.org in debbugs * packages/debbugs/debbugs-browse.el (debbugs-browse-url): Recognize bugs.gnu.org. --- packages/debbugs/debbugs-browse.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/debbugs/debbugs-browse.el b/packages/debbugs/debbugs-browse.el index 7e37eb6ec..ee0092610 100644 --- a/packages/debbugs/debbugs-browse.el +++ b/packages/debbugs/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 ;; 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