From eb8a724d7b1eac8b9c7dd28ceef1cfac3fe93d88 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 21 Aug 2001 22:26:07 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 14 +++++++++ lisp/gnus-sum.el | 91 ++++++++++++++++++++++++++++-------------------------- lisp/gnus.el | 5 +++ 3 files changed, 66 insertions(+), 44 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 955fd7f..ab11e6f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2001-08-21 23:28:02 Lars Magne Ingebrigtsen + + * gnus-sum.el (gnus-adjust-marked-articles): Use new variable. + (gnus-article-mark-to-type): New function. + (gnus-update-missing-marks): Only update marks of type 'list. + + * gnus.el (gnus-article-special-mark-lists): New variable. + +2001-08-21 12:00:00 ShengHuo ZHU + + * gnus-sum.el (gnus-summary-limit-children): Check 'all. + (gnus-select-newsgroup): Still use 'all. + (gnus-summary-initial-limit): Comparing with 'all. + 2001-08-20 16:00:00 ShengHuo ZHU * gnus-start.el (gnus-activate-group): If dont-check, don't update diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index d531110..a1fe9b7 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -4556,7 +4556,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." (setq gnus-newsgroup-display (cond ((eq gnus-newsgroup-display 'all) - (setq gnus-newsgroup-display 'identity)) + 'all) ((arrayp gnus-newsgroup-display) (gnus-summary-display-make-predicate (mapcar 'identity gnus-newsgroup-display))) @@ -4581,7 +4581,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." ;; Adjust and set lists of article marks. (when info (gnus-adjust-marked-articles info)) - + (if (setq articles select-articles) (setq gnus-newsgroup-unselected (gnus-sorted-intersection @@ -4821,6 +4821,11 @@ If SELECT-ARTICLES, only select those articles from GROUP." (setq marks (cdr marks))) out)) +(defun gnus-article-mark-to-type (mark) + "Return the type of MARK." + (or (cadr (assq mark gnus-article-special-mark-lists)) + 'list)) + (defun gnus-adjust-marked-articles (info) "Set all article lists and remove all marks that are no longer valid." (let* ((marked-lists (gnus-info-marks info)) @@ -4828,56 +4833,53 @@ If SELECT-ARTICLES, only select those articles from GROUP." (min (car active)) (max (cdr active)) (types gnus-article-mark-lists) - (uncompressed '(score bookmark killed)) - marks var articles article mark) + marks var articles article mark mark-type) (dolist (marks marked-lists) - (setq mark (car marks)) - (unless (eq mark 'seen) - ;; Do the rest of the marks. - (set (setq var (intern (format "gnus-newsgroup-%s" - (car (rassq mark types))))) - (cond - ((memq mark uncompressed) - (cdr marks)) - (t - (gnus-uncompress-range (cdr marks))))) - - (setq articles (symbol-value var)) + (setq mark (car marks) + mark-type (gnus-article-mark-to-type mark) + var (intern (format "gnus-newsgroup-%s" (car (rassq mark types))))) - ;; All articles have to be subsets of the active articles. - (cond - ;; Adjust "simple" lists. - ((memq mark '(tick dormant expire reply save)) + ;; We set the variable according to the type of the marks list, + ;; and then adjust the marks to a subset of the active articles. + (cond + ;; Adjust "simple" lists. + ((eq mark-type 'list) + (set var (setq articles (gnus-uncompress-range (cdr marks)))) + (when (memq mark '(tick dormant expire reply save)) (while articles (when (or (< (setq article (pop articles)) min) (> article max)) - (set var (delq article (symbol-value var)))))) - ;; Adjust assocs. - ((memq mark uncompressed) - (when (not (listp (cdr (symbol-value var)))) - (set var (list (symbol-value var)))) - (when (not (listp (cdr articles))) - (setq articles (list articles))) - (while articles - (when (or (not (consp (setq article (pop articles)))) - (< (car article) min) - (> (car article) max)) - (set var (delq article (symbol-value var))))))))))) + (set var (delq article (symbol-value var))))))) + ;; Adjust assocs. + ((eq mark-type 'tuple) + (set var (setq articles (cdr marks))) + (when (not (listp (cdr (symbol-value var)))) + (set var (list (symbol-value var)))) + (when (not (listp (cdr articles))) + (setq articles (list articles))) + (while articles + (when (or (not (consp (setq article (pop articles)))) + (< (car article) min) + (> (car article) max)) + (set var (delq article (symbol-value var)))))) + ((eq mark-type 'range) + (cond + ((eq mark 'seen)))))))) (defun gnus-update-missing-marks (missing) "Go through the list of MISSING articles and remove them from the mark lists." (when missing - (let ((types gnus-article-mark-lists) - var m) + (let (var m) ;; Go through all types. - (while types - (setq var (intern (format "gnus-newsgroup-%s" (car (pop types))))) - (when (symbol-value var) - ;; This list has articles. So we delete all missing articles - ;; from it. - (setq m missing) - (while m - (set var (delq (pop m) (symbol-value var))))))))) + (dolist (elem gnus-article-mark-lists) + (when (eq (gnus-article-mark-to-type (cdr elem)) 'list) + (setq var (intern (format "gnus-newsgroup-%s" (car elem)))) + (when (symbol-value var) + ;; This list has articles. So we delete all missing + ;; articles from it. + (setq m missing) + (while m + (set var (delq (pop m) (symbol-value var)))))))))) (defun gnus-update-marks () "Enter the various lists of marked articles into the newsgroup info list." @@ -4910,7 +4912,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." (setq list (cdr all))))) (when (eq (cdr type) 'seen) - (setq list + (setq list (if list (gnus-add-to-range list gnus-newsgroup-unseen) (gnus-compress-sequence gnus-newsgroup-articles)))) @@ -7164,7 +7166,7 @@ fetch-old-headers verbiage, and so on." ;; Most groups have nothing to remove. (if (or gnus-inhibit-limiting (and (null gnus-newsgroup-dormant) - (eq gnus-newsgroup-display 'identity) + (eq gnus-newsgroup-display 'all) (not (eq gnus-fetch-old-headers 'some)) (not (numberp gnus-fetch-old-headers)) (not (eq gnus-fetch-old-headers 'invisible)) @@ -7255,6 +7257,7 @@ fetch-old-headers verbiage, and so on." t) ;; Do the `display' group parameter. (and gnus-newsgroup-display + (not (eq gnus-newsgroup-display 'all)) (not (funcall gnus-newsgroup-display))) ;; Check NoCeM things. (if (and gnus-use-nocem diff --git a/lisp/gnus.el b/lisp/gnus.el index 896860e..ba2ee9b 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1827,6 +1827,11 @@ covered by that variable." (unsendable . unsend) (forwarded . forward) (recent . recent) (seen . seen))) +(defconst gnus-article-special-mark-lists + '((seen range) + (bookmark tuple) + (score tuple))) + (defvar gnus-headers-retrieved-by nil) (defvar gnus-article-reply nil) (defvar gnus-override-method nil) -- 1.7.10.4