Gnus development mailing list
 help / color / mirror / Atom feed
From: "Ted Zlatanov" <tzz@lifelogs.com>
Subject: Re: Gnus registry woes
Date: 29 Jun 2004 14:21:30 -0400	[thread overview]
Message-ID: <4nsmce5iol.fsf@lifelogs.com> (raw)
In-Reply-To: <vzhdsura79.fsf@redqueen.ath.cx> (Norbert Koch's message of "Tue, 29 Jun 2004 11:21:30 +0200")

On Tue, 29 Jun 2004, viteno@xemacs.org wrote:

> I've had a go at the registry today.  Now, I'm no longer able to save
> my Gnus buffers.  I get the following error:
> 
> Signaling: (wrong-type-argument natnump -2497)
>   gnus-registry-trim((("<20040629090742.GE74930@atrbg11.informatik.tu-muenchen.de>"
>   	(...) "nnml:bsd-current")
>   	("<1152675CA9EDD71187130002B3CE5ADA090BA9F4@hoexc010.ukrtelecom.net>"
>   	(...) "nnml:bsd-current") ("<87n02msp6d.fsf@free.fr>" (...)
>   	"nnml:lilypond")))
>   gnus-registry-save()
>   run-hooks(gnus-registry-save)
>   apply(run-hooks gnus-registry-save)
>   gnus-run-hooks(gnus-save-newsrc-hook)
>   gnus-save-newsrc-file(nil)
>   gnus-group-save-newsrc(nil)
>   call-interactively(gnus-group-save-newsrc)

Here's the function in question:

(defun gnus-registry-trim (alist)
  "Trim alist to size, using gnus-registry-max-entries."
  (if (null gnus-registry-max-entries)
      alist				; just return the alist
    ;; else, when given max-entries, trim the alist
    (let ((timehash (make-hash-table 			    
		     :size 4096
		     :test 'equal)))
      (maphash
       (lambd a(key value)
	 (puthash key (gnus-registry-fetch-extra key 'mtime) timehash))
       gnus-registry-hashtb)

      ;; we use the return value of this setq, which is the trimmed alist
      (setq alist
	    (nthcdr
	     (- (length alist) gnus-registry-max-entries)
	     (sort alist 
		   (lambda (a b)
		     (time-less-p 
		      (cdr (gethash (car a) timehash))
		      (cdr (gethash (car b) timehash))))))))))

So basically we sort the alist and then take only the needed number
of entries from it.

I would guess the natnump error, which I have never seen before, is
coming from an invalid mtime.  Can you trace the error deeper with
(debug) statements inside the lambda function above?  Alternatively,
can you send me your registry file, if the error is repeatable from
it?

Thanks
Ted



  reply	other threads:[~2004-06-29 18:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-29  9:21 Norbert Koch
2004-06-29 18:21 ` Ted Zlatanov [this message]
2004-06-29 20:51   ` Norbert Koch
2004-06-30 15:15     ` Norbert Koch
2004-06-30 18:00       ` Ted Zlatanov
2004-07-01  5:56         ` Norbert Koch
2004-06-30 17:52     ` Ted Zlatanov

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=4nsmce5iol.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    /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).