`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-06-13 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * 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 <lapis-lazuli@pop06.odn.ne.jp>
* elmo-shimbun.el (elmo-shimbun-update-overview-folder-list):
&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)
&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
(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)
(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))
&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)
(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
&optional
disable-killed
ignore-msgdb
- no-check)
+ no-check
+ mask)
"Synchronize the folder data to the newest status.
FOLDER is the ELMO folder structure.
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.")
&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
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))