Article View: news.software.readers
Article #266037Re: [Gnus] Applying scores to groups as soon as news is fetched
From: Benjamin Esham
Date: Tue, 16 May 2023 19:32
Date: Tue, 16 May 2023 19:32
54 lines
2905 bytes
2905 bytes
issdr wrote:
> Benjamin Esham wrote:
>
>> I have a fairly large killfile. Frequently, Gnus fetches the news and
>> shows me that there are groups with unread messages, but when I try to
>> go into one of those groups, Gnus fetches more information and
>> realizes that all of the unread articles have been scored down below
>> the threshold of being visible.
>
> did you try `M-x g-ba-s' from group buffer?
I had not tried that, thank you! (The full name is gnus-batch-score, for my
future reference.) I tried to run that function automatically with
(add-hook 'gnus-started-hook 'gnus-batch-score)
(add-hook 'gnus-after-getting-new-news-hook 'gnus-batch-score)
but that didn't seem to work: there was a very long delay after I started
Gnus--maybe as long as a minute--but still not all of my scores had been
applied.
I went into the Gnus source and extracted the "main part" of that function,
which is
(let (info group newsrc unread)
(setq newsrc (cdr gnus-newsrc-alist))
(while (setq info (pop newsrc))
(setq group (gnus-info-group info)
unread (gnus-group-unread group))
(when (and (<= (gnus-info-level info) gnus-level-subscribed)
(and unread
(or (eq unread t)
(not (zerop unread)))))
(ignore-errors
(gnus-summary-read-group group nil t nil t))
(when (eq (current-buffer) (get-buffer gnus-summary-buffer))
(gnus-summary-exit)))))
and found that if I ran this interactively (at the M-: prompt) after news
had been fetched, then the scores would really, truly be applied. This is
promising! Now I just need to put the code back into a function and figure
out exactly when and how to call it in order to make all of this automatic.
> if that was not what you had in mind, you could also post on
> <nntp://news.eternal-september.org/gnu.emacs.gnus>.
I'm pretty sure I've posted in that group before, and yet Gnus is telling me
that it doesn't exist on the server. But that will be a separate thing to
debug...
Thanks,
Benjamin
Technical Details
Message-ID:
<rurn21.lz09lt@bdesham.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<rucwqq.ngzfbd@bdesham.net> <87bkiuvzhu.fsf@ID-313311.news.uni-berlin.de>Show Full Headers
Complete Article Headers
Message-ID: <rurn21.lz09lt@bdesham.net> Subject: Re: [Gnus] Applying scores to groups as soon as news is fetched Date: Tue, 16 May 2023 15:32:20 -0400 From: Benjamin Esham <usenet@esham.io> References: <rucwqq.ngzfbd@bdesham.net> <87bkiuvzhu.fsf@ID-313311.news.uni-berlin.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Newsgroups: news.software.readers Organization: United Federation of Planets Lines: 54 Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (macOS) Cancel-Lock: sha1:mbIj7OE6PjEiW6X9wKkTI+RJMw4= sha1:PYLKKKuSQ42tfiNn+jYgzdPHIPg=