Gnus development mailing list
 help / color / mirror / Atom feed
* Re: (feature request) Note scoring BEFORE entry to group
       [not found] <m3r8g9zkva.fsf_-_@fischman.org>
@ 2002-09-05 22:55 ` Jesper Harder
  2002-09-06  6:05   ` Ami Fischman
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Harder @ 2002-09-05 22:55 UTC (permalink / raw)


Ami Fischman <usenet@fischman.org> writes:

> As such, there is one feature I wish gnus had that I don't think it
> does: from the *Group* buffer, loop over all groups that have adaptive
> scoring turned on, enter the group, exit the group.  This would have
> the effect of "hiding" the articles that are scored down, both from
> the new message count in the *Group* buffer, and from the summary
> buffer (once I enter it).
>
> I suppose I could code this myself if I knew how to loop over all
> groups with adaptive scoring on (or even "how to loop over all groups
> from nntp", or even "how to loop over all groups").  What is the gnus
> function/variable I want here?

I don't use adaptive scoring, so this is completely untested -- but it
should give you an idea about how you could do it:

(dolist (group gnus-newsrc-alist)  ; loop over all groups
  (when (and 
	 ;; Does it use adaptive scoring?
	 (assoc 'gnus-use-adaptive-scoring (gnus-info-params group))  
	 ;; Are there any unread messages?
	 (> (gnus-group-unread (gnus-info-group group)) 0))
    ;; Enter the group
    (gnus-summary-read-group (gnus-info-group group) nil t nil t)
    ;; and exit
    (gnus-summary-exit)))

This assumes that you turn on adaptive scoring in the group parameters.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: (feature request) Note scoring BEFORE entry to group
  2002-09-05 22:55 ` (feature request) Note scoring BEFORE entry to group Jesper Harder
@ 2002-09-06  6:05   ` Ami Fischman
  0 siblings, 0 replies; 2+ messages in thread
From: Ami Fischman @ 2002-09-06  6:05 UTC (permalink / raw)


Jesper Harder <harder@ifa.au.dk> writes:

> I don't use adaptive scoring, so this is completely untested -- but it
> should give you an idea about how you could do it:

Ah!  That answered several implicit questions I had.  Thanks! 

Your snippet almost worked for me.  The snags were:
- Adaptive scoring isn't turned on in group params for me; rather, it is
  just enabled in ~/.gnus and gnus does the right thing (doesn't score mail
  groups).
- Had to force creation of the summary buffer (last arg to
  gnus-summary-read-group) or else the count in the *Group* buffer doesn't
  change on exit (defeating the whole purpose)
- I found it was doing unsub'd groups as well, so now I check that the
  group in question is of level 4 or below before entering it.

I added this function to an "after" defadvice for get-new-news and it seems
to work for me now.  Including the function after my .sig in case anyone
else wants to use it.

Thanks again,
-- 
  Ami Fischman
  usenet@fischman.org

(defun innout ()
  "Enter and exit every group, so that any articles that
   have been adaptive-scored low enough to have a 'Y' mark 
   won't be there when I enter manually, plus the article
   count will reflect the # of articles I actually might
   want to read."
  (interactive)
  (dolist (group gnus-newsrc-alist)  ; loop over all groups
    (when (and 
	   ;; Only apply to NNTP groups (only ones which do scoring)
	   (string-match "^nntp\\+" (gnus-info-group group))
	   ;; Is this group really subscribed?
	   (< (gnus-group-level (gnus-info-group group)) 5)
	   ;; Are there any unread messages?
	   (> (gnus-group-unread (gnus-info-group group)) 0))
      ;; Enter the group (must create the summary buffer or else
      ;; on exit the counts aren't updated
      (gnus-summary-read-group (gnus-info-group group) nil t nil nil)
      ;; and exit
      (gnus-summary-exit))))




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-06  6:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m3r8g9zkva.fsf_-_@fischman.org>
2002-09-05 22:55 ` (feature request) Note scoring BEFORE entry to group Jesper Harder
2002-09-06  6:05   ` Ami Fischman

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 NNTP newsgroup(s).