From: hmurata Date: Sat, 16 Oct 2004 03:00:44 +0000 (+0000) Subject: (elmo-filter-folder-copy-flag-count): New X-Git-Tag: wl-2_12-root~56 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=48d1ed40311b0fd45c6a82c16f1d0eda6c1332bd;p=elisp%2Fwanderlust.git (elmo-filter-folder-copy-flag-count): New function. (elmo-folder-delete-messages): Detach messages before delete messages from target folder. (elmo-folder-detach-messages): Set updated number-list to slot. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 7308b10..ef08514 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,11 @@ +2004-10-16 Hiroya Murata + + * elmo-filter.el (elmo-filter-folder-copy-flag-count): New + function. + (elmo-folder-delete-messages): Detach messages before delete + messages from target folder. + (elmo-folder-detach-messages): Set updated number-list to slot. + 2004-10-14 Hiroya Murata * elmo-filter.el (elmo-folder-detach-messages): Always return t. diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index cca26ca..8c59e89 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -92,6 +92,9 @@ folder (elmo-folder-list-messages folder t t)))) +(defun elmo-filter-folder-copy-flag-count (flag-counts) + (mapcar (lambda (pair) (cons (car pair) (cdr pair))) flag-counts)) + (luna-define-method elmo-folder-open :after ((folder elmo-filter-folder) &optional load-msgdb) (when load-msgdb @@ -181,9 +184,18 @@ (luna-define-method elmo-folder-delete-messages ((folder elmo-filter-folder) numbers) - (and (elmo-folder-delete-messages - (elmo-filter-folder-target-internal folder) numbers) - (elmo-folder-detach-messages folder numbers))) + (let ((flag-count (elmo-filter-folder-copy-flag-count + (elmo-filter-folder-flag-count-internal folder))) + (messages (copy-sequence + (elmo-filter-folder-number-list-internal folder))) + success) + (elmo-folder-detach-messages folder numbers) + (unless (setq success + (elmo-folder-delete-messages + (elmo-filter-folder-target-internal folder) numbers)) + (elmo-filter-folder-set-flag-count-internal folder flag-count) + (elmo-filter-folder-set-number-list-internal folder messages)) + success)) (luna-define-method elmo-folder-list-messages ((folder elmo-filter-folder) &optional visible-only in-msgdb) @@ -418,7 +430,9 @@ (luna-define-method elmo-folder-detach-messages ((folder elmo-filter-folder) numbers) (elmo-filter-folder-countup-message-flags folder numbers -1) - (elmo-list-delete numbers (elmo-filter-folder-number-list folder) #'delq) + (elmo-filter-folder-set-number-list-internal + folder + (elmo-list-delete numbers (elmo-filter-folder-number-list folder) #'delq)) t) (luna-define-method elmo-folder-length ((folder elmo-filter-folder))