From bd1c7daca8de303dd5766cb7831e964cfe3a03c5 Mon Sep 17 00:00:00 2001 From: teranisi Date: Sat, 2 Aug 2003 06:39:32 +0000 Subject: [PATCH] * wl-draft.el (wl-draft): Set buffer-undo-list as nil. * 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. --- elmo/ChangeLog | 22 ++++++++++++++++++++ elmo/elmo-filter.el | 3 +-- elmo/elmo-imap4.el | 3 +-- elmo/elmo-maildir.el | 3 +-- elmo/elmo-multi.el | 37 ++++++++++++++++++---------------- elmo/elmo-net.el | 3 +-- elmo/elmo-nmz.el | 3 +-- elmo/elmo-pipe.el | 13 +++++++----- elmo/elmo.el | 54 ++++++++++++++++++++------------------------------ wl/ChangeLog | 4 ++++ wl/wl-draft.el | 1 + wl/wl-summary.el | 3 +-- 12 files changed, 83 insertions(+), 66 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index fb8be6a..884cf87 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,25 @@ +2003-08-02 Yuuichi Teranishi + + * 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 * elmo-pipe.el (elmo-folder-msgdb): Define. diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index 296efb9..1241285 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -210,8 +210,7 @@ (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) diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 4dcddb3..0a8c707 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -2401,8 +2401,7 @@ If optional argument REMOVE is non-nil, remove FLAG." (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 diff --git a/elmo/elmo-maildir.el b/elmo/elmo-maildir.el index 9492b01..8f61227 100644 --- a/elmo/elmo-maildir.el +++ b/elmo/elmo-maildir.el @@ -540,8 +540,7 @@ file name for maildir directories." (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"))))) diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 479c474..bd8e611 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -235,27 +235,30 @@ (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) diff --git a/elmo/elmo-net.el b/elmo/elmo-net.el index 06c661e..4ef8731 100644 --- a/elmo/elmo-net.el +++ b/elmo/elmo-net.el @@ -598,8 +598,7 @@ Returned value is searched from `elmo-network-stream-type-alist'." (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) diff --git a/elmo/elmo-nmz.el b/elmo/elmo-nmz.el index 59fe128..4469b7f 100644 --- a/elmo/elmo-nmz.el +++ b/elmo/elmo-nmz.el @@ -167,8 +167,7 @@ If the value is a list, all elements are used as index paths for namazu." ((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 diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index b4e5d16..e7f2566 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -172,7 +172,7 @@ (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 @@ -180,10 +180,13 @@ (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))))) diff --git a/elmo/elmo.el b/elmo/elmo.el index eebaa03..b61152c 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -192,10 +192,8 @@ If optional KEEP-KILLED is non-nil, killed-list is not cleared.") (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)") @@ -681,8 +679,7 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).") (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) @@ -886,12 +883,12 @@ NUMBERS is a list of message numbers, messages are searched from the list." (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) ))) @@ -945,10 +942,7 @@ NUMBERS is a list of message numbers, messages are searched from the list." 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 @@ -958,11 +952,10 @@ NUMBERS is a list of message numbers, messages are searched from the 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) @@ -971,19 +964,15 @@ NUMBERS is a list of message numbers, messages are searched from the list." (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)) @@ -1587,9 +1576,10 @@ If update process is interrupted, return nil.") (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))) diff --git a/wl/ChangeLog b/wl/ChangeLog index e9055cb..703a4c8 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,7 @@ +2003-08-02 Yuuichi Teranishi + + * wl-draft.el (wl-draft): Set buffer-undo-list as nil. + 2003-08-01 Yoichi NAKAYAMA * wl-summary.el (wl-summary-prefetch-msg): Update persistent mark. diff --git a/wl/wl-draft.el b/wl/wl-draft.el index ba3bb0a..8c5a236 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1644,6 +1644,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (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) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index f0d84dd..0ef23c0 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -1945,8 +1945,7 @@ If ARG is non-nil, checking is omitted." (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) -- 1.7.10.4