From 11260fc7dc5085909770e2d0c250126f0f3180d2 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 23 Jan 2004 02:27:35 +0000 Subject: [PATCH] Synch to No Gnus 200401230220. --- lisp/ChangeLog | 6 ++++++ lisp/gnus-sum.el | 52 ++++++++++++++++++++++------------------------------ 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e9255e7..5d313e5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-01-23 Kevin Greiner + + * gnus-sum.el (gnus-adjust-marks): Now correctly handles a list of + marks consisting of a single range {for example, (3 . 5)} rather + than a list of a single range { ((3 . 5)) }. + 2004-01-23 Jesper Harder * spam-stat.el (spam-stat-store-gnus-article-buffer): Use diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index ba3896f..117ea8c 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -5360,7 +5360,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." (min (car active)) (max (cdr active)) (types gnus-article-mark-lists) - marks var articles article mark mark-type p-articles + marks var articles article mark mark-type bgn end) (dolist (marks marked-lists) @@ -5374,35 +5374,27 @@ If SELECT-ARTICLES, only select those articles from GROUP." ;; Adjust "simple" lists - compressed yet unsorted ((eq mark-type 'list) ;; Simultaneously uncompress and clip to active range - (setq p-articles marks - articles (cdr p-articles)) - (while (setq article (car articles)) - (when (cond ((consp article) - (setq bgn (max (car article) min) - end (min (cdr article) max)) - (if (> bgn end) - t ; range excluded - splice out of marks - (setcar articles bgn) ; First value replaces range. - (setq bgn (1+ bgn)) - (while (<= bgn end) - (setq articles (setcdr articles (cons bgn (cdr articles))) - bgn (1+ bgn))) - (setq p-articles articles - articles (cdr articles)) - nil)) - ((or (< article min) - (> article max)) - t ; value excluded - splice out of marks - ) - (t - (setq p-articles articles - articles (cdr articles)) - nil)) - ;; perform slice to remove article - (if (setcar articles (cadr articles)) - (setcdr articles (cddr articles)) - (setcdr p-articles nil)))) - (set var (cdr marks))) + ;; See gnus-uncompress-range for a description of possible marks + (let (l lh) + (if (not (cadr marks)) + (set var nil) + (setq articles (if (numberp (cddr marks)) + (list (cdr marks)) + (cdr marks)) + lh (cons nil nil) + l lh) + + (while (setq article (pop articles)) + (cond ((consp article) + (setq bgn (max (car article) min) + end (min (cdr article) max)) + (while (<= bgn end) + (setq l (setcdr l (cons bgn nil)) + bgn (1+ bgn)))) + ((and (<= min article) + (>= max article)) + (setq l (setcdr l (cons article nil)))))) + (set var (cdr lh))))) ;; Adjust assocs. ((eq mark-type 'tuple) (set var (setq articles (cdr marks))) -- 1.7.10.4