;; Michael Albinus <michael.albinus@gmx.org>
;; Keywords: comm, hypermedia, maint
;; Package: debbugs
-;; Version: 0.7
+;; Version: 0.8
;; This file is not part of GNU Emacs.
;; submitter, and the title of the bug. On every bug line you could
;; apply the following actions by the following keystrokes:
-;; RET: Show corresponding messages in Gnus
+;; RET: Show corresponding messages in Gnus/Rmail
;; "C": Send a control message
;; "t": Mark the bug locally as tagged
;; "b": Show bugs this bug is blocked by
(autoload 'message-make-from "message")
(autoload 'vc-dir-hide-up-to-date "vc-dir")
(autoload 'vc-dir-mark "vc-dir")
+(autoload 'rmail-get-new-mail "rmail")
+(autoload 'rmail-show-message "rmail")
+(autoload 'rmail-summary "rmailsum")
(defvar compilation-in-progress)
(defgroup debbugs-gnu ()
(defface debbugs-gnu-archived '((t (:inverse-video t)))
"Face for archived bug reports.")
+(defcustom debbugs-gnu-mail-backend 'gnus
+ "*The email backend to use for reading bug report email exchange.
+If this is 'gnus, the default, use Gnus.
+If this is 'rmail, use Rmail instead."
+ :group 'debbugs-gnu
+ :type '(choice (const :tag "Use Gnus" 'gnus)
+ (const :tag "Use Rmail" 'rmail))
+ :version "25.1")
+
(defface debbugs-gnu-new '((t (:foreground "red")))
"Face for new reports that nobody has answered.")
(set-buffer-modified-p nil)
(special-mode))
+(defvar rmail-current-message)
+(defvar rmail-total-messages)
+(defvar rmail-mode-map)
+(defvar rmail-summary-mode-map)
+
+(defun debbugs-read-emacs-bug-with-rmail (id status merged)
+ "Read email exchange for debbugs bug ID.
+STATUS is the bug's status list.
+MERGED is the list of bugs merged with this one."
+ (let* ((mbox-dir (make-temp-file "debbugs" t))
+ (mbox-fname (format "%s/bug_%d.mbox" mbox-dir id)))
+ (debbugs-get-mbox id 'mboxmaint mbox-fname)
+ (rmail mbox-fname)
+ ;; Download messages of all the merged bug reports and append them
+ ;; to the mailbox of the requested bug.
+ (when merged
+ (dolist (bugno merged)
+ (let ((fn (make-temp-file "url")))
+ (debbugs-get-mbox bugno 'mboxmaint fn)
+ (rmail-get-new-mail fn)
+ (delete-file fn)
+ ;; Remove the 'unseen' attribute from all the messages we've
+ ;; just read, so that all of them appear in the summary with
+ ;; the same face.
+ (while (< rmail-current-message rmail-total-messages)
+ (rmail-show-message (1+ rmail-current-message))))))
+ (set (make-local-variable 'debbugs-gnu-bug-number) id)
+ (set (make-local-variable 'debbugs-gnu-subject)
+ (format "Re: bug#%d: %s" id (cdr (assq 'subject status))))
+ (rmail-summary)
+ (define-key rmail-summary-mode-map "C" 'debbugs-gnu-send-control-message)
+ (set-window-text-height nil 10)
+ (other-window 1)
+ (define-key rmail-mode-map "C" 'debbugs-gnu-send-control-message)
+ (rmail-show-message 1)))
+
(defun debbugs-gnu-select-report ()
"Select the report on the current line."
(interactive)
(let* ((status (debbugs-gnu-current-status))
(id (cdr (assq 'id status)))
(merged (cdr (assq 'mergedwith status))))
- (gnus-read-ephemeral-emacs-bug-group
- (cons id (if (listp merged)
- merged
- (list merged)))
- (cons (current-buffer)
- (current-window-configuration)))
- (with-current-buffer (window-buffer (selected-window))
- (set (make-local-variable 'debbugs-gnu-bug-number) id)
- (set (make-local-variable 'debbugs-gnu-subject)
- (format "Re: bug#%d: %s" id (cdr (assq 'subject status))))
- (debbugs-gnu-summary-mode 1))))
+ (if (eq debbugs-gnu-mail-backend 'rmail)
+ (debbugs-read-emacs-bug-with-rmail id status (if (listp merged)
+ merged
+ (list merged)))
+ ;; Use Gnus.
+ (gnus-read-ephemeral-emacs-bug-group
+ (cons id (if (listp merged)
+ merged
+ (list merged)))
+ (cons (current-buffer)
+ (current-window-configuration)))
+ (with-current-buffer (window-buffer (selected-window))
+ (set (make-local-variable 'debbugs-gnu-bug-number) id)
+ (set (make-local-variable 'debbugs-gnu-subject)
+ (format "Re: bug#%d: %s" id (cdr (assq 'subject status))))
+ (debbugs-gnu-summary-mode 1)))))
(defvar debbugs-gnu-summary-mode-map
(let ((map (make-sparse-keymap)))
-This is debbugs-ug.info, produced by makeinfo version 5.2 from
+This is debbugs-ug.info, produced by makeinfo version 6.0 from
debbugs-ug.texi.
Copyright (C) 2015 Free Software Foundation, Inc.
This enables the following key strokes:
'<RET>' 'debbugs-gnu-select-report'
-'<mouse-1>' Open a GNUS ephemeral group for that bug.
+'<mouse-1>' Show the email messages that discuss the bug.
'<mouse-2>'
'd' 'debbugs-gnu-display-status'
Send a control message for this bug, *note Control Messages::.
+ The user option 'debbugs-gnu-mail-backend' controls the presentation
+of email messages produced by typing '<RET>' or by clicking the mouse on
+a bug: if its value is 'gnus', the default, a GNUS ephemeral group for
+that bug will be shown; if its value is 'rmail', the command will
+present an Rmail folder instead.
+
\1f
File: debbugs-ug.info, Node: TODO Items, Next: Control Messages, Prev: Tabulated Lists, Up: Layout
<http://debbugs.gnu.org/server-control.html>.
A control message can be initiated in the tabulated list of bugs, in
-the list of org TODO items, or in the GNUS ephemeral group opened for
-the messages belonging to a given bug. Control messages can be sent to
-unarchived bugs only, in case a bug is archived the control message
-'unarchive' must be sent first.
+the list of org TODO items, or in the GNUS ephemeral group or Rmail
+folder opened for the messages belonging to a given bug. Control
+messages can be sent to unarchived bugs only, in case a bug is archived
+the control message 'unarchive' must be sent first.
In the minibuffer, the following control messages can be requested
(assuming that 12345 is the bug the control message is intended for).
* debbugs-gnu-default-hits-per-page: Retrieving Bugs. (line 61)
* debbugs-gnu-default-packages: Retrieving Bugs. (line 57)
* debbugs-gnu-default-severities: Retrieving Bugs. (line 57)
+* debbugs-gnu-mail-backend: Tabulated Lists. (line 62)
\1f
File: debbugs-ug.info, Node: Key Index, Prev: Variable Index, Up: Top
Ref: Searching Bugs-Footnote-2\7f10104
Node: Layout\7f10195
Node: Tabulated Lists\7f10670
-Node: TODO Items\7f13173
-Node: Control Messages\7f14438
-Node: Minor Mode\7f16733
-Node: Command Index\7f17671
-Node: Variable Index\7f18332
-Node: Key Index\7f18921
+Node: TODO Items\7f13493
+Node: Control Messages\7f14758
+Node: Minor Mode\7f17069
+Node: Command Index\7f18007
+Node: Variable Index\7f18668
+Node: Key Index\7f19330
\1f
End Tag Table
@kindex @kbd{@key{mouse-2}}
@kbd{@key{mouse-2}} @tab
@code{debbugs-gnu-select-report} @*
-Open a GNUS ephemeral group for that bug.@c (@pxref{xxx}).
+Show the email messages that discuss the bug.
@* @item
@kindex @kbd{d}
@end multitable
+@vindex debbugs-gnu-mail-backend
+The user option @code{debbugs-gnu-mail-backend} controls the
+presentation of email messages produced by typing @kbd{@key{RET}} or
+by clicking the mouse on a bug: if its value is @code{gnus}, the
+default, a GNUS ephemeral group for that bug will be shown; if its
+value is @code{rmail}, the command will present an Rmail folder
+instead.
@node TODO Items
@section TODO Items
@uref{http://debbugs.gnu.org/server-control.html}.
A control message can be initiated in the tabulated list of bugs, in
-the list of org TODO items, or in the GNUS ephemeral group opened for
-the messages belonging to a given bug. Control messages can be sent
-to unarchived bugs only, in case a bug is archived the control message
-@samp{unarchive} must be sent first.
+the list of org TODO items, or in the GNUS ephemeral group or Rmail
+folder opened for the messages belonging to a given bug. Control
+messages can be sent to unarchived bugs only, in case a bug is
+archived the control message @samp{unarchive} must be sent first.
In the minibuffer, the following control messages can be requested
(assuming that 12345 is the bug the control message is intended for).