comparison lisp/gnus/gnus-sum.el @ 91010:aaccdab0ee26

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 852-856) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 93-96) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 245) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-249
author Miles Bader <miles@gnu.org>
date Tue, 21 Aug 2007 04:54:03 +0000
parents f55f9811f5d7 962fb740e73f
children bdb3fe0ba9fa
comparison
equal deleted inserted replaced
91009:e7395a700642 91010:aaccdab0ee26
5470 ;; We want to select the headers for all the articles in 5470 ;; We want to select the headers for all the articles in
5471 ;; the group, so we select either all the active 5471 ;; the group, so we select either all the active
5472 ;; articles in the group, or (if that's nil), the 5472 ;; articles in the group, or (if that's nil), the
5473 ;; articles in the cache. 5473 ;; articles in the cache.
5474 (or 5474 (or
5475 (gnus-uncompress-range (gnus-active group)) 5475 (if gnus-maximum-newsgroup
5476 (let ((active (gnus-active group)))
5477 (gnus-uncompress-range
5478 (cons (max (car active)
5479 (- (cdr active) gnus-maximum-newsgroup -1))
5480 (cdr active))))
5481 (gnus-uncompress-range (gnus-active group)))
5476 (gnus-cache-articles-in-group group)) 5482 (gnus-cache-articles-in-group group))
5477 ;; Select only the "normal" subset of articles. 5483 ;; Select only the "normal" subset of articles.
5478 (gnus-sorted-nunion 5484 (gnus-sorted-nunion
5479 (gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked) 5485 (gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked)
5480 gnus-newsgroup-unreads))) 5486 gnus-newsgroup-unreads)))
6532 ;; the range of active articles. 6538 ;; the range of active articles.
6533 (defun gnus-list-of-unread-articles (group) 6539 (defun gnus-list-of-unread-articles (group)
6534 (let* ((read (gnus-info-read (gnus-get-info group))) 6540 (let* ((read (gnus-info-read (gnus-get-info group)))
6535 (active (or (gnus-active group) (gnus-activate-group group))) 6541 (active (or (gnus-active group) (gnus-activate-group group)))
6536 (last (cdr active)) 6542 (last (cdr active))
6543 (bottom (if gnus-maximum-newsgroup
6544 (max (car active) (- last gnus-maximum-newsgroup -1))
6545 (car active)))
6537 first nlast unread) 6546 first nlast unread)
6538 ;; If none are read, then all are unread. 6547 ;; If none are read, then all are unread.
6539 (if (not read) 6548 (if (not read)
6540 (setq first (car active)) 6549 (setq first bottom)
6541 ;; If the range of read articles is a single range, then the 6550 ;; If the range of read articles is a single range, then the
6542 ;; first unread article is the article after the last read 6551 ;; first unread article is the article after the last read
6543 ;; article. Sounds logical, doesn't it? 6552 ;; article. Sounds logical, doesn't it?
6544 (if (and (not (listp (cdr read))) 6553 (if (and (not (listp (cdr read)))
6545 (or (< (car read) (car active)) 6554 (or (< (car read) bottom)
6546 (progn (setq read (list read)) 6555 (progn (setq read (list read))
6547 nil))) 6556 nil)))
6548 (setq first (max (car active) (1+ (cdr read)))) 6557 (setq first (max bottom (1+ (cdr read))))
6549 ;; `read' is a list of ranges. 6558 ;; `read' is a list of ranges.
6550 (when (/= (setq nlast (or (and (numberp (car read)) (car read)) 6559 (when (/= (setq nlast (or (and (numberp (car read)) (car read))
6551 (caar read))) 6560 (caar read)))
6552 1) 6561 1)
6553 (setq first (car active))) 6562 (setq first bottom))
6554 (while read 6563 (while read
6555 (when first 6564 (when first
6556 (while (< first nlast) 6565 (while (< first nlast)
6557 (setq unread (cons first unread) 6566 (setq unread (cons first unread)
6558 first (1+ first)))) 6567 first (1+ first))))
6573 (active (gnus-active group))) 6582 (active (gnus-active group)))
6574 (and info active 6583 (and info active
6575 (gnus-list-range-difference 6584 (gnus-list-range-difference
6576 (gnus-list-range-difference 6585 (gnus-list-range-difference
6577 (gnus-sorted-complement 6586 (gnus-sorted-complement
6578 (gnus-uncompress-range active) 6587 (gnus-uncompress-range
6588 (if gnus-maximum-newsgroup
6589 (cons (max (car active)
6590 (- (cdr active) gnus-maximum-newsgroup -1))
6591 (cdr active))
6592 active))
6579 (gnus-list-of-unread-articles group)) 6593 (gnus-list-of-unread-articles group))
6580 (cdr (assq 'dormant marked))) 6594 (cdr (assq 'dormant marked)))
6581 (cdr (assq 'tick marked)))))) 6595 (cdr (assq 'tick marked))))))
6582 6596
6583 ;; This function returns a sequence of article numbers based on the 6597 ;; This function returns a sequence of article numbers based on the
6585 ;; the range of active articles. 6599 ;; the range of active articles.
6586 (defun gnus-sequence-of-unread-articles (group) 6600 (defun gnus-sequence-of-unread-articles (group)
6587 (let* ((read (gnus-info-read (gnus-get-info group))) 6601 (let* ((read (gnus-info-read (gnus-get-info group)))
6588 (active (or (gnus-active group) (gnus-activate-group group))) 6602 (active (or (gnus-active group) (gnus-activate-group group)))
6589 (last (cdr active)) 6603 (last (cdr active))
6604 (bottom (if gnus-maximum-newsgroup
6605 (max (car active) (- last gnus-maximum-newsgroup -1))
6606 (car active)))
6590 first nlast unread) 6607 first nlast unread)
6591 ;; If none are read, then all are unread. 6608 ;; If none are read, then all are unread.
6592 (if (not read) 6609 (if (not read)
6593 (setq first (car active)) 6610 (setq first bottom)
6594 ;; If the range of read articles is a single range, then the 6611 ;; If the range of read articles is a single range, then the
6595 ;; first unread article is the article after the last read 6612 ;; first unread article is the article after the last read
6596 ;; article. Sounds logical, doesn't it? 6613 ;; article. Sounds logical, doesn't it?
6597 (if (and (not (listp (cdr read))) 6614 (if (and (not (listp (cdr read)))
6598 (or (< (car read) (car active)) 6615 (or (< (car read) bottom)
6599 (progn (setq read (list read)) 6616 (progn (setq read (list read))
6600 nil))) 6617 nil)))
6601 (setq first (max (car active) (1+ (cdr read)))) 6618 (setq first (max bottom (1+ (cdr read))))
6602 ;; `read' is a list of ranges. 6619 ;; `read' is a list of ranges.
6603 (when (/= (setq nlast (or (and (numberp (car read)) (car read)) 6620 (when (/= (setq nlast (or (and (numberp (car read)) (car read))
6604 (caar read))) 6621 (caar read)))
6605 1) 6622 1)
6606 (setq first (car active))) 6623 (setq first bottom))
6607 (while read 6624 (while read
6608 (when first 6625 (when first
6609 (push (cons first nlast) unread)) 6626 (push (cons first nlast) unread))
6610 (setq first (1+ (if (atom (car read)) (car read) (cdar read)))) 6627 (setq first (1+ (if (atom (car read)) (car read) (cdar read))))
6611 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read))) 6628 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read)))