Gnus development mailing list
 help / color / mirror / Atom feed
* Expiry of `headers only' groups
@ 1998-07-06 16:10 Mike McEwan
  1998-07-11 20:40 ` Mike McEwan
  0 siblings, 1 reply; 2+ messages in thread
From: Mike McEwan @ 1998-07-06 16:10 UTC (permalink / raw)



  Wehey, I can get through to gnus.org again!

  A small change at my ISP (or somewhere) resulted in my earlier posts
  on this subject evapourating into the ether somehow, so here goes
  again:

  "Well `gnus-agent-expire' seems to be working a bit better these days
  (apart from the occasional partial NOV line in my .overviews). One
  last things I wished expiry processing would handle was the
  expiration of headers in groups where I *only* download headers,
  specifically marking articles for download when they seem of
  interest. As it stood `gnus-agent-expire' would only expire headers
  if I happened to have downloaded at least one article in such
  groups. This is usually fine, but I was getting thousands of headers
  accumulating in high activity groups (e.g. comp.lang.c) where I
  hadn't downloaded an article for a while. The number of group
  headers would get so large that I found myself reluctant to select
  these groups from the group buffer because it took so long to
  prepare the summary buffer, adding to the problem :-).

  The following patch inserts a line in the Agent history file for
  each group, detailing the last header downloaded for a group in a
  given session. Come expiry time, headers are now expired even if no
  articles have been downloaded. My `headers only' groups are now a
  little more manageable."

  I could have it so that such the `last-fetched' lines were only
  inserted into the history file where the download predicate for a
  given group was `false', but I was unsure as to what other weird and
  wonderful predicates people may have out there.

-- 
Mike.

--- ChangeLog.orig	Wed Jul  1 12:34:41 1998
+++ ChangeLog	Sun Jul  5 15:18:18 1998
@@ -1,3 +1,8 @@
+1998-07-05  Mike McEwan  <mike@lotusland.demon.co.uk>
+
+	* gnus-agent.el (gnus-agent-fetch-headers): Note last fetched
+	headers per sesion to aid expiry in `headers only' groups.
+
 Wed Jul  1 13:33:26 1998  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
 	* gnus.el: Gnus v5.6.23 is released.
--- gnus-agent.el.orig	Wed Jul  1 12:34:42 1998
+++ gnus-agent.el	Sun Jul  5 17:38:54 1998
@@ -769,8 +769,11 @@
 	  (gnus-make-directory (nnheader-translate-file-chars
 				(file-name-directory file)))
 	  (write-region (point-min) (point-max) file nil 'silent)
-	  (gnus-agent-save-alist group articles nil))
-	t))))
+	  (gnus-agent-save-alist group articles nil)
+	  (gnus-agent-enter-history "last-header-fetched-for-session"
+				    (list (cons group (nth (- (length  articles) 1) articles)))
+				    (gnus-time-to-day (current-time)))
+	t)))))
 
 (defsubst gnus-agent-copy-nov-line (article)
   (let (b e)


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

* Re: Expiry of `headers only' groups
  1998-07-06 16:10 Expiry of `headers only' groups Mike McEwan
@ 1998-07-11 20:40 ` Mike McEwan
  0 siblings, 0 replies; 2+ messages in thread
From: Mike McEwan @ 1998-07-11 20:40 UTC (permalink / raw)


  My mails are finally getting through! This is a followup to my
  earlier posting. I posted it to gnus.emacs.gnus as nothing seemed to
  be getting through to this list:

