From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/47859 Path: main.gmane.org!not-for-mail From: Kevin Greiner Newsgroups: gmane.emacs.gnus.general Subject: Re: HEADS UP: Largely rewritten gnus-agent implementation. Date: Mon, 25 Nov 2002 10:41:02 -0600 Sender: owner-ding@hpc.uh.edu Message-ID: <3DE2529E.6060401@xpediantsolutions.com> References: <84bs4ggtnq.fsf@lucy.cs.uni-dortmund.de> <877kf3f7e7.fsf@dishevelled.net> <848yzj2h7x.fsf@lucy.cs.uni-dortmund.de> <87k7j3nitt.fsf@dishevelled.net> <84n0nyumyx.fsf@lucy.cs.uni-dortmund.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050702040103080504020406" X-Trace: main.gmane.org 1038243803 7230 80.91.224.249 (25 Nov 2002 17:03:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 25 Nov 2002 17:03:23 +0000 (UTC) Cc: =?ISO-8859-1?Q?Kai_Gro=DFjohann?= Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18GMde-0001rm-00 for ; Mon, 25 Nov 2002 18:03:14 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18GMdV-0008I4-00; Mon, 25 Nov 2002 11:03:05 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 25 Nov 2002 11:03:53 -0600 (CST) Original-Received: from epithumia.math.uh.edu (epithumia.math.uh.edu [129.7.128.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id LAA19066 for ; Mon, 25 Nov 2002 11:03:43 -0600 (CST) Original-Received: (from tibbs@localhost) by epithumia.math.uh.edu (8.11.2/8.11.1) id gAPH2n628669 for ding@hpc.uh.edu; Mon, 25 Nov 2002 11:02:49 -0600 Original-Received: from sclp3.sclp.com (qmailr@[209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id KAA18960 for ; Mon, 25 Nov 2002 10:42:24 -0600 (CST) Original-Received: (qmail 16822 invoked by alias); 25 Nov 2002 16:41:13 -0000 Original-Received: (qmail 16817 invoked from network); 25 Nov 2002 16:41:13 -0000 Original-Received: from h008.c001.snv.cp.net (HELO c001.snv.cp.net) (209.228.32.122) by gnus.org with SMTP; 25 Nov 2002 16:41:13 -0000 Original-Received: (cpmta 23329 invoked from network); 25 Nov 2002 08:41:04 -0800 Original-Received: from 66.134.21.50 (HELO xpediantsolutions.com) by smtp.register-admin.com (209.228.32.122) with SMTP; 25 Nov 2002 08:41:04 -0800 X-Sent: 25 Nov 2002 16:41:04 GMT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en Original-To: ding@gnus.org Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:47859 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:47859 This is a multi-part message in MIME format. --------------050702040103080504020406 Content-Type: multipart/alternative; boundary="------------050404040300000208090002" --------------050404040300000208090002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Mark, Thanks for the feedback. Kai- You're right that gnus-remove-from-range is effectively the gnus-range-difference that I wrote. I have found one critical difference; gnus-range-difference creates a new range rather than editing the original range1. The gnus-summary-insert-old-articles function passes gnus-newsgroup-active so there is a chance that gnus-remove-from-range might corrupt the active range. Calling gnus-remove-from-range would have otherwise worked except that I introduced a new bug with the rest of my changes. I've attached a patch for gnus-sum.el (version 6.241) below that will get gnus-summary-insert-old-articles working with gnus-range-difference. I've also attached a patch for adding gnus-range-difference to gnus-range.el (version 6.12). Kevin Kai Großjohann wrote: >Mark Triggs writes: > > > >>After applying the patch, I seem to get the following: >> >> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p (4882 . 5694)) >> gnus-sorted-difference(((4882 . 5694) (5698 . 5700)) (5695 5696 5697)) >> gnus-summary-insert-articles(((4882 . 5694) (5698 . 5700))) >> gnus-summary-insert-old-articles(nil) >> call-interactively(gnus-summary-insert-old-articles) >> >> > >Could you apply the following patch on top of the previous one? >I even tested it once :-) > >--- gnus-sum.el 2002/11/21 07:43:41 6.238.1.1 >+++ gnus-sum.el 2002/11/25 07:26:57 >@@ -11178,7 +11178,8 @@ > ;;; (gnus-sorted-difference > ;;; (gnus-uncompress-range (list gnus-newsgroup-active)) > ;;; old) >- (gnus-range-difference (list gnus-newsgroup-active) old) >+ (gnus-uncompress-range >+ (gnus-remove-from-range (list gnus-newsgroup-active) old)) > ) > (setq len (gnus-range-length older)) > (cond > >kai > > --------------050404040300000208090002 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Mark,
Thanks for the feedback.

