From: Kevin Greiner <kgreiner@xpediantsolutions.com>
Cc: "Kai Großjohann" <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Subject: Re: HEADS UP: Largely rewritten gnus-agent implementation.
Date: Mon, 25 Nov 2002 10:41:02 -0600 [thread overview]
Message-ID: <3DE2529E.6060401@xpediantsolutions.com> (raw)
In-Reply-To: <84n0nyumyx.fsf@lucy.cs.uni-dortmund.de>
[-- Attachment #1.1: Type: text/plain, Size: 1839 bytes --]
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
>
>
[-- Attachment #1.2: Type: text/html, Size: 2270 bytes --]
[-- Attachment #2: patch-range.txt --]
[-- Type: text/plain, Size: 1705 bytes --]
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))
> )
>
[-- Attachment #3: patch-sum.txt --]
[-- Type: text/plain, Size: 403 bytes --]
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)))
next prev parent reply other threads:[~2002-11-25 16:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-23 16:03 Kai Großjohann
2002-11-23 18:40 ` Danny Siu
2002-11-23 20:27 ` Kai Großjohann
2002-11-23 20:32 ` Kai Großjohann
2002-11-23 18:45 ` Danny Siu
2002-11-23 20:29 ` Kai Großjohann
2002-11-24 15:32 ` Danny Siu
2002-11-24 16:02 ` Danny Siu
2002-11-25 3:07 ` Henrik Enberg
2002-11-25 16:55 ` Henrik Enberg
2002-11-25 20:26 ` Kai Großjohann
2002-11-26 2:29 ` Kevin Greiner
2002-11-26 7:28 ` Kai Großjohann
2002-11-24 8:43 ` Denis Yakovlev
2002-11-26 3:09 ` Kevin Greiner
2002-11-24 13:02 ` Mark Triggs
2002-11-24 14:08 ` Kai Großjohann
2002-11-24 14:27 ` Mark Triggs
2002-11-25 7:28 ` Kai Großjohann
2002-11-25 14:42 ` Mark Triggs
2002-11-25 14:48 ` Kai Großjohann
2002-11-25 16:41 ` Kevin Greiner [this message]
2002-11-25 20:23 ` Kai Großjohann
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=3DE2529E.6060401@xpediantsolutions.com \
--to=kgreiner@xpediantsolutions.com \
--cc=Kai.Grossjohann@CS.Uni-Dortmund.DE \
/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).