Paste number 339290: mu4e with debbugs.el

Paste number 339290: mu4e with debbugs.el
Pasted by: rekado
When:3 years, 3 months ago
Share:Tweet this! | http://paste.lisp.org/+79SQ
Channel:None
Paste contents:
Raw Source | XML | Display As
diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el
index 42f2cb086..6486dffbf 100644
--- a/packages/debbugs/debbugs-gnu.el
+++ b/packages/debbugs/debbugs-gnu.el
@@ -173,6 +173,7 @@
 (autoload 'rmail-get-new-mail "rmail")
 (autoload 'rmail-show-message "rmail")
 (autoload 'rmail-summary "rmailsum")
+(autoload 'mu4e-view-message-with-message-id "mu4e-view")
 (autoload 'vc-dir-hide-up-to-date "vc-dir")
 (autoload 'vc-dir-mark "vc-dir")
 
@@ -292,11 +293,12 @@ suppressed bugs is toggled by `debbugs-gnu-toggle-suppress'."
 
 (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."
+If this is `gnus', the default, use Gnus.  If this is `rmail',
+use Rmail.  If this is `mu4e', use Mu4e instead."
   :group 'debbugs-gnu
   :type '(radio (function-item :tag "Use Gnus" gnus)
-		(function-item :tag "Use Rmail" rmail))
+                (function-item :tag "Use Rmail" rmail)
+                (function-item :tag "Use Mu4e" mu4e))
   :version "25.1")
 
 (defface debbugs-gnu-archived '((t (:inverse-video t)))
@@ -1329,6 +1331,13 @@ MERGED is the list of bugs merged with this one."
     (define-key rmail-mode-map "C" 'debbugs-gnu-send-control-message)
     (rmail-show-message 1)))
 
+(defun debbugs-read-emacs-bug-with-mu4e (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."
+  (with-current-buffer (window-buffer (selected-window))
+    (mu4e-view-message-with-message-id (assq 'msgid status))))
+
 (defun debbugs-read-emacs-bug-with-gnus (id status merged)
   "Read email exchange for debbugs bug ID.
 STATUS is the bug's status list.
@@ -1360,6 +1369,8 @@ MERGED is the list of bugs merged with this one."
       (message "No bug report on the current line"))
      ((eq debbugs-gnu-mail-backend 'rmail)
       (debbugs-read-emacs-bug-with-rmail id status merged))
+     ((eq debbugs-gnu-mail-backend 'mu4e)
+      (debbugs-read-emacs-bug-with-mu4e id status merged))
      ((eq debbugs-gnu-mail-backend 'gnus)
       (debbugs-read-emacs-bug-with-gnus id status merged))
      (t (error "No valid mail backend specified")))))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.