Gnus development mailing list
 help / color / mirror / Atom feed
From: Mike McEwan <mike@lotusland.demon.co.uk>
Subject: Re: Expiry of `headers only' groups
Date: 11 Jul 1998 21:40:23 +0100	[thread overview]
Message-ID: <m3sok8xgso.fsf@lotusland.demon.co.uk> (raw)
In-Reply-To: Mike McEwan's message of "Mon, 06 Jul 1998 17:10:06 +0100"

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


      reply	other threads:[~1998-07-11 20:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-06 16:10 Mike McEwan
1998-07-11 20:40 ` Mike McEwan [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3sok8xgso.fsf@lotusland.demon.co.uk \
    --to=mike@lotusland.demon.co.uk \
    /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.
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).