From: hmurata Date: Sun, 13 Jun 2004 12:33:45 +0000 (+0000) Subject: * elmo.el (elmo-folder-synchronize): Add 5th optional argument X-Git-Tag: wl-2_11_30~6 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ede1058ec4d4f93ab8f873045c79cfffb4710781;p=elisp%2Fwanderlust.git * elmo.el (elmo-folder-synchronize): Add 5th optional argument `mask'. * elmo-pipe.el (elmo-folder-synchronize): Follow the API chagne. * elmo-multi.el (elmo-folder-synchronize): Likewise. (elmo-multi-split-numbers): Add elmo-folder object into each element of return value at first. (elmo-folder-delete-messages): Follow the above change. (elmo-folder-detach-messages): Ditto. * elmo-filter.el (elmo-folder-synchronize): Minimize message number which is synchronized in target folder. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 62f80d3..4169655 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,19 @@ +2004-06-13 Hiroya Murata + + * elmo.el (elmo-folder-synchronize): Add 5th optional argument + `mask'. + + * elmo-pipe.el (elmo-folder-synchronize): Follow the API chagne. + + * elmo-multi.el (elmo-folder-synchronize): Likewise. + (elmo-multi-split-numbers): Add elmo-folder object into each + element of return value at first. + (elmo-folder-delete-messages): Follow the above change. + (elmo-folder-detach-messages): Ditto. + + * elmo-filter.el (elmo-folder-synchronize): Minimize message + number which is synchronized in target folder. + 2004-05-25 Hiroya Murata * elmo-shimbun.el (elmo-shimbun-update-overview-folder-list): diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index 1aef7fc..6ebcd1a 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -377,19 +377,32 @@ &optional disable-killed ignore-msgdb - no-check) - (when (elmo-folder-synchronize - (elmo-filter-folder-target-internal folder) - 'disable-killed - ignore-msgdb - no-check) - (let ((killed-list (elmo-folder-killed-list-internal folder)) - (numbers (elmo-folder-list-messages folder (not disable-killed)))) - (when (and disable-killed ignore-msgdb) - (elmo-folder-set-killed-list-internal folder nil)) - (elmo-filter-folder-set-number-list-internal folder numbers) - (elmo-filter-folder-set-flag-count-internal folder nil) - 0))) + no-check + mask) + (let ((killed-list (elmo-folder-killed-list-internal folder)) + numbers) + (unless no-check + (when (elmo-filter-folder-require-msgdb-internal folder) + (elmo-folder-synchronize (elmo-filter-folder-target-internal folder) + disable-killed + ignore-msgdb + no-check + mask))) + (setq numbers (elmo-folder-list-messages folder (not disable-killed))) + (when (and numbers + (not (elmo-filter-folder-require-msgdb-internal folder))) + (elmo-folder-synchronize (elmo-filter-folder-target-internal folder) + 'disable-killed + ignore-msgdb + no-check + (if mask + (elmo-list-filter mask numbers) + numbers))) + (when (and disable-killed ignore-msgdb) + (elmo-folder-set-killed-list-internal folder nil)) + (elmo-filter-folder-set-number-list-internal folder numbers) + (elmo-filter-folder-set-flag-count-internal folder nil) + 0)) (luna-define-method elmo-folder-detach-messages ((folder elmo-filter-folder) numbers) diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index c9d1368..5bca2c2 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -88,9 +88,18 @@ &optional disable-killed ignore-msgdb - no-check) - (dolist (fld (elmo-multi-folder-children-internal folder)) - (elmo-folder-synchronize fld disable-killed ignore-msgdb no-check)) + no-check + mask) + (if mask + (dolist (element (elmo-multi-split-numbers folder mask)) + (when (cdr element) + (elmo-folder-synchronize (car element) + disable-killed + ignore-msgdb + no-check + (cdr element)))) + (dolist (fld (elmo-multi-folder-children-internal folder)) + (elmo-folder-synchronize fld disable-killed ignore-msgdb no-check))) 0) (luna-define-method elmo-folder-expand-msgdb-path ((folder @@ -188,12 +197,13 @@ (defun elmo-multi-split-numbers (folder numlist &optional as-is) (let ((numbers (sort numlist '<)) + (folders (elmo-multi-folder-children-internal folder)) (divider (elmo-multi-folder-divide-number-internal folder)) (cur-number 0) one-list numbers-list) (while numbers + (setq one-list (list (nth cur-number folders))) (setq cur-number (+ cur-number 1)) - (setq one-list nil) (while (and numbers (eq 0 (/ (- (car numbers) @@ -222,27 +232,17 @@ (luna-define-method elmo-folder-delete-messages ((folder elmo-multi-folder) numbers) - (let ((flds (elmo-multi-folder-children-internal folder)) - one-list-list - (cur-number 0)) - (setq one-list-list (elmo-multi-split-numbers folder numbers)) - (while (< cur-number (length flds)) - (elmo-folder-delete-messages (nth cur-number flds) - (nth cur-number one-list-list)) - (setq cur-number (+ 1 cur-number))) - t)) + (dolist (element (elmo-multi-split-numbers folder numbers)) + (when (cdr element) + (elmo-folder-delete-messages (car element) (cdr element)))) + t) (luna-define-method elmo-folder-detach-messages ((folder elmo-multi-folder) numbers) - (let ((flds (elmo-multi-folder-children-internal folder)) - one-list-list - (cur-number 0)) - (setq one-list-list (elmo-multi-split-numbers folder numbers)) - (while (< cur-number (length flds)) - (elmo-folder-detach-messages (nth cur-number flds) - (nth cur-number one-list-list)) - (setq cur-number (+ 1 cur-number))) - t)) + (dolist (element (elmo-multi-split-numbers folder numbers)) + (when (cdr element) + (elmo-folder-detach-messages (car element) (cdr element)))) + t) (luna-define-method elmo-folder-diff ((folder elmo-multi-folder)) (elmo-multi-folder-diff folder)) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index 3229ac3..fd8b9a4 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -302,7 +302,8 @@ &optional disable-killed ignore-msgdb - no-check) + no-check + mask) (let ((src-folder (elmo-pipe-folder-src-internal folder)) (dst-folder (elmo-pipe-folder-dst-internal folder))) (when (and (elmo-folder-plugged-p src-folder) @@ -317,7 +318,7 @@ (elmo-pipe-drain src-folder dst-folder)))) (elmo-folder-synchronize (elmo-pipe-folder-dst-internal folder) - disable-killed ignore-msgdb no-check)) + disable-killed ignore-msgdb no-check mask)) (luna-define-method elmo-folder-list-flagged ((folder elmo-pipe-folder) flag diff --git a/elmo/elmo.el b/elmo/elmo.el index 39eb047..3bebcca 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1450,7 +1450,8 @@ If Optional LOCAL is non-nil, don't update server flag." &optional disable-killed ignore-msgdb - no-check) + no-check + mask) "Synchronize the folder data to the newest status. FOLDER is the ELMO folder structure. @@ -1458,6 +1459,8 @@ If optional DISABLE-KILLED is non-nil, killed messages are also synchronized. If optional IGNORE-MSGDB is non-nil, current msgdb is thrown away except flag status. If NO-CHECK is non-nil, rechecking folder is skipped. +If optional argument MASK is specified and is a list of message numbers, +synchronize messages only which are contained the list. Return amount of cross-posted messages. If update process is interrupted, return nil.") @@ -1465,7 +1468,8 @@ If update process is interrupted, return nil.") &optional disable-killed ignore-msgdb - no-check) + no-check + mask) (let ((killed-list (elmo-folder-killed-list-internal folder)) (before-append t) old-msgdb diff diff-2 delete-list new-list new-msgdb flag @@ -1486,6 +1490,8 @@ If update process is interrupted, return nil.") folder (not disable-killed) 'in-msgdb))) + (when (and mask (car diff)) + (setcar diff (elmo-list-filter mask (car diff)))) (message "Checking folder diff...done") (setq new-list (elmo-folder-confirm-appends (car diff))) ;; Set killed list as ((1 . MAX-OF-DISAPPEARED))