=== modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-09 11:03:37 +0000 +++ lisp/ChangeLog 2012-09-09 15:28:28 +0000 @@ -1,3 +1,9 @@ +2012-09-09 Stephen Berman + + * progmodes/bug-reference.el (bug-reference-push-button-action): + New defcustom to allow using gnus-read-ephemeral-emacs-bug-group. + (bug-reference-push-button): Use it. + 2012-09-09 Alan Mackenzie * progmodes/cc-engine.el (c-state-cache-init): Initialise === modified file 'lisp/progmodes/bug-reference.el' --- lisp/progmodes/bug-reference.el 2012-08-22 06:47:00 +0000 +++ lisp/progmodes/bug-reference.el 2012-09-09 15:28:25 +0000 @@ -76,6 +76,12 @@ :safe 'stringp :group 'bug-reference) +(defcustom bug-reference-push-button-action 'url + "List of choices for visiting the bug referenced in the button." + :type '(radio (const :tag "Visit the bug's URL in a browser" url) + (const :tag "Visit the bug thread in Gnus" gnus)) + :group 'bug-reference) + (defun bug-reference-set-overlay-properties () "Set properties of bug reference overlays." (put 'bug-reference 'evaporate t) @@ -121,7 +127,11 @@ ;; Taken from button.el. (defun bug-reference-push-button (&optional pos _use-mouse-action) - "Open URL corresponding to the bug reference at POS." + "Take appropriate action on the bug reference at POS. +The action depends on the value of the user option +`bug-reference-push-button-action': either visit the bug's URL in +a browser or visit the bug thread in Gnus (N.B.: the latter only +works for references to the Emacs bugtracker)." (interactive (list (if (integerp last-command-event) (point) last-command-event))) (if (and (not (integerp pos)) (eventp pos)) @@ -130,11 +140,14 @@ (with-current-buffer (window-buffer (posn-window posn)) (bug-reference-push-button (posn-point posn) t))) ;; POS is just normal position. - (dolist (o (overlays-at pos)) - ;; It should only be possible to have one URL overlay. - (let ((url (overlay-get o 'bug-reference-url))) - (when url - (browse-url url)))))) + (cond ((eq bug-reference-push-button-action 'url) + (dolist (o (overlays-at pos)) + ;; It should only be possible to have one URL overlay. + (let ((url (overlay-get o 'bug-reference-url))) + (when url + (browse-url url))))) + ((eq bug-reference-push-button-action 'gnus) + (gnus-read-ephemeral-emacs-bug-group))))) ;;;###autoload (define-minor-mode bug-reference-mode