emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#38136: [PATCH] Make gnus-group-get-new-news a non blocking threa


From: Robert Pluim
Subject: Re: bug#38136: [PATCH] Make gnus-group-get-new-news a non blocking thread
Date: Thu, 21 Nov 2019 17:39:36 +0100

>>>>> On Thu, 21 Nov 2019 15:54:00 +0100, Michael Albinus <address@hidden> said:

    Michael> I've pushed a change to elpa, adding commands debbugs-gnu-tagged 
and
    Michael> debbugs-org-tagged.

    Michael> Robert, your command in preparation might change slightly the
    Michael> scope. Instead of showing all messages for the tagged bugs, it 
might
    Michael> show all messages for the bugs in the current Debbugs buffer. This 
is
    Michael> more general.

Hey, when did I sign up for this? :-)

    Michael> Since the current buffer might contain many bugs, there should be a
    Michael> limit. Let's say, show messages of max 50 bugs (the most highest 
ones
    Michael> per number).

Iʼm not sure what you mean with that parenthetical statement. This
does it for the first 10 bugs in the current debbugs list. I could add
an &optional all, but since in my testing Iʼve already accidentally
requested 1000 bugs from the server, that might not be a good idea.

diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el
index bf3ed2cd1..3e16a78a8 100644
--- a/packages/debbugs/debbugs-gnu.el
+++ b/packages/debbugs/debbugs-gnu.el
@@ -1399,6 +1399,29 @@ (defun debbugs-read-emacs-bug-with-rmail (id status 
merged)
     (define-key rmail-mode-map "E" 'debbugs-gnu-make-control-message)
     (rmail-show-message 1)))
 
+(defvar debbugs-gnu-read-bugs-limit 10)
+
+(defun debbugs-gnu-read-current-bugs-with-gnus ()
+  "Create a Gnus group of the messages from the currently shown bugs."
+  (interactive)
+  (unless (eq debbugs-gnu-mail-backend 'gnus)
+    (error "This function only works with Gnus."))
+  (save-excursion
+    (let ((mbox-url (replace-regexp-in-string
+                     ";mboxstat=yes" ""
+                     (alist-get 'emacs gnus-bug-group-download-format-alist)
+                     nil t))
+          ids)
+      (goto-char (point-min))
+      (dotimes (i debbugs-gnu-read-bugs-limit)
+        (push (cdr (assq 'id (tabulated-list-get-id))) ids)
+        (forward-line 1))
+      (setq ids (delete nil (nreverse ids)))
+      (gnus-read-ephemeral-bug-group
+       ids
+       mbox-url)
+      (debbugs-gnu-summary-mode 1))))
+
 (defun debbugs-read-tagged-bugs-with-gnus ()
   "Create an ephemeral Gnus group of locally tagged Emacs bugs."
   (interactive)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]