X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnvirtual.el;h=709f1971696eee27e7df0aa2ead74e0d727d55c4;hb=b19ab0bcf7b463d4b14b41bd23f2a5d62d03795a;hp=855ad613b26a8fb1aa5f0a0a7cfb1afea2a415cb;hpb=284704d7407076633373a3f6643e54598d39fdf2;p=gnus diff --git a/lisp/nnvirtual.el b/lisp/nnvirtual.el index 855ad613b..709f19716 100644 --- a/lisp/nnvirtual.el +++ b/lisp/nnvirtual.el @@ -34,6 +34,9 @@ (require 'nnheader) (require 'gnus) (require 'nnoo) +(require 'gnus-util) +(require 'gnus-start) +(require 'gnus-sum) (eval-when-compile (require 'cl)) (nnoo-declare nnvirtual) @@ -48,12 +51,14 @@ virtual group.") (defvoo nnvirtual-component-regexp nil "*Regexp to match component groups.") +(defvoo nnvirtual-component-groups nil + "Component group in this nnvirtual group.") + (defconst nnvirtual-version "nnvirtual 1.0") (defvoo nnvirtual-current-group nil) -(defvoo nnvirtual-component-groups nil) (defvoo nnvirtual-mapping nil) (defvoo nnvirtual-status-string "") @@ -189,24 +194,23 @@ virtual group.") (if nnvirtual-component-groups t (setq nnvirtual-mapping nil) - ;; Go through the newsrc alist and find all component groups. - (let ((newsrc (cdr gnus-newsrc-alist)) - group) - (while (setq group (car (pop newsrc))) - (and (string-match nnvirtual-component-regexp group) ; Match - ;; Add this group to the list of component groups. - (setq nnvirtual-component-groups - (cons group - (delete group nnvirtual-component-groups))))) - (setq nnvirtual-component-groups - (delete (nnvirtual-current-group) - nnvirtual-component-groups))) + (when nnvirtual-component-regexp + ;; Go through the newsrc alist and find all component groups. + (let ((newsrc (cdr gnus-newsrc-alist)) + group) + (while (setq group (car (pop newsrc))) + (when (string-match nnvirtual-component-regexp group) ; Match + ;; Add this group to the list of component groups. + (setq nnvirtual-component-groups + (cons group (delete group nnvirtual-component-groups))))))) (if (not nnvirtual-component-groups) (nnheader-report 'nnvirtual "No component groups: %s" server) t))) (deffoo nnvirtual-request-group (group &optional server dont-check) (nnvirtual-possibly-change-server server) + (setq nnvirtual-component-groups + (delete (nnvirtual-current-group) nnvirtual-component-groups)) (cond ((null nnvirtual-component-groups) (setq nnvirtual-current-group nil) @@ -230,13 +234,15 @@ virtual group.") (cgroup (cadr nart)) ;; The component group might be a virtual group. (nmark (gnus-request-update-mark cgroup (caddr nart) mark))) - (when (and (= mark nmark) + (when (and nart + (= mark nmark) (gnus-group-auto-expirable-p cgroup)) (setq mark gnus-expirable-mark))) mark) (deffoo nnvirtual-close-group (group &optional server) - (when (nnvirtual-possibly-change-server server) + (when (and (nnvirtual-possibly-change-server server) + (not (gnus-ephemeral-group-p group))) ;; Copy (un)read articles. (nnvirtual-update-reads) ;; We copy the marks from this group to the component @@ -291,7 +297,7 @@ virtual group.") (deffoo nnvirtual-catchup-group (group &optional server all) (nnvirtual-possibly-change-server server) - (let ((gnus-group-marked nnvirtual-component-groups) + (let ((gnus-group-marked (copy-sequence nnvirtual-component-groups)) (gnus-expert-user t)) ;; Make sure all groups are activated. (mapcar @@ -321,7 +327,7 @@ virtual group.") header) (erase-buffer) (while (setq header (pop headers)) -)))) + (nnheader-insert-nov header))))) (defun nnvirtual-possibly-change-server (server) (or (not server)