From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: bug#38136: [PATCH] Make gnus-group-get-new-news a non blocking thread Date: Fri, 22 Nov 2019 12:15:48 +0100 Message-ID: References: <87imnu1knq.fsf@dick> <8736emaxw6.fsf@ericabrahamsen.net> <87sgmlsgxx.fsf@gnus.org> <87zhgsncno.fsf@ericabrahamsen.net> <87lfscesen.fsf@dick> <871ru4n58t.fsf@ericabrahamsen.net> <87ftijdcay.fsf@ericabrahamsen.net> <874kyykd8b.fsf@gnus.org> <87sgmiyd6m.fsf@gmx.de> <87pnhmwvmz.fsf@gmx.de> <87y2wavf1p.fsf@gmx.de> <875zjd5tv7.fsf@gnus.org> <87zhgpjt1m.fsf@gmx.de> <87d0dl2xgr.fsf@gnus.org> <87d0dluvp3.fsf@gmx.de> <87ftigia86.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="170348"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eric Abrahamsen , Lars Ingebrigtsen , dick.r.chiang@gmail.com, emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 22 12:17:20 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iY6wB-000i7C-2S for ged-emacs-devel@m.gmane.org; Fri, 22 Nov 2019 12:17:19 +0100 Original-Received: from localhost ([::1]:49644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iY6w9-0006Hv-JT for ged-emacs-devel@m.gmane.org; Fri, 22 Nov 2019 06:17:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38476) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iY6ut-0006B8-CZ for emacs-devel@gnu.org; Fri, 22 Nov 2019 06:16:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iY6ur-0000bN-EF for emacs-devel@gnu.org; Fri, 22 Nov 2019 06:15:59 -0500 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:46128) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iY6un-0000aG-Ey for emacs-devel@gnu.org; Fri, 22 Nov 2019 06:15:55 -0500 Original-Received: by mail-wr1-x432.google.com with SMTP id z7so4721514wrl.13 for ; Fri, 22 Nov 2019 03:15:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=PvteaOhqF+u1ie+DQElWUknGI+biyyqHzkZQbEGakak=; b=gfNJlnCBBtp1YBnadNoUtgbDAndSzrNcT/f1spqsouz1pruQXkbpqj5fQYW1k6kfbb Yt0/m9cXH68+yCCnAM+DV+fvZrHpSm5lkvL0GBCJc0eCRIpUKHbL+cHHC4WmantvwdmZ LNGb1lUbBgtbcIyDuUfejyZj8K3QKFEYebecr44CbveB58a4HUHP1Ivui9GvhBosS3pl BDtKx9u61m2znicRb5FI98agV/LI2TpHh63URCm9eXBO9ngEb0IqvL9r7lc0s02uFG9F D85T6IWeaf9BoBE3Y3N29eVk+RMtKMp2JLJBR0J3QWqAc3nsGkf3lJAJ9ta7o8p9sBlV G31A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=PvteaOhqF+u1ie+DQElWUknGI+biyyqHzkZQbEGakak=; b=cB8cYgBlAscFeb4fhKcKYsjlOVGOyfZ0ocg4JATIt6E1Ubb3BK00YYfSK1XzN8PVxe IocGKnRVSa3BUglMHI1MvteTVKtKPCmgZPL7uLWkIOAzK8RY55uRifFRvp+bPk57em9P 3qQOeD49RvLW+5DCOul/8cI8vqa/iORIunu6H2sWHTF59vyZlK0wAq/lB5rymm7Bbwef gqfca8+F+Y8dSHAnqhndQ8SCMFtn0uLLWslgdWzdEiqtNY7EpSmaYiCe5JB7tpfp0z1y /G/Dhw+ixiMnq1o4KuyXCWc5edY0TNDSaGWGgo6pf0bW7Y1Y3uw0sC4tLyTZLVuMZi6x Eiqw== X-Gm-Message-State: APjAAAVD2QCE5ERYKZjaKxumkBxjF/2cqqQzuxehwYE7Y8LdeiabWWGx JYTC4WUDMm59+qGDVN37JEY6rbic X-Google-Smtp-Source: APXvYqwMo3CqEa5qeG4MQdq+Ph+77heODhzq/pXtTc49e/KsqAP790/JZRc9fjXTDS0/feXKoVzarQ== X-Received: by 2002:a5d:558e:: with SMTP id i14mr16905254wrv.140.1574421350698; Fri, 22 Nov 2019 03:15:50 -0800 (PST) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id x8sm3052015wmi.10.2019.11.22.03.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 03:15:49 -0800 (PST) In-Reply-To: <87ftigia86.fsf@gmx.de> (Michael Albinus's message of "Fri, 22 Nov 2019 09:30:49 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:242617 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> On Fri, 22 Nov 2019 09:30:49 +0100, Michael Albinus said: >> +(defvar debbugs-gnu-read-bugs-limit 10) Michael> I would make it a defcustom. Maybe we need also another defcon= st, 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 number= s. 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 hav= e, 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 y= ou call Michael> debbugs-gnu-read-current-bugs. Yes, it was left over, I=CA=BCve removed it. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-command-to-show-mailboxes-for-all-currently-show.patch >From 2378e7a1529fa372c1bc9aee0373b380df6602a2 Mon Sep 17 00:00:00 2001 From: Robert Pluim 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 --=-=-=--