all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Recognize bugs.gnu.org in debbugs
@ 2018-01-17 14:26 Oleg Pykhalov
  2018-01-17 15:29 ` Michael Albinus
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Pykhalov @ 2018-01-17 14:26 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 738 bytes --]

Hello,

This patch adds a support for bugs.gnu.org URLs to debbugs-browse-url.

I'm using this with the following workflow:
--8<---------------cut here---------------start------------->8---
(add-to-list 'load-path "/srv/src/elpa/packages/debbugs/")

(require 'debbugs)
(require 'debbugs-gnu)
(require 'debbugs-browse)

(setq browse-url-browser-function
      `((,debbugs-browse-url-regexp . debbugs-browse-url)
        ("." . browse-url-conkeror)))

;; Example: call those or M-x ffap on URLs
(debbugs-browse-url "https://bugs.gnu.org/29552")
(debbugs-browse-url "https://debbugs.gnu.org/29552")
(debbugs-browse-url "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29552")
--8<---------------cut here---------------end--------------->8---


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: [PATCH] Recognize bugs.gnu.org in debbugs --]
[-- Type: text/x-patch, Size: 1907 bytes --]

From 00144cda27d8c6a935f1d3116b45cace30430f90 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
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 <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


[-- Attachment #1.3: Type: text/plain, Size: 7 bytes --]


Oleg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Recognize bugs.gnu.org in debbugs
  2018-01-17 14:26 [PATCH] Recognize bugs.gnu.org in debbugs Oleg Pykhalov
@ 2018-01-17 15:29 ` Michael Albinus
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Albinus @ 2018-01-17 15:29 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: emacs-devel

Oleg Pykhalov <go.wigust@gmail.com> writes:

> Hello,

Hi Oleg,

> This patch adds a support for bugs.gnu.org URLs to debbugs-browse-url.

Nice idea. I've committed your patch to the elpa repo. I've committed
also another patch, which adds some few words about
`debbugs-browse-url-regexp' to the manual, and increases the version to
0.15. Shall appear latest tomorrow in GNU ELPA.

Thanks, and best regards, Michael.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-17 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-17 14:26 [PATCH] Recognize bugs.gnu.org in debbugs Oleg Pykhalov
2018-01-17 15:29 ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.