Mike McEwan <mike@lotusland.demon.co.uk> writes:

  Here I go yet again. I'm posting this here because of the problems
  I've been having trying to get through to gnus.org. Not to mention a
  few problems of my own I've been having with mail delivery.

  The following is the text of an earlier post I've been trying to
  make. If these postings manage to get to gnus.org, then I apologise
  if this is the umpteenth time you've cast your eyes over these
  ramblings.


  "Well `gnus-agent-expire' seems to be working a bit better these days
  (apart from the occasional partial NOV line in my .overviews). One
  last things I wished expiry processing would handle was the
  expiration of headers in groups where I *only* download headers,
  specifically marking articles for download when they seem of
  interest. As it stood `gnus-agent-expire' would only expire headers
  if I happened to have downloaded at least one article in such
  groups. This is usually fine, but I was getting thousands of headers
  accumulating in high activity groups (e.g. comp.lang.c) where I
  hadn't downloaded an article for a while. The number of group
  headers would get so large that I found myself reluctant to select
  these groups from the group buffer because it took so long to
  prepare the summary buffer, adding to the problem :-).

  The following patch inserts a line in the Agent history file for
  each group, detailing the last header downloaded for a group in a
  given session. Come expiry time, headers are now expired even if no
  articles have been downloaded. My `headers only' groups are now a
  little more manageable.

  I could have it so that such the `last-fetched' lines were only
  inserted into the history file where the download predicate for a
  given group was `false', but I was unsure as to what other weird and
  wonderful predicates people may have out there."

  
  In addition to the above, whilst waiting for my mailings to get
  through :-), I've now consolidated my previous patch with another
  that hopefully prevents the re-fetching of headers and articles
  after running `gnus-agent-expire'. After expiring, unless you
  selected every group covered by the Agent in which expiry had taken
  place, the group info was not updated. This explains many of the
  probs I've been having with NOV lines being out of sequence in my
  .overview files, not to mention the large number of articles I was
  downloading a second time. I'm not sure as yet, but it may cure
  another problem I've been having with partial NOV lines appearing in
  my .overviews after an expire. The `partial NOV lines always
  appeared in or around the point in a .overview where the articles
  went out of sequence with re-downloaded headers.

  The (consolidated) patch follows below. Feel free to hack around
  with it, I'm still learning this elisp stuff.

-- 
Mike.

--- ChangeLog.orig	Wed Jul  1 12:34:41 1998
+++ ChangeLog	Sat Jul 11 19:25:27 1998
@@ -1,3 +1,12 @@
+1998-07-11  Mike McEwan  <mike@lotusland.demon.co.uk>
+
+	* gnus-agent.el (gnus-agent-fetch-headers): Note last fetched
+ 	headers per sesion to aid expiry in `headers only' groups.
+
+	* gnus-agent.el (gnus-agent-expire): Update group info to add
+ 	expired articles to list of read articles and prevent
+	re-fetching. 
+
 Wed Jul  1 13:33:26 1998  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
 	* gnus.el: Gnus v5.6.23 is released.
--- gnus-agent.el.orig	Wed Jul  1 12:34:42 1998
+++ gnus-agent.el	Sat Jul 11 17:05:02 1998
@@ -769,8 +769,11 @@
 	  (gnus-make-directory (nnheader-translate-file-chars
 				(file-name-directory file)))
 	  (write-region (point-min) (point-max) file nil 'silent)
-	  (gnus-agent-save-alist group articles nil))
-	t))))
+	  (gnus-agent-save-alist group articles nil)
+	  (gnus-agent-enter-history "last-header-fetched-for-session"
+				    (list (cons group (nth (- (length  articles) 1) articles)))
+				    (gnus-time-to-day (current-time)))
+	t)))))
 
 (defsubst gnus-agent-copy-nov-line (article)
   (let (b e)
@@ -1352,8 +1355,17 @@
 		     (setcdr prev (setq alist (cdr alist)))
 		   (setq prev alist
 			 alist (cdr alist))))
-	       (setq gnus-agent-article-alist (cdr first)))
-	     (gnus-agent-save-alist group))
+	       (setq gnus-agent-article-alist (cdr first))
+	       ;;; Mark all articles up to the first article
+	       ;;; in `gnus-article-alist' as read.
+	       (setcar (nthcdr 2 info)
+		       (gnus-range-add
+			(nth 2 info) (cons 1 (- (caar gnus-agent-article-alist) 1))))
+	       (gnus-dribble-enter
+		(concat "(gnus-group-set-info '"
+			(gnus-prin1-to-string info)
+			")"))
+	       (gnus-agent-save-alist group)))
 	   expiry-hashtb)
 	  (set-buffer history)
 	  (setq histories (nreverse (sort histories '<)))


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

end of thread, other threads:[~1998-07-11 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-06 16:10 Expiry of `headers only' groups Mike McEwan
1998-07-11 20:40 ` Mike McEwan

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).