From: hmurata Date: Sat, 2 Aug 2003 15:36:28 +0000 (+0000) Subject: * elmo.el (elmo-msgdb-load): Use elmo-msgdb-list-messages. X-Git-Tag: wl-2_11_6~15 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec5c134d3af552527568fa46900567f3b43eb898;p=elisp%2Fwanderlust.git * elmo.el (elmo-msgdb-load): Use elmo-msgdb-list-messages. (elmo-strict-folder-diff): Ditto. (elmo-folder-set-info-max-by-numdb): Simplify. * elmo-nntp.el (elmo-nntp-folder-msgdb-create): Use elmo-msgdb-list-messages. * elmo-msgdb.el (elmo-msgdb-seen-save): Abolish. (elmo-msgdb-list-flagged): Fixed problem when `flag' is `read'. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 3f017cc..6492931 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,15 @@ +2003-08-02 Hiroya Murata + + * elmo.el (elmo-msgdb-load): Use elmo-msgdb-list-messages. + (elmo-strict-folder-diff): Ditto. + (elmo-folder-set-info-max-by-numdb): Simplify. + + * elmo-nntp.el (elmo-nntp-folder-msgdb-create): Use + elmo-msgdb-list-messages. + + * elmo-msgdb.el (elmo-msgdb-seen-save): Abolish. + (elmo-msgdb-list-flagged): Fixed problem when `flag' is `read'. + 2003-08-02 Yuuichi Teranishi * elmo.el (elmo-folder-list-messages): Treat killed-list only when diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index 14dca36..afac3db 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -116,7 +116,6 @@ ;; LIST-OF-MARKS elmo-msgdb-unread-marks ;; LIST-OF-MARKS elmo-msgdb-answered-marks ;; LIST-OF-MARKS elmo-msgdb-uncached-marks -;; elmo-msgdb-seen-save DIR OBJ ;; elmo-msgdb-overview-save DIR OBJ ;; elmo-msgdb-message-entity MSGDB KEY @@ -703,11 +702,6 @@ header separator." elmo-msgdb-answered-cached-mark elmo-msgdb-answered-uncached-mark))))) -(defsubst elmo-msgdb-seen-save (dir obj) - (elmo-object-save - (expand-file-name elmo-msgdb-seen-filename dir) - obj)) - (defsubst elmo-msgdb-overview-save (dir overview) (elmo-object-save (expand-file-name elmo-msgdb-overview-filename dir) @@ -1328,10 +1322,10 @@ Return the updated INDEX." (list elmo-msgdb-important-mark)))))) (when mark-regexp (if (eq flag 'read) - (dolist (number (elmo-msgdb-get-number-alist msgdb)) - (unless (string-match mark-regexp (elmo-msgdb-get-mark - msgdb number)) - (setq matched (cons number matched)))) + (dolist (number (elmo-msgdb-list-messages msgdb)) + (let ((mark (elmo-msgdb-get-mark msgdb number))) + (unless (and mark (string-match mark-regexp mark)) + (setq matched (cons number matched))))) (dolist (elem (elmo-msgdb-get-mark-alist msgdb)) (if (string-match mark-regexp (cadr elem)) (setq matched (cons (car elem) matched)))))) diff --git a/elmo/elmo-net.el b/elmo/elmo-net.el index 4ef8731..b8c8577 100644 --- a/elmo/elmo-net.el +++ b/elmo/elmo-net.el @@ -385,9 +385,7 @@ Returned value is searched from `elmo-network-stream-type-alist'." (elmo-delete-if (lambda (number) (memq number deleting)) ;; current number-list. - (mapcar - 'car - (elmo-msgdb-get-number-alist (elmo-folder-msgdb folder)))) + (elmo-msgdb-list-messages (elmo-folder-msgdb folder))) ;; append appending messages (mapcar (lambda (x) (* -1 x)) (elmo-dop-spool-folder-list-messages folder)))) diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index f4fecd5..810da85 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -871,9 +871,7 @@ Don't cache if nil.") (elmo-folder-killed-list-internal folder) (car (elmo-list-diff numbers - (mapcar 'car - (elmo-msgdb-get-number-alist - ret-val)))))) + (elmo-msgdb-list-messages ret-val))))) ;; If there are canceled messages, overviews are not obtained ;; to max-number(inn 2.3?). (when (and (elmo-nntp-max-number-precedes-list-active-p) diff --git a/elmo/elmo.el b/elmo/elmo.el index e263146..b800a05 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -887,12 +887,11 @@ NUMBERS is a list of message numbers, messages are searched from the list." (defun elmo-folder-set-info-max-by-numdb (folder numbers) "Set FOLDER info by MSGDB-NUMBER in msgdb." - (let ((numbers (sort numbers '<))) - (elmo-folder-set-info-hashtb - folder - (or (nth (max 0 (1- (length numbers))) numbers) 0) - nil ;;(length num-db) - ))) + (elmo-folder-set-info-hashtb + folder + (or (car (sort numbers '>)) 0) + nil ;;(length num-db) + )) (defun elmo-folder-get-info-max (folder) "Return max number of FODLER from folder info." @@ -937,11 +936,10 @@ NUMBERS is a list of message numbers, messages are searched from the list." (defsubst elmo-strict-folder-diff (folder) "Return folder diff information strictly from FOLDER." - (let* ((dir (elmo-folder-msgdb-path folder)) - (nalist (elmo-msgdb-get-number-alist (elmo-folder-msgdb folder))) - (in-db (sort (mapcar 'car nalist) '<)) - (in-folder (elmo-folder-list-messages folder)) - append-list delete-list diff) + (let ((in-db (sort (elmo-msgdb-list-messages (elmo-folder-msgdb folder)) + '<)) + (in-folder (elmo-folder-list-messages folder)) + append-list delete-list diff) (cons (if (equal in-folder in-db) 0 (setq diff (elmo-list-diff in-folder in-db nil)) @@ -1587,8 +1585,7 @@ If update process is interrupted, return nil.") (let ((msgdb (elmo-load-msgdb (elmo-folder-msgdb-path folder)))) (elmo-folder-set-info-max-by-numdb folder - (mapcar 'elmo-msgdb-overview-entity-get-number - (elmo-msgdb-get-overview msgdb))) + (elmo-msgdb-list-messages msgdb)) (unless silent (message "Loading msgdb for %s...done" (elmo-folder-name-internal folder)))