From: Robert Pluim <rpluim@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Eric Abrahamsen <eric@ericabrahamsen.net>,
Lars Ingebrigtsen <larsi@gnus.org>,
dick.r.chiang@gmail.com, emacs-devel@gnu.org
Subject: Re: bug#38136: [PATCH] Make gnus-group-get-new-news a non blocking thread
Date: Fri, 22 Nov 2019 12:15:48 +0100 [thread overview]
Message-ID: <m2o8x4go0r.fsf@gmail.com> (raw)
In-Reply-To: <87ftigia86.fsf@gmx.de> (Michael Albinus's message of "Fri, 22 Nov 2019 09:30:49 +0100")
[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]
>>>>> On Fri, 22 Nov 2019 09:30:49 +0100, Michael Albinus <michael.albinus@gmx.de> said:
>> +(defvar debbugs-gnu-read-bugs-limit 10)
Michael> I would make it a defcustom. Maybe we need also another defconst, which
Michael> is the upper limit this user option can be. Something like 50, or 100.
If we make it a defcustom we can encode checking the max in the
defcustom form.
Michael> That works so far for me, thanks. What I'm missing is handling of merged
Michael> bugs. That is, if a bug in a line shows also merged bug numbers.
Yes, done.
Michael> We would need also a command debbugs-gnu-read-current-bugs and key
Michael> bindings for this. Just to be prepared for a possible
Michael> debbugs-gnu-read-current-bugs-with-rmail.
I chose 'A' for 'A'll, and did some renaming. Suggestions welcome.
Michael> If this is too much for your limited time, commit what you have, and I
Michael> will adapt the final bits then.
"You get what anybody gets: you get a lifetime" :-)
>> (defun debbugs-read-tagged-bugs-with-gnus ()
>> "Create an ephemeral Gnus group of locally tagged Emacs bugs."
Michael> I believe, this one is not needed anymore. A list with locally tagged
Michael> bugs is created now easily via debbugs-gnu-tagged. And there you call
Michael> debbugs-gnu-read-current-bugs.
Yes, it was left over, Iʼve removed it.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-command-to-show-mailboxes-for-all-currently-show.patch --]
[-- Type: text/x-patch, Size: 4950 bytes --]
From 2378e7a1529fa372c1bc9aee0373b380df6602a2 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Fri, 22 Nov 2019 11:49:27 +0100
Subject: [PATCH] Add command to show mailboxes for all currently shown reports
* debbugs-gnu.el (debbugs-gnu-mode-map): Add binding for debbugs-gnu-select-current-bugs.
(debbugs-gnu-select-bugs-limit-max): New defconst. Max for debbugs-gnu-select-bugs-limit.
(debbugs-gnu-select-bugs-limit): New defcustom. Limits how many bugs
debbugs-gnu-select-current-bugs will retrieve.
(debbugs-gnu-select-current-bugs): New function. Shows mailboxes
for all currently shown bugs.
(debbugs-gnu-select-current-bugs-with-gnus): Implementation of mailbox
retrieval using Gnus.
* debbugs-ug.texi (Tabulated Lists): Add description of debbugs-gnu-select-current-bugs.
---
packages/debbugs/debbugs-gnu.el | 48 +++++++++++++++++++++++++++++++-
packages/debbugs/debbugs-ug.texi | 8 ++++++
2 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el
index 303b62557..a4755694d 100644
--- a/packages/debbugs/debbugs-gnu.el
+++ b/packages/debbugs/debbugs-gnu.el
@@ -971,6 +971,7 @@ (defvar debbugs-gnu-mode-map
(set-keymap-parent map tabulated-list-mode-map)
(define-key map "\r" 'debbugs-gnu-select-report)
(define-key map [mouse-2] 'debbugs-gnu-select-report)
+ (define-key map "A" 'debbugs-gnu-select-current-bugs)
(define-key map "g" 'debbugs-gnu-rescan)
(define-key map "R" 'debbugs-gnu-show-all-blocking-reports)
(define-key map "C" 'debbugs-gnu-send-control-message)
@@ -990,10 +991,14 @@ (defvar debbugs-gnu-mode-map
(define-key menu-map [debbugs-gnu-select-report]
'(menu-item "Show Reports" debbugs-gnu-select-report
:help "Show all reports belonging to this bug"))
+ (define-key-after menu-map [debbugs-gnu-select-current]
+ '(menu-item "Show Reports For All" debbugs-gnu-select-current-bugs
+ :help "Show reports for all currently shown bugs")
+ 'debbugs-gnu-select-report)
(define-key-after menu-map [debbugs-gnu-rescan]
'(menu-item "Refresh Bugs" debbugs-gnu-rescan
:help "Refresh bug list")
- 'debbugs-gnu-select-report)
+ 'debbugs-gnu-select-current)
(define-key-after menu-map [debbugs-gnu-show-all-blocking-reports]
'(menu-item "Show Release Blocking Bugs"
debbugs-gnu-show-all-blocking-reports
@@ -1399,6 +1404,47 @@ (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)))
+(defconst debbugs-gnu-select-bugs-limit-max 50)
+(defcustom debbugs-gnu-select-bugs-limit 10
+ "Maximum number of bugs to retrieve for Gnus group.
+This applies for `debbugs-gnu-select-current-bugs.
+Maximum allowed value is 50 to avoid overloading the server."
+ :type '(integer
+ :validate
+ (lambda (widget)
+ (unless (<= 1
+ (widget-value widget)
+ debbugs-gnu-select-bugs-limit-max)
+ (widget-put widget :error
+ "Invalid value: range is 1..50"))))
+ :version "27.1")
+
+(defun debbugs-gnu-select-current-bugs ()
+ "Retrieve the mailboxes for all currently shown bugs.
+Limited by `debbugs-gnu-select-bugs-limit'."
+ (interactive)
+ (unless (eq debbugs-gnu-mail-backend 'gnus)
+ (error "This function only works with Gnus."))
+ (debbugs-gnu-select-current-bugs-with-gnus))
+
+(defun debbugs-gnu-select-current-bugs-with-gnus ()
+ "Create a Gnus group of the messages from the currently shown bugs."
+ (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-select-bugs-limit)
+ (push (debbugs-gnu-current-id t) ids)
+ (push (cdr (assq 'mergedwith (debbugs-gnu-current-status))) ids)
+ (forward-line 1))
+ (setq ids (delete nil (nreverse ids)))
+ (gnus-read-ephemeral-bug-group ids mbox-url)
+ (debbugs-gnu-summary-mode 1))))
+
(defcustom debbugs-gnu-lars-workflow nil
"If non-nil, set some Gnus vars as preferred by Lars."
:type 'boolean
diff --git a/packages/debbugs/debbugs-ug.texi b/packages/debbugs/debbugs-ug.texi
index 8121f7bf8..6e86194e5 100644
--- a/packages/debbugs/debbugs-ug.texi
+++ b/packages/debbugs/debbugs-ug.texi
@@ -373,6 +373,14 @@
Show the email messages that discuss the bug.
@* @item
+@kindex @kbd{A}
+@kbd{A} @tab
+@code{debbugs-gnu-select-current-bugs} @*
+Show the email messages for all currently displayed messages
+(including merged reports). Limited by user option
+@code{debbugs-gnu-select-bugs-limit}.
+
+@item
@kindex @kbd{d}
@kbd{d} @tab
@code{debbugs-gnu-display-status} @*
--
2.24.0.155.gd9f6f3b619
next prev parent reply other threads:[~2019-11-22 11:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87imnu1knq.fsf@dick>
[not found] ` <87r22h7mka.fsf@ericabrahamsen.net>
[not found] ` <87sgmrouxk.fsf@gnus.org>
[not found] ` <8736emaxw6.fsf@ericabrahamsen.net>
[not found] ` <87sgmlsgxx.fsf@gnus.org>
[not found] ` <87zhgsncno.fsf@ericabrahamsen.net>
[not found] ` <87lfscesen.fsf@dick>
[not found] ` <871ru4n58t.fsf@ericabrahamsen.net>
[not found] ` <m21ru4p3t8.fsf@gmail.com>
[not found] ` <87ftijdcay.fsf@ericabrahamsen.net>
[not found] ` <874kyykd8b.fsf@gnus.org>
[not found] ` <87sgmiyd6m.fsf@gmx.de>
[not found] ` <m2pnhmwwo7.fsf@gmail.com>
[not found] ` <87pnhmwvmz.fsf@gmx.de>
2019-11-20 13:31 ` bug#38136: [PATCH] Make gnus-group-get-new-news a non blocking thread Robert Pluim
2019-11-20 13:43 ` Michael Albinus
2019-11-20 14:18 ` Robert Pluim
2019-11-20 14:30 ` Michael Albinus
2019-11-20 17:31 ` Robert Pluim
2019-11-20 17:45 ` Michael Albinus
2019-11-20 16:42 ` Eric Abrahamsen
2019-11-20 16:58 ` Robert Pluim
2019-11-20 17:01 ` Michael Albinus
2019-11-20 17:24 ` Robert Pluim
2019-11-20 17:34 ` Michael Albinus
2019-11-20 17:42 ` Robert Pluim
2019-11-20 17:51 ` Michael Albinus
2019-11-20 17:53 ` Robert Pluim
2019-11-20 18:22 ` Michael Albinus
2019-11-20 18:43 ` Eric Abrahamsen
2019-11-20 19:29 ` Robert Pluim
2019-11-20 16:59 ` Michael Albinus
2019-11-20 17:28 ` Robert Pluim
2019-11-20 17:43 ` Michael Albinus
2019-11-20 17:51 ` Robert Pluim
2019-11-20 17:59 ` Michael Albinus
2019-11-21 11:52 ` Lars Ingebrigtsen
2019-11-21 12:46 ` Michael Albinus
2019-11-21 13:03 ` Lars Ingebrigtsen
2019-11-21 14:54 ` Michael Albinus
2019-11-21 16:39 ` Robert Pluim
2019-11-22 8:30 ` Michael Albinus
2019-11-22 11:15 ` Robert Pluim [this message]
2019-11-22 11:41 ` Michael Albinus
2019-11-22 14:13 ` Robert Pluim
2019-11-22 16:33 ` Michael Albinus
2019-11-24 11:09 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2o8x4go0r.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=dick.r.chiang@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=eric@ericabrahamsen.net \
--cc=larsi@gnus.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).