]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/bug-reference.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / progmodes / bug-reference.el
index 0a7d65c1fa4da98f2a1fdfcc2236248b08838eb4..50a2ff63daa9dfb5113f64c3fb5755565358716c 100644 (file)
@@ -1,6 +1,6 @@
 ;; bug-reference.el --- buttonize bug references
 
-;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2016 Free Software Foundation, Inc.
 
 ;; Author: Tom Tromey <tromey@redhat.com>
 ;; Created: 21 Mar 2007
 
 ;;; Code:
 
+(defgroup bug-reference nil
+  "Hyperlinking references to bug reports"
+  ;; Somewhat arbitrary, by analogy with eg goto-address.
+  :group 'comm)
+
 (defvar bug-reference-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mouse-2] 'bug-reference-push-button)
@@ -53,7 +58,7 @@ It can use `match-string' to get parts matched against
 There is no default setting for this, it must be set per file.
 If you set it to a symbol in the file Local Variables section,
 you need to add a `bug-reference-url-format' property to it:
-\(put 'my-bug-reference-url-format 'bug-reference-url-format t)
+\(put \\='my-bug-reference-url-format \\='bug-reference-url-format t)
 so that it is considered safe, see `enable-local-variables'.")
 
 ;;;###autoload
@@ -63,9 +68,14 @@ so that it is considered safe, see `enable-local-variables'.")
            (and (symbolp s)
                 (get s 'bug-reference-url-format)))))
 
-(defconst bug-reference-bug-regexp
-  "\\([Bb]ug ?#\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)"
-  "Regular expression which matches bug references.")
+(defcustom bug-reference-bug-regexp
+  "\\([Bb]ug ?#?\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)"
+  "Regular expression matching bug references.
+The second subexpression should match the bug reference (usually a number)."
+  :type 'string
+  :safe 'stringp
+  :version "24.3"                      ; previously defconst
+  :group 'bug-reference)
 
 (defun bug-reference-set-overlay-properties ()
   "Set properties of bug reference overlays."