🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #266021

[Gnus] Applying scores to groups as soon as news is fetched

#266021
From: Benjamin Esham
Date: Mon, 08 May 2023 20:36
48 lines
2602 bytes
Hi all,

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.

This is a bit annoying. I'd like to get Gnus to apply my scores in each
group as soon as it has fetched news.

This is my attempt to get that behavior:

    (defun enter-all-groups-to-force-scoring ()
      (gnus-message 5 "Scoring...")
      (catch 'done-looping
        (let ((seen-newsgroups '())
              (most-recent-newsgroup nil))
          (while t
            (gnus-group-select-group)
            (setq most-recent-newsgroup gnus-newsgroup-name)
            (gnus-summary-exit)
            (if (seq-contains-p seen-newsgroups most-recent-newsgroup)
              (throw 'done-looping nil)
              (setq seen-newsgroups (cons most-recent-newsgroup
                                          seen-newsgroups))))))
      (gnus-message 5 "Scoring... done"))
    
    (add-hook 'gnus-group-prepare-hook
              'enter-all-groups-to-force-scoring)
    (add-hook 'gnus-after-getting-new-news-hook
              'enter-all-groups-to-force-scoring)
    
This seems to work *sometimes*--I can watch as groups that had unread
articles are reduced to zero unread articles. Other times, though, it seems
that scores in a particular group were not applied, and I run into the
sequence of events described at the top of this post.

(This solution also opens the last newsgroup twice, because I wasn't sure
how else to determine that we're done looping through the groups!)

Is there a better way of accomplishing this bit of configuration?

Thanks,

Benjamin

(I also asked this question on the Emacs Stack Exchange site at
<https://emacs.stackexchange.com/q/77110/24262>.)
Technical Details
Message-ID: <rucwqq.ngzfbd@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-mail

Show Full Headers
Complete Article Headers
Message-ID: <rucwqq.ngzfbd@bdesham.net>
Subject: [Gnus] Applying scores to groups as soon as news is fetched
Date: Mon, 08 May 2023 16:36:58 -0400
From: Benjamin Esham <usenet@esham.io>
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
Lines: 48
Cancel-Lock: sha1:2uCduMQLNlKpC9/FI9TMM4vIZos= sha1:IYIdCZ/f3JA++yPwcni5B7C801k=
Content-Type: text/plain
Newsgroups: news.software.readers
User-Agent: Gnus/5.13 (macOS)
Mime-Version: 1.0
Organization: United Federation of Planets