Kai- You're right that gnus-remove-from-range is effectively the gnus-range-difference that I wrote.  I have found one critical difference; gnus-range-difference creates a new range rather than editing the original range1.  The gnus-summary-insert-old-articles function passes gnus-newsgroup-active so there is a chance that gnus-remove-from-range might corrupt the active range.  Calling gnus-remove-from-range would have otherwise worked except that I introduced a new bug with the rest of my changes.  I've attached a patch for gnus-sum.el (version 6.241) below that will get gnus-summary-insert-old-articles working with gnus-range-difference.  I've also attached a patch for adding gnus-range-difference to gnus-range.el (version 6.12).

Kevin

Kai Großjohann wrote:
Mark Triggs <mst@dishevelled.net> writes:

  
After applying the patch, I seem to get the following:

  Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p (4882 . 5694))
    gnus-sorted-difference(((4882 . 5694) (5698 . 5700)) (5695 5696 5697))
    gnus-summary-insert-articles(((4882 . 5694) (5698 . 5700)))
    gnus-summary-insert-old-articles(nil)
    call-interactively(gnus-summary-insert-old-articles)
    

Could you apply the following patch on top of the previous one?
I even tested it once :-)

--- gnus-sum.el	2002/11/21 07:43:41	6.238.1.1
+++ gnus-sum.el	2002/11/25 07:26:57
@@ -11178,7 +11178,8 @@
 ;;;	      (gnus-sorted-difference
 ;;;	       (gnus-uncompress-range (list gnus-newsgroup-active))
 ;;;	       old)
-              (gnus-range-difference (list gnus-newsgroup-active) old)
+	      (gnus-uncompress-range
+	       (gnus-remove-from-range (list gnus-newsgroup-active) old))
 )
 	(setq len (gnus-range-length older))
 	(cond

kai
  


--------------050404040300000208090002-- --------------050702040103080504020406 Content-Type: text/plain; name="patch-range.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-range.txt" diff -r6.12 gnus-range.el 63a64,104 > (defun gnus-range-difference (range1 range2) > "Return the range of elements in RANGE1 that do not appear in RANGE2. > Both ranges must be in ascending order." > (setq range1 (gnus-range-normalize range1)) > (setq range2 (gnus-range-normalize range2)) > (let* ((new-range (cons nil (copy-sequence range1))) > (r new-range) > (safe t)) > (while (cdr r) > (let* ((r1 (cadr r)) > (r2 (car range2)) > (min1 (if (numberp r1) r1 (car r1))) > (max1 (if (numberp r1) r1 (cdr r1))) > (min2 (if (numberp r2) r2 (car r2))) > (max2 (if (numberp r2) r2 (cdr r2)))) > > (cond ((> min1 max1) > ;; Invalid range: may result from overlap condition (below) > ;; remove Invalid range > (setcdr r (cddr r))) > ((and (= min1 max1) > (listp r1)) > ;; Inefficient representation: may result from overlap condition (below) > (setcar (cdr r) min1)) > ((not min2) > ;; All done with range2 > (setq r nil)) > ((< max1 min2) > ;; No overlap: range1 preceeds range2 > (pop r)) > ((< max2 min1) > ;; No overlap: range2 preceeds range1 > (pop range2)) > ((and (<= min2 min1) (<= max1 max2)) > ;; Complete overlap: range1 removed > (setcdr r (cddr r))) > (t > (setcdr r (nconc (list (cons min1 (1- min2)) (cons (1+ max2) max1)) (cddr r))))))) > (cdr new-range)) > ) > --------------050702040103080504020406 Content-Type: text/plain; name="patch-sum.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-sum.txt" RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v retrieving revision 6.241 diff -r6.241 gnus-sum.el 11181,11182c11181 < (gnus-uncompress-range < (gnus-remove-from-range (list gnus-newsgroup-active) old)) --- > (gnus-range-difference (list gnus-newsgroup-active) old) 11202c11201,11202 < (all nil) --- > (all > (setq older (gnus-uncompress-range older))) --------------050702040103080504020406--