unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Bochannek <alex@bochannek.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 48801@debbugs.gnu.org
Subject: bug#48801: 28.0.50; [PATCH] Feature suggestion gnus-retrieve-headers check for nov-is-evil when agent is enabled
Date: Sun, 06 Jun 2021 10:51:56 -0700	[thread overview]
Message-ID: <m24keaq3sz.fsf@bochannek.com> (raw)
In-Reply-To: <87zgw3tjvd.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 06 Jun 2021 11:36:38 +0200")

[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Alex Bochannek <alex@bochannek.com> writes:
>
>> What I am trying to achieve is:
>>
>> - Allow limiting and scoring by newsgroup name in an nnvirtual group
>> - Still use caching and agent mode for the nnvirtual and constituent
>>   groups
>>
>> For the second part I simply set `gnus-agent-cache' to non-nil and add
>> the constituent groups to the agent. I didn't see a need to add the
>> virtual group to the agent, because as long as all constituent groups
>> are, I still get caching and agent mode.
>
> Hm...  Am I misreading the patch, then?  This bit:
>
>       ((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)
> ..
>        (gnus-agent-retrieve-headers articles group fetch-old))
>
> seems to disable the agent then gnus-nov-is-evil is set?

The scenario in which this change applies is when the agent is plugged
and when the group is in an agent category. In the case where the
nnvirtual is not in the agent, but the constituent groups are, I want to
not use NOV so I can get the extra headers.

I think your concern is that when `gnus-nov-is-evil' is set globally, it
will effectively disable the agent for everything? Maybe this logic
should reside in `gnus-agent-retrieve-headers' instead?

To address the unbound nov-is-evil for nnvirtual issue, this would work.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1239 bytes --]

diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index 01053797b3..3fe69ec471 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -522,12 +522,18 @@ gnus-close-group
 (defun gnus-retrieve-headers (articles group &optional fetch-old)
   "Request headers for ARTICLES in GROUP.
 If FETCH-OLD, retrieve all headers (or some subset thereof) in the group."
-  (let ((gnus-command-method (gnus-find-method-for-group group)))
+  (let* ((gnus-command-method (gnus-find-method-for-group group))
+         (gnus-method-nov-is-evil (intern
+		                   (format "%s-nov-is-evil"
+                                           (car gnus-command-method)))))
     (cond
      ((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 (and (boundp gnus-method-nov-is-evil)
+                     (symbol-value gnus-method-nov-is-evil))))
       (gnus-agent-retrieve-headers articles group fetch-old))
      (t
       (funcall (gnus-get-function gnus-command-method 'retrieve-headers)

[-- Attachment #3: Type: text/plain, Size: 280 bytes --]

>> P.S.: Is there a better place to discuss this? gmane.emacs.gnus.general?
>
> Sure, but it's very low volume these days, so there's probably not that
> many more people reading that group than the bug list.  :-/

That's unfortunate, I'll stick to the bugs list then.

-- 
Alex.

  reply	other threads:[~2021-06-06 17:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 21:13 bug#48801: 28.0.50; [PATCH] Feature suggestion gnus-retrieve-headers check for nov-is-evil when agent is enabled Alex Bochannek
2021-06-03  7:59 ` Lars Ingebrigtsen
2021-06-03 18:01   ` Alex Bochannek
2021-06-04  9:35     ` Lars Ingebrigtsen
2021-06-04 17:40       ` Alex Bochannek
2021-06-06  9:36         ` Lars Ingebrigtsen
2021-06-06 17:51           ` Alex Bochannek [this message]
2021-06-08  9:57             ` Lars Ingebrigtsen
2021-06-08 15:50               ` Alex Bochannek
2021-06-09  5:35               ` Alex Bochannek
2021-06-09  9:59                 ` Lars Ingebrigtsen
2021-06-09 18:05                   ` Alex Bochannek
2021-06-09 18:14                     ` Eli Zaretskii
2021-06-09 18:47                       ` Alex Bochannek
2021-06-09 18:55                         ` Eli Zaretskii
2021-06-09 19:04                           ` Alex Bochannek
2021-06-12 12:10                         ` Lars Ingebrigtsen
2021-06-12 17:49                           ` Alex Bochannek

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=m24keaq3sz.fsf@bochannek.com \
    --to=alex@bochannek.com \
    --cc=48801@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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).