Gnus development mailing list
 help / color / mirror / Atom feed
From: Mike McEwan <mike@lotusland.demon.co.uk>
Subject: Re: Garbled .overviews with 5.6.11?
Date: 30 Jun 1998 01:28:56 +0100	[thread overview]
Message-ID: <m390mfu3zr.fsf@lotusland.demon.co.uk> (raw)
In-Reply-To: Lars Magne Ingebrigtsen's message of "27 Jun 1998 04:28:29 +0200"

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Yes -- all NOV lines that are older than the newest expirable
> article and have no downloaded article are removed.

Well my `old' NOV lines still didn't appear to be getting deleted. I
think I may have discovered the problem. At least I reckon I'm
getting something like the desired effect now, but, with my elisp
still being a little on the simple side, I'm not entirely sure I'm
tackling things in the right way.

Here's the text of an earlier posting I made to the list:

"I have a secondary server `(nntp "sunsite.auc.dk")' covered under
the agent. However, when conducting a `gnus-agent-expire' I get:

File error: "Opening output file", "No such file or directory",
"/home/mike/News/agent/nntp/sunsite.auc.dk/gnu/emacs/gnus/.overview"

It would appear that, having finished expiring articles for my
primary select method (via which I subscribe to gnu.emacs.gnus), a
variable's value is perhaps not being reset to an appropriate value.

I've tried to track it down, but I can only verify that `sym'
evaluates to `gnu\.emacs\.gnus' at the time of the error in
`gnus-agent-expire'. I only subscribe to this group on my primary
server, which, at the time of error, has already had its articles
successfully expired."

I think what I'm accomplishing in the patch below is to create a
fresh `expiry-hashtb' when (and if) `(setq gnus-command-method (pop
methods))' moves on to another select method as is the case with
me. Gnus certainly doesn't barf as before when moving on to the
secondary server I have covered by the Agent.

A second problem, for me at least, was that the NOV lines in my
.overview files were not always in sequence (not really sure why yet,
apart from whatever headers are downloaded appear to simply be
appended to the end of a .overview file, regardless of their article
numbers). This means that `gnus-agent-expire' could not always delete
"all NOV lines that are older than the newest expirable article" as it
was not encountering old articles before new. Anyways, to remedy this
I've stuck in a `sort-numeric-fields' before the NOV lines are
expired. This is what I'm least sure about. could this be accomplished
in a more efficient way? Do I indeed, want to do it?

Despite the above, old NOV lines without articles were still *not*
being deleted, and so, after a spell with edebug, I reckoned the the
line:
 
(if (file-exists-p                              
     (gnus-agent-article-name                   		 
      (number-to-string article) group))        
    (forward-line 1)                            
  ;; Remove old NOV lines that have no articles.
  (gnus-delete-line)))                          

was never resulting in a non-existent article file. Shouldn't it
perhaps be `(number-to-string art) group))'. Seems to work for me.

Anyways, see what you think of the patch below. Still get one or two
of those `partial' NOV lines though :-(.

P.S. What's with this new paragraph fill mode - `M-q' doesn't seem to
let me indent the first line of a paragraph anymore?
    
-- 
Mike.

--- /usr/lib/xemacs/site-lisp/gnus/lisp/gnus-agent.el.orig	Mon Jun  1 03:30:14 1998
+++ /usr/lib/xemacs/site-lisp/gnus/lisp/gnus-agent.el	Mon Jun 29 23:31:49 1998
@@ -1254,13 +1254,13 @@
   (interactive)
   (let ((methods gnus-agent-covered-methods)
 	(day (- (gnus-time-to-day (current-time)) gnus-agent-expire-days))
-	(expiry-hashtb (gnus-make-hashtable 1023))
 	gnus-command-method sym group articles
 	history overview file histories elem art nov-file low info
 	unreads marked article)
     (save-excursion
       (setq overview (get-buffer-create " *expire overview*"))
       (while (setq gnus-command-method (pop methods))
+	(let ((expiry-hashtb (gnus-make-hashtable 1023)))
 	(gnus-agent-open-history)
 	(set-buffer
 	 (setq gnus-agent-current-history
@@ -1303,6 +1303,8 @@
 	     (erase-buffer)
 	     (when (file-exists-p nov-file)
 	       (insert-file-contents nov-file))
+	     ;;; Make sure article nov lines are in sequence
+	     (sort-numeric-fields 1 1 (buffer-size))
 	     (goto-char (point-min))
 	     (setq article 0)
 	     (while (setq elem (pop articles))
@@ -1319,7 +1321,7 @@
 				 (< art article)))
 		   (if (file-exists-p
 			(gnus-agent-article-name
-			 (number-to-string article) group))
+			 (number-to-string art) group))
 		       (forward-line 1)
 		     ;; Remove old NOV lines that have no articles.
 		     (gnus-delete-line)))
@@ -1362,7 +1364,7 @@
 	    (gnus-delete-line))
 	  (gnus-agent-save-history)
 	  (gnus-agent-close-history))
-	(gnus-message 4 "Expiry...done")))))
+	(gnus-message 4 "Expiry...done"))))))
 
 ;;;###autoload
 (defun gnus-agent-batch ()



      reply	other threads:[~1998-06-30  0:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-14 13:15 Mike McEwan
1998-06-24  4:27 ` Lars Magne Ingebrigtsen
1998-06-24 18:29   ` Mike McEwan
1998-06-27  2:28     ` Lars Magne Ingebrigtsen
1998-06-30  0:28       ` 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=m390mfu3zr.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).