From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alex Bochannek Newsgroups: gmane.emacs.bugs Subject: bug#48801: 28.0.50; [PATCH] Feature suggestion gnus-retrieve-headers check for nov-is-evil when agent is enabled Date: Wed, 02 Jun 2021 14:13:21 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6130"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) To: 48801@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 02 23:15:54 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loYDR-0001Rw-MR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Jun 2021 23:15:53 +0200 Original-Received: from localhost ([::1]:34282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loYDQ-0002Fc-Iu for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Jun 2021 17:15:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loYCc-0001lA-GD for bug-gnu-emacs@gnu.org; Wed, 02 Jun 2021 17:15:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1loYCc-00058F-7o for bug-gnu-emacs@gnu.org; Wed, 02 Jun 2021 17:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1loYCc-0000qC-2f for bug-gnu-emacs@gnu.org; Wed, 02 Jun 2021 17:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Jun 2021 21:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48801 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16226684463146 (code B ref -1); Wed, 02 Jun 2021 21:15:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Jun 2021 21:14:06 +0000 Original-Received: from localhost ([127.0.0.1]:41453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loYBi-0000og-0C for submit@debbugs.gnu.org; Wed, 02 Jun 2021 17:14:06 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1loYBg-0000oY-At for submit@debbugs.gnu.org; Wed, 02 Jun 2021 17:14:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loYBe-0008Bn-HN for bug-gnu-emacs@gnu.org; Wed, 02 Jun 2021 17:14:03 -0400 Original-Received: from ns.lapseofthought.com ([50.0.39.240]:5900 helo=mail.lapseofthought.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loYBc-0004Sl-JG for bug-gnu-emacs@gnu.org; Wed, 02 Jun 2021 17:14:02 -0400 Original-Received: from awb-mbp.local (unknown [IPv6:2601:646:4200:b470:447b:3183:4f61:c8c2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lapseofthought.com (Postfix) with ESMTPSA id 4FwMFZ4MJmz3pkkP for ; Wed, 2 Jun 2021 14:13:22 -0700 (PDT) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com Received-SPF: pass client-ip=50.0.39.240; envelope-from=alex@bochannek.com; helo=mail.lapseofthought.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207881 Archived-At: --=-=-= Content-Type: text/plain Hello! I am trying to solve the following problem: Using nnvirtual groups that are made up of several nntp newsgroups I would like to limit by `Newsgroups' when in the nnvirtual. From reading the code, it appears that this means I cannot use NOV because then the extra headers list won't be generated. I can set `nov-is-evil' and this works. Except when I am also using agent mode, in which case it will always use the NOV. The below patch is a work in progress and doesn't entirely work yet, but I wanted to share it early before I spend more time on it. The following questions have come up for me: 1) Is there a different way to solve this problem? Specifically, is there a better way to limit by newsgroup when in an nnvirtual group? 2) Is it possible to set `nntp-nov-is-evil' as a group parameter? It looks like header retrieval may be too early for this and I may need to use a hook? 3) How would this approach interact with the local cache? I have not looked at this path yet. Thanks! --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 01053797b3..d2d7fd55ae 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -527,7 +527,11 @@ gnus-retrieve-headers ((and gnus-use-cache (numberp (car articles))) (gnus-cache-retrieve-headers articles group fetch-old)) ((and gnus-agent (gnus-online gnus-command-method) - (gnus-agent-method-p gnus-command-method)) + (gnus-agent-method-p gnus-command-method) + (not gnus-nov-is-evil) + (not (symbol-value + (intern + (format "%s-nov-is-evil" (car gnus-command-method)))))) (gnus-agent-retrieve-headers articles group fetch-old)) (t (funcall (gnus-get-function gnus-command-method 'retrieve-headers) --=-=-= Content-Type: text/plain -- Alex. --=-=-=--