From: teranisi Date: Thu, 17 Jul 2003 07:03:21 +0000 (+0000) Subject: * wl-summary.el (wl-summary-set-message-modified): X-Git-Tag: elmo-mark-restart~42 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ae5cea002ba8282eabecb4a0c01022a48b5f8bb;p=elisp%2Fwanderlust.git * wl-summary.el (wl-summary-set-message-modified): Call wl-summary-set-mark-modified. (wl-summary-delete-messages-on-buffer): Call wl-folder-set-folder-updated instead of wl-folder-update-unread. (wl-summary-sync-update): Call elmo-folder-length instead of elmo-folder-messages. (wl-summary-insert-headers): Don't call elmo-folder-list-message-entities. * elmo.el (elmo-folder-list-message-entities): Define as inline function. (elmo-folder-messages): Abolish. * elmo-multi.el (elmo-folder-check): Call elmo-folder-check for each folder. (elmo-folder-synchronize): Define. (elmo-message-entity): Define. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index e7c5fa5..fc10def 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,14 @@ +2003-07-17 Yuuichi Teranishi + + * elmo.el (elmo-folder-list-message-entities): Define as inline + function. + (elmo-folder-messages): Abolish. + + * elmo-multi.el (elmo-folder-check): Call elmo-folder-check for each + folder. + (elmo-folder-synchronize): Define. + (elmo-message-entity): Define. + 2003-07-16 Yuuichi Teranishi * elmo-imap4.el (elmo-folder-delete-messages-plugged): Call diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index eebcd1e..27b06ec 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -65,7 +65,7 @@ (luna-define-method elmo-folder-check ((folder elmo-multi-folder)) (dolist (fld (elmo-multi-folder-children-internal folder)) - (elmo-folder-synchronize fld))) + (elmo-folder-check fld))) (luna-define-method elmo-folder-close-internal ((folder elmo-multi-folder)) (dolist (fld (elmo-multi-folder-children-internal folder)) @@ -75,6 +75,12 @@ (dolist (fld (elmo-multi-folder-children-internal folder)) (elmo-folder-set-msgdb-internal fld nil))) +(luna-define-method elmo-folder-synchronize ((folder elmo-multi-folder) + &optional ignore-msgdb + no-check) + (dolist (fld (elmo-multi-folder-children-internal folder)) + (elmo-folder-synchronize fld ignore-msgdb no-check))) + (luna-define-method elmo-folder-expand-msgdb-path ((folder elmo-multi-folder)) (expand-file-name (elmo-replace-string-as-filename @@ -113,6 +119,21 @@ (nth (- (/ number (elmo-multi-folder-divide-number-internal folder)) 1) (elmo-multi-folder-children-internal folder))) +(luna-define-method elmo-message-entity ((folder elmo-folder) key) + (cond + ((numberp key) + (elmo-msgdb-message-entity (elmo-folder-msgdb + (elmo-message-folder folder key)) + key)) + ((stringp key) + (let ((children (elmo-multi-folder-children-internal folder)) + match) + (while children + (when (setq match (elmo-message-entity (car children) key)) + (setq children nil)) + (setq children (cdr children))) + match)))) + (defun elmo-multi-msgdb (msgdb base) (list (mapcar (function (lambda (x) diff --git a/elmo/elmo.el b/elmo/elmo.el index d7be5bd..752717d 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1092,8 +1092,6 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).") (elmo-folder-close dst-folder))) (if (and (not no-delete) succeeds) (progn - ;;(if (not no-delete-info) - ;;(message "Cleaning up src folder...")) (if (and (elmo-folder-delete-messages src-folder succeeds) (elmo-msgdb-delete-msgs (elmo-folder-msgdb src-folder) succeeds)) @@ -1101,9 +1099,6 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).") (message "move: delete messages from %s failed." (elmo-folder-name-internal src-folder)) (setq result nil)) - ;;(if (and result - ;;(not no-delete-info)) - ;;(message "Cleaning up src folder...done")) result) (if no-delete (progn @@ -1140,22 +1135,6 @@ If CACHED is t, message is set as cached." (elmo-message-use-cache-p folder number)) (elmo-folder-set-mark-modified-internal folder t))) -(luna-define-generic elmo-folder-list-message-entities (folder - &optional numbers - in-msgdb) - "List message-entity structure of FOLDER. -If optional NUMBERS is specified, only the corresponding entities are -retrieved. -If second optional IN-MSGDB is specified, only entities in the msgdb are -retreived (don't retrieve entities from folder).") - -(luna-define-method elmo-folder-list-message-entities ((folder elmo-folder) - &optional numbers - in-msgdb) - (if numbers - (mapcar (lambda (x) (elmo-message-entity folder x)) numbers) - (elmo-msgdb-get-overview (elmo-folder-msgdb folder)))) - (luna-define-generic elmo-message-entity (folder key) "Return the message-entity structure which matches to the KEY. KEY is a number or a string. @@ -1176,6 +1155,12 @@ ENTITY is the message-entity to get the parent.") (def-edebug-spec elmo-folder-do-each-message-entity ((symbolp form &rest form) &rest form)) +(defsubst elmo-folder-list-message-entities (folder) + ;; List all message entities in the FOLDER. + (mapcar + (lambda (number) (elmo-message-entity folder number)) + (elmo-folder-list-messages folder t t))) + (defmacro elmo-folder-do-each-message-entity (spec &rest form) "Iterator for message entity in the folder. \(elmo-folder-do-each-message-entity \(entity folder\) @@ -1539,12 +1524,6 @@ If update process is interrupted, return nil.") (elmo-folder-set-killed-list-internal folder killed-list) nil)))) -(defun elmo-folder-messages (folder) - "Return number of messages in the FOLDER." - (length - (elmo-msgdb-get-number-alist - (elmo-folder-msgdb folder)))) - (luna-define-generic elmo-folder-length (folder) "Return number of messages in the FOLDER.") diff --git a/wl/ChangeLog b/wl/ChangeLog index 6c26c5a..f86443e 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,14 @@ +2003-07-17 Yuuichi Teranishi + + * wl-summary.el (wl-summary-set-message-modified): + Call wl-summary-set-mark-modified. + (wl-summary-delete-messages-on-buffer): Call + wl-folder-set-folder-updated instead of wl-folder-update-unread. + (wl-summary-sync-update): Call elmo-folder-length instead of + elmo-folder-messages. + (wl-summary-insert-headers): Don't call + elmo-folder-list-message-entities. + 2003-07-17 Hiroya Murata * wl-action.el (wl-summary-define-mark-action): Call diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 5b54d4f..bbcb30f 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -1050,7 +1050,8 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (defun wl-summary-set-message-modified () (elmo-folder-set-message-modified-internal wl-summary-buffer-elmo-folder t) - (setq wl-summary-buffer-message-modified t)) + (setq wl-summary-buffer-message-modified t) + (wl-summary-set-mark-modified)) (defun wl-summary-message-modified-p () wl-summary-buffer-message-modified) (defun wl-summary-set-mark-modified () @@ -1725,9 +1726,11 @@ If ARG is non-nil, checking is omitted." ;;(message (concat deleting-info "done")) (wl-summary-count-unread) (wl-summary-update-modeline) - (wl-folder-update-unread - (wl-summary-buffer-folder-name) - (+ wl-summary-buffer-unread-count wl-summary-buffer-new-count))))) + (wl-folder-set-folder-updated + (elmo-folder-name-internal wl-summary-buffer-elmo-folder) + (list 0 + (+ wl-summary-buffer-unread-count wl-summary-buffer-new-count) + (elmo-folder-length wl-summary-buffer-elmo-folder)))))) (defun wl-summary-replace-status-marks (before after) "Replace the status marks on buffer." @@ -1966,7 +1969,7 @@ If ARG is non-nil, checking is omitted." (list 0 (let ((lst (wl-summary-count-unread))) (+ (car lst) (nth 1 lst))) - (elmo-folder-messages folder))) + (elmo-folder-length folder))) (wl-summary-update-modeline) ;; (unless unset-cursor @@ -2525,14 +2528,14 @@ If ARG, without confirm." wl-summary-alike-hashtb))) (defun wl-summary-insert-headers (folder func mime-decode) - (let ((entities (elmo-folder-list-message-entities folder nil t)) + (let ((numbers (elmo-folder-list-messages folder t t)) ov this last alike) (buffer-disable-undo (current-buffer)) (make-local-variable 'wl-summary-alike-hashtb) - (setq wl-summary-alike-hashtb (elmo-make-hash (* (length entities) 2))) + (setq wl-summary-alike-hashtb (elmo-make-hash (* (length numbers) 2))) (when mime-decode (elmo-set-buffer-multibyte default-enable-multibyte-characters)) - (while (setq ov (pop entities)) + (while (setq ov (elmo-message-entity folder (pop numbers))) (setq this (funcall func ov)) (and this (setq this (std11-unfold-string this))) (if (equal last this)