From: Oleg Pykhalov <go.wigust@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] Recognize bugs.gnu.org in debbugs
Date: Wed, 17 Jan 2018 17:26:39 +0300 [thread overview]
Message-ID: <87bmhstvc0.fsf@gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2018-01-17 14:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 14:26 Oleg Pykhalov [this message]
2018-01-17 15:29 ` [PATCH] Recognize bugs.gnu.org in debbugs Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bmhstvc0.fsf@gmail.com \
--to=go.wigust@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.