* elmo.el (elmo-generic-folder-commit): Use elmo-folder-list-messages.
(elmo-folder-set-info-max-by-numdb): Changed argument to number list.
(elmo-generic-folder-diff): Abolish argument.
(elmo-msgdb-load): Don't use number-alist.
* elmo-filter.el (elmo-folder-diff): Abolish argument.
* elmo-pipe.el (elmo-folder-diff): Ditto.
* elmo-nmz.el (elmo-folder-diff): Ditto.
* elmo-net.el (elmo-folder-diff): Ditto.
* elmo-maildir.el (elmo-folder-diff): Ditto.
* elmo-imap4.el (elmo-folder-diff-async): Ditto.
* elmo-multi.el (elmo-folder-diff): Ditto
(elmo-multi-folder-diff): Rewrite.
+2003-08-02 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo.el (elmo-generic-folder-commit): Use elmo-folder-list-messages.
+ (elmo-folder-set-info-max-by-numdb): Changed argument to number list.
+ (elmo-generic-folder-diff): Abolish argument.
+ (elmo-msgdb-load): Don't use number-alist.
+
+ * elmo-filter.el (elmo-folder-diff): Abolish argument.
+
+ * elmo-pipe.el (elmo-folder-diff): Ditto.
+
+ * elmo-nmz.el (elmo-folder-diff): Ditto.
+
+ * elmo-net.el (elmo-folder-diff): Ditto.
+
+ * elmo-maildir.el (elmo-folder-diff): Ditto.
+
+ * elmo-imap4.el (elmo-folder-diff-async): Ditto.
+
+ * elmo-multi.el (elmo-folder-diff): Ditto
+ (elmo-multi-folder-diff): Rewrite.
+
2003-08-02 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* elmo-pipe.el (elmo-folder-msgdb): Define.
(lambda (x) (concat prefix x))
(elmo-folder-list-subfolders target one-level))))
-(luna-define-method elmo-folder-diff :around ((folder elmo-filter-folder)
- &optional numbers)
+(luna-define-method elmo-folder-diff :around ((folder elmo-filter-folder))
(let ((condition (elmo-filter-folder-condition-internal folder))
diff)
(if (vectorp condition)
(luna-define-method elmo-folder-diff-plugged ((folder elmo-imap4-folder))
(elmo-imap4-folder-diff-plugged folder))
-(luna-define-method elmo-folder-diff-async ((folder elmo-imap4-folder)
- &optional number-alist)
+(luna-define-method elmo-folder-diff-async ((folder elmo-imap4-folder))
(setq elmo-imap4-server-diff-async-callback
elmo-folder-diff-async-callback)
(setq elmo-imap4-server-diff-async-callback-data
(file-directory-p (expand-file-name "cur" basedir))
(file-directory-p (expand-file-name "tmp" basedir)))))
-(luna-define-method elmo-folder-diff ((folder elmo-maildir-folder)
- &optional numbers)
+(luna-define-method elmo-folder-diff ((folder elmo-maildir-folder))
(let* ((dir (elmo-maildir-folder-directory-internal folder))
(new-len (length (car (elmo-maildir-list-location dir "new"))))
(cur-len (length (car (elmo-maildir-list-location dir "cur")))))
(setq cur-number (+ 1 cur-number)))
t))
-(luna-define-method elmo-folder-diff ((folder elmo-multi-folder)
- &optional numbers)
- (elmo-multi-folder-diff folder numbers))
+(luna-define-method elmo-folder-diff ((folder elmo-multi-folder))
+ (elmo-multi-folder-diff folder))
-(defun elmo-multi-folder-diff (folder numbers)
+(defun elmo-multi-folder-diff (folder)
(let ((flds (elmo-multi-folder-children-internal folder))
- (num-list (and numbers (elmo-multi-split-numbers folder numbers)))
- (unsync 0)
- (messages 0)
- diffs)
+ (news 0)
+ (unreads 0)
+ (alls 0)
+ no-unreads diff)
(while flds
- (setq diffs (nconc diffs (list (elmo-folder-diff (car flds)
- (car num-list)))))
+ (setq diff (elmo-folder-diff (car flds)))
+ (cond
+ ((consp (cdr diff)) ; (new unread all)
+ (setq news (+ news (nth 0 diff))
+ unreads (+ unreads (nth 0 diff))
+ alls (+ alls (nth 0 diff))))
+ (t
+ (setq no-unreads t)
+ (setq news (+ news (car diff))
+ alls (+ alls (cdr diff)))))
(setq flds (cdr flds)))
- (while diffs
- (and (car (car diffs))
- (setq unsync (+ unsync (car (car diffs)))))
- (setq messages (+ messages (cdr (car diffs))))
- (setq diffs (cdr diffs)))
- (elmo-folder-set-info-hashtb folder nil messages)
- (cons unsync messages)))
+ (if no-unreads
+ (cons news alls)
+ (list news unreads alls))))
(luna-define-method elmo-folder-list-unreads ((folder elmo-multi-folder))
(let ((cur-number 0)
(if (elmo-folder-plugged-p folder)
(elmo-folder-send folder 'elmo-folder-check-plugged)))
-(luna-define-method elmo-folder-diff :around ((folder elmo-net-folder)
- &optional numbers)
+(luna-define-method elmo-folder-diff :around ((folder elmo-net-folder))
(if (and (elmo-folder-use-flag-p folder)
(elmo-folder-plugged-p folder))
(elmo-folder-send folder 'elmo-folder-diff-plugged)
((folder elmo-nmz-folder))
t)
-(luna-define-method elmo-folder-diff ((folder elmo-nmz-folder)
- &optional numbers)
+(luna-define-method elmo-folder-diff ((folder elmo-nmz-folder))
(cons nil nil))
(luna-define-method elmo-folder-message-make-temp-files ((folder
(luna-define-method elmo-folder-list-answereds ((folder elmo-pipe-folder))
(elmo-folder-list-answereds (elmo-pipe-folder-dst-internal folder)))
-(luna-define-method elmo-folder-status ((folder elmo-pipe-folder))
+(luna-define-method elmo-folder-diff ((folder elmo-pipe-folder))
(elmo-folder-open-internal (elmo-pipe-folder-src-internal folder))
(elmo-folder-open-internal (elmo-pipe-folder-dst-internal folder))
(let* ((elmo-inhibit-number-mapping
(src-length (length (elmo-pipe-folder-list-target-messages
(elmo-pipe-folder-src-internal folder)
(elmo-pipe-folder-copied-list-load folder))))
- (dst-list (elmo-folder-list-messages
- (elmo-pipe-folder-dst-internal folder))))
- (prog1 (cons (+ src-length (elmo-max-of-list dst-list))
- (+ src-length (length dst-list)))
+ (dst-diff (elmo-folder-diff (elmo-pipe-folder-dst-internal folder))))
+ (prog1
+ (cond
+ ((consp (cdr dst-diff)) ; new unread all
+ (mapcar (lambda (number) (+ number src-length)) dst-diff))
+ (t
+ (cons (+ (car dst-diff) src-length) (cdr dst-diff))))
;; No save.
(elmo-folder-close-internal (elmo-pipe-folder-src-internal folder))
(elmo-folder-close-internal (elmo-pipe-folder-dst-internal folder)))))
(luna-define-generic elmo-folder-use-flag-p (folder)
"Returns t if FOLDER treats unread/important flag itself.")
-(luna-define-generic elmo-folder-diff (folder &optional numbers)
+(luna-define-generic elmo-folder-diff (folder)
"Get diff of FOLDER.
-If optional NUMBERS is set, it is used as current NUMBERS.
-Otherwise, saved status for folder is used for comparison.
Return value is cons cell or list:
- a cons cell (new . all)
- a list (new unread all)")
(elmo-msgdb-get-number-alist (elmo-folder-msgdb folder)))
(elmo-folder-set-info-max-by-numdb
folder
- (elmo-msgdb-get-number-alist
- (elmo-folder-msgdb folder)))
+ (elmo-folder-list-messages folder nil 'in-msgdb))
(elmo-folder-set-message-modified-internal folder nil)
(elmo-msgdb-killed-list-save
(elmo-folder-msgdb-path folder)
(list new unread numbers max)
elmo-folder-info-hashtb)))
-(defun elmo-folder-set-info-max-by-numdb (folder msgdb-number)
+(defun elmo-folder-set-info-max-by-numdb (folder numbers)
"Set FOLDER info by MSGDB-NUMBER in msgdb."
- (let ((num-db (sort (mapcar 'car msgdb-number) '<)))
+ (let ((numbers (sort numbers '<)))
(elmo-folder-set-info-hashtb
folder
- (or (nth (max 0 (1- (length num-db))) num-db) 0)
+ (or (nth (max 0 (1- (length numbers))) numbers) 0)
nil ;;(length num-db)
)))
append-list delete-list diff)
(cons (if (equal in-folder in-db)
0
- (setq diff (elmo-list-diff
- in-folder in-db
- nil
- ))
+ (setq diff (elmo-list-diff in-folder in-db nil))
(setq append-list (car diff))
(setq delete-list (cadr diff))
(if append-list
0)))
(length in-folder))))
-(luna-define-method elmo-folder-diff ((folder elmo-folder)
- &optional numbers)
- (elmo-generic-folder-diff folder numbers))
+(luna-define-method elmo-folder-diff ((folder elmo-folder))
+ (elmo-generic-folder-diff folder))
-(defun elmo-generic-folder-diff (folder numbers)
+(defun elmo-generic-folder-diff (folder)
(if (elmo-string-match-member (elmo-folder-name-internal folder)
elmo-strict-diff-folder-list)
(elmo-strict-folder-diff folder)
(in-db t)
unsync messages
in-db-max)
- (if numbers
- (setq in-db-max (or (nth (max 0 (1- (length numbers))) numbers)
- 0))
- (if (not cached-in-db-max)
- (let ((number-list (mapcar 'car
- (elmo-msgdb-number-load
- (elmo-folder-msgdb-path folder)))))
- ;; No info-cache.
- (setq in-db (sort number-list '<))
- (setq in-db-max (or (nth (max 0 (1- (length in-db))) in-db)
- 0))
- (elmo-folder-set-info-hashtb folder in-db-max nil))
- (setq in-db-max cached-in-db-max)))
+ (if (not cached-in-db-max)
+ (let ((number-list (elmo-folder-list-messages folder
+ nil 'in-msgdb)))
+ ;; No info-cache.
+ (setq in-db (sort number-list '<))
+ (setq in-db-max (or (nth (max 0 (1- (length in-db))) in-db)
+ 0))
+ (elmo-folder-set-info-hashtb folder in-db-max nil))
+ (setq in-db-max cached-in-db-max))
(setq unsync (if (and in-db (car in-folder))
(- (car in-folder) in-db-max)
(if (and in-folder (null in-db))
(unless silent
(message "Loading msgdb for %s..." (elmo-folder-name-internal folder)))
(let ((msgdb (elmo-load-msgdb (elmo-folder-msgdb-path folder))))
- (elmo-folder-set-info-max-by-numdb folder
- (elmo-msgdb-get-number-alist msgdb))
-
+ (elmo-folder-set-info-max-by-numdb
+ folder
+ (mapcar 'elmo-msgdb-overview-entity-get-number
+ (elmo-msgdb-get-overview msgdb)))
(unless silent
(message "Loading msgdb for %s...done"
(elmo-folder-name-internal folder)))
+2003-08-02 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * wl-draft.el (wl-draft): Set buffer-undo-list as nil.
+
2003-08-01 Yoichi NAKAYAMA <yoichi@geiin.org>
* wl-summary.el (wl-summary-prefetch-msg): Update persistent mark.
(if (interactive-p)
(run-hooks 'wl-mail-setup-hook))
(goto-char (point-min))
+ (setq buffer-undo-list nil)
(wl-user-agent-compose-internal) ;; user-agent
(cond ((and
(interactive-p)
(length dels)))
(progn
(message "Deleting...")
- (elmo-folder-delete-messages
- wl-summary-buffer-elmo-folder dels)
+ (elmo-folder-delete-messages wl-summary-buffer-elmo-folder dels)
(elmo-folder-detach-messages wl-summary-buffer-elmo-folder dels)
(wl-summary-set-message-modified)
(wl-folder-set-folder-updated (wl-summary-buffer-folder-name)