HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from mainline.
[bpt/emacs.git]
/
lisp
/
progmodes
/
bug-reference.el
diff --git
a/lisp/progmodes/bug-reference.el
b/lisp/progmodes/bug-reference.el
index
c82e3dd
..
3561105
100644
(file)
--- a/
lisp/progmodes/bug-reference.el
+++ b/
lisp/progmodes/bug-reference.el
@@
-1,6
+1,6
@@
;; bug-reference.el --- buttonize bug references
;; bug-reference.el --- buttonize bug references
-;; Copyright (C) 2008
, 2009, 2010, 2011
Free Software Foundation, Inc.
+;; Copyright (C) 2008
-2012
Free Software Foundation, Inc.
;; Author: Tom Tromey <tromey@redhat.com>
;; Created: 21 Mar 2007
;; Author: Tom Tromey <tromey@redhat.com>
;; Created: 21 Mar 2007
@@
-30,6
+30,13
@@
;; Two minor modes are provided. One works on any text in the buffer;
;; the other operates only on comments and strings.
;; Two minor modes are provided. One works on any text in the buffer;
;; the other operates only on comments and strings.
+;;; 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)
(defvar bug-reference-map
(let ((map (make-sparse-keymap)))
(define-key map [mouse-2] 'bug-reference-push-button)
@@
-61,9
+68,14
@@
so that it is considered safe, see `enable-local-variables'.")
(and (symbolp s)
(get s 'bug-reference-url-format)))))
(and (symbolp s)
(get s 'bug-reference-url-format)))))
-(defconst bug-reference-bug-regexp
- "\\([Bb]ug ?#\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z-+]+/\\)\\([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."
(defun bug-reference-set-overlay-properties ()
"Set properties of bug reference overlays."
@@
-109,7
+121,7
@@
so that it is considered safe, see `enable-local-variables'.")
(funcall bug-reference-url-format))))))))))
;; Taken from button.el.
(funcall bug-reference-url-format))))))))))
;; Taken from button.el.
-(defun bug-reference-push-button (&optional pos use-mouse-action)
+(defun bug-reference-push-button (&optional pos
_
use-mouse-action)
"Open URL corresponding to the bug reference at POS."
(interactive
(list (if (integerp last-command-event) (point) last-command-event)))
"Open URL corresponding to the bug reference at POS."
(interactive
(list (if (integerp last-command-event) (point) last-command-event)))
@@
-127,7
+139,10
@@
so that it is considered safe, see `enable-local-variables'.")
;;;###autoload
(define-minor-mode bug-reference-mode
;;;###autoload
(define-minor-mode bug-reference-mode
- "Minor mode to buttonize bugzilla references in the current buffer."
+ "Toggle hyperlinking bug references in the buffer (Bug Reference mode).
+With a prefix argument ARG, enable Bug Reference mode if ARG is
+positive, and disable it otherwise. If called from Lisp, enable
+the mode if ARG is omitted or nil."
nil
""
nil
nil
""
nil
@@
-151,5
+166,5
@@
so that it is considered safe, see `enable-local-variables'.")
(widen)
(bug-reference-unfontify (point-min) (point-max)))))
(widen)
(bug-reference-unfontify (point-min) (point-max)))))
-;; arch-tag: b138abce-e5c3-475e-bd58-7afba40387ea
+(provide 'bug-reference)
;;; bug-reference.el ends here
;;; bug-reference.el ends here