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