emacs-debbugs-recognize-bugs.gnu.org.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
  2. This patch adds support for bugs.gnu.org URLs in debbugs.
  3. Upstream bug URL:
  4. https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00547.html
  5. ---
  6. packages/debbugs/debbugs-browse.el | 19 +++++++++++--------
  7. 1 file changed, 11 insertions(+), 8 deletions(-)
  8. diff --git a/debbugs-browse.el b/debbugs-browse.el
  9. index 7e37eb6ec..ee0092610 100644
  10. --- a/debbugs-browse.el
  11. +++ b/debbugs-browse.el
  12. @@ -1,6 +1,6 @@
  13. ;; debbugs-browse.el --- browse bug URLs with debbugs-gnu or debbugs-org
  14. -;; Copyright (C) 2015-2017 Free Software Foundation, Inc.
  15. +;; Copyright (C) 2015-2018 Free Software Foundation, Inc.
  16. ;; Author: Michael Albinus <michael.albinus@gmx.de>
  17. ;; Keywords: comm, hypermedia, maint
  18. @@ -36,15 +36,18 @@ This can be either `debbugs-gnu-bugs' or `debbugs-org-bugs'."
  19. (const debbugs-org-bugs))
  20. :version "25.1")
  21. +(defcustom debbugs-browse-url-regexp
  22. + (format "^%s\\(%s\\)?\\([[:digit:]]+\\)$"
  23. + "https?://\\(debbugs\\|bugs\\)\\.gnu\\.org/"
  24. + (regexp-quote "cgi/bugreport.cgi?bug="))
  25. + "Regexp matching Debbugs bug report URL."
  26. + :group 'debbugs-gnu
  27. + :type 'regexp)
  28. +
  29. (defun debbugs-browse-url (url &optional _new-window)
  30. (when (and (stringp url)
  31. - (string-match
  32. - (format
  33. - "^%s\\(%s\\)?\\([[:digit:]]+\\)$"
  34. - "https?://debbugs\\.gnu\\.org/"
  35. - (regexp-quote "cgi/bugreport.cgi?bug="))
  36. - url))
  37. - (funcall debbugs-browse-function (string-to-number (match-string 2 url)))
  38. + (string-match debbugs-browse-url-regexp url))
  39. + (funcall debbugs-browse-function (string-to-number (match-string 3 url)))
  40. ;; Return t for add-function mechanery.
  41. t))
  42. --
  43. 2.15.1