* wl-score.el (wl-summary-score-update-all-lines): Use
authorteranisi <teranisi>
Tue, 22 Jul 2003 10:21:17 +0000 (10:21 +0000)
committerteranisi <teranisi>
Tue, 22 Jul 2003 10:21:17 +0000 (10:21 +0000)
wl-summary-set-mark.
(wl-summary-score-update-all-lines): Kill expunged messages.

* wl-expire.el (wl-expire-hide): Use elmo-folder-kill-messages.

* elmo-msgdb.el (elmo-msgdb-append-to-killed-list): Abolish.

* elmo-imap4.el (elmo-folder-list-messages-plugged): Fixed.
(elmo-imap4-folder-diff-plugged): Use uidnext to calculate number of
messages.

* elmo.el (elmo-folder-kill-messages-before): New function.
(elmo-folder-kill-messages): Ditto.
(elmo-folder-synchronize): Use elmo-folder-kill-messages-before.

* elmo-imap4.el (elmo-folder-list-messages-plugged):
Don't use elmo-msgdb-max-of-killed. It is harmful when messages are
killed not by synchronize (e.g. scoring).

elmo/ChangeLog
elmo/elmo-imap4.el
elmo/elmo-msgdb.el
elmo/elmo.el
wl/ChangeLog
wl/wl-expire.el
wl/wl-score.el

index 20591ba..dc8148a 100644 (file)
@@ -1,3 +1,19 @@
+2003-07-22  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-msgdb.el (elmo-msgdb-append-to-killed-list): Abolish.
+
+       * elmo-imap4.el (elmo-folder-list-messages-plugged): Fixed.
+       (elmo-imap4-folder-diff-plugged): Use uidnext to calculate number of
+       messages.
+
+       * elmo.el (elmo-folder-kill-messages-before): New function.
+       (elmo-folder-kill-messages): Ditto.
+       (elmo-folder-synchronize): Use elmo-folder-kill-messages-before.
+
+       * elmo-imap4.el (elmo-folder-list-messages-plugged): 
+       Don't use elmo-msgdb-max-of-killed. It is harmful when messages are
+       killed not by synchronize (e.g. scoring).
+
 2003-07-22  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * elmo.el (elmo-folder-search-fast): Return t if condition is not
index aedfef4..3ab05a3 100644 (file)
@@ -1853,13 +1853,17 @@ Return nil if no complete line has arrived."
 
 (luna-define-method elmo-folder-list-messages-plugged ((folder
                                                        elmo-imap4-folder)
-                                                      &optional nohide)
+                                                      &optional
+                                                      enable-killed)
   (elmo-imap4-list folder
-                  (let ((max (elmo-msgdb-max-of-killed
-                              (elmo-folder-killed-list-internal folder))))
-                    (if (or nohide
-                            (null (eq max 0)))
-                        (format "uid %d:*" (1+ max))
+                  (let ((killed
+                         (elmo-folder-killed-list-internal
+                          folder)))
+                    (if (and killed
+                             (eq (length killed) 1)
+                             (consp (car killed))
+                             (eq (car (car killed)) 1))
+                        (format "uid %d:*" (cdr (car killed)))
                       "all"))))
 
 (luna-define-method elmo-folder-list-unreads-plugged
@@ -2361,7 +2365,7 @@ If optional argument REMOVE is non-nil, remove FLAG."
 
 (defsubst elmo-imap4-folder-diff-plugged (folder)
   (let ((session (elmo-imap4-get-session folder))
-       messages new unread response killed)
+       messages new unread response killed uidnext)
 ;;; (elmo-imap4-commit spec)
     (with-current-buffer (elmo-network-session-buffer session)
       (setq elmo-imap4-status-callback nil)
@@ -2373,14 +2377,18 @@ If optional argument REMOVE is non-nil, remove FLAG."
                                         (elmo-imap4-mailbox
                                          (elmo-imap4-folder-mailbox-internal
                                           folder))
-                                        " (recent unseen messages)")))
+                                        " (recent unseen messages uidnext)")))
     (setq response (elmo-imap4-response-value response 'status))
     (setq messages (elmo-imap4-response-value response 'messages))
+    (setq uidnext (elmo-imap4-response-value response 'uidnext))
     (setq killed (elmo-msgdb-killed-list-load (elmo-folder-msgdb-path folder)))
-    (if killed
-       (setq messages (- messages
-                         (elmo-msgdb-killed-list-length
-                          killed))))
+    ;; 
+    (when killed
+      (when (and (consp (car killed))
+                (eq (car (car killed)) 1))
+       (setq messages (- uidnext (cdr (car killed)) 1)))
+      (setq messages (- messages
+                       (elmo-msgdb-killed-list-length (cdr killed)))))
     (setq new (elmo-imap4-response-value response 'recent)
          unread (elmo-imap4-response-value response 'unseen))
     (if (< unread new) (setq new unread))
index 940c253..49f1b45 100644 (file)
@@ -1040,13 +1040,6 @@ Return CONDITION itself if no entity exists in msgdb."
 (defun elmo-msgdb-set-as-killed (killed-list msg)
   (elmo-number-set-append killed-list msg))
 
-(defun elmo-msgdb-append-to-killed-list (folder msgs)
-  (elmo-folder-set-killed-list-internal
-   folder
-   (elmo-number-set-append-list
-    (elmo-folder-killed-list-internal folder)
-    msgs)))
-
 (defun elmo-msgdb-killed-list-length (killed-list)
   (let ((killed killed-list)
        (ret-val 0))
index cae7202..c9fe0f6 100644 (file)
@@ -1462,6 +1462,19 @@ FIELD is a symbol of the field.")
     (or result
        (and err (signal (car err) (cdr err))))))
 
+(defun elmo-folder-kill-messages-before (folder msg)
+  (elmo-folder-set-killed-list-internal
+   folder
+   (list (cons 1 msg))))
+
+(defun elmo-folder-kill-messages (folder numbers)
+  "Kill(hide) messages in the FOLDER with NUMBERS."
+  (elmo-folder-set-killed-list-internal
+   folder
+   (elmo-number-set-append-list (elmo-folder-killed-list-internal
+                                folder) numbers)))
+                               
+
 (luna-define-method elmo-folder-clear ((folder elmo-folder)
                                       &optional keep-killed)
   (unless keep-killed
@@ -1499,19 +1512,19 @@ If update process is interrupted, return nil.")
     (condition-case nil
        (progn
          (message "Checking folder diff...")
-         ;; TODO: killed list is loaded in elmo-folder-open and
-         ;; list-messages use internal killed-list-folder.
          (setq diff (elmo-list-diff (elmo-folder-list-messages
                                      folder
                                      (eq 'visible-only ignore-msgdb))
                                     numbers))
          (message "Checking folder diff...done")
          (setq new-list (elmo-folder-confirm-appends (car diff)))
-         ;; Set killed list.
+         ;; Set killed list as ((1 . MAX-OF-DISAPPEARED))
          (when (and (not (eq (length (car diff))
                              (length new-list)))
                     (setq diff-2 (elmo-list-diff (car diff) new-list)))
-           (elmo-msgdb-append-to-killed-list folder (car diff-2)))
+           (elmo-folder-kill-messages-before folder 
+                                             (nth (- (length (car diff-2)) 1)
+                                                  (car diff-2))))
          (setq delete-list (cadr diff))
          (if (or (equal diff '(nil nil))
                  (equal diff '(nil))
index c0b881d..4c3e531 100644 (file)
@@ -1,3 +1,11 @@
+2003-07-22  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-score.el (wl-summary-score-update-all-lines): Use
+       wl-summary-set-mark.
+       (wl-summary-score-update-all-lines): Kill expunged messages.
+
+       * wl-expire.el (wl-expire-hide): Use elmo-folder-kill-messages.
+
 2003-07-21  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * wl-score.el (wl-summary-score-update-all-lines): Don't use msgdb
index a195e0e..588249e 100644 (file)
@@ -593,7 +593,7 @@ ex. +ml/wl/1999_11/, +ml/wl/1999_12/."
   (let ((mess (format "Hiding %s msgs..." (length hide-list))))
     (message "%s" mess)
     (elmo-folder-detach-messages folder hide-list)
-    (elmo-msgdb-append-to-killed-list folder hide-list)
+    (elmo-folder-kill-messages folder hide-list)
     (elmo-folder-commit folder)
     (message "%sdone" mess)
     (cons hide-list (length hide-list))))
index 22a8623..8fc34a5 100644 (file)
@@ -1225,9 +1225,7 @@ Set `wl-score-cache' nil."
              ((and wl-summary-target-above
                    (> score wl-summary-target-above))
               (if visible
-                  (wl-summary-mark-line "*"))
-              (setq wl-summary-buffer-target-mark-list
-                    (cons num wl-summary-buffer-target-mark-list))))
+                  (wl-summary-set-mark "*"))))
        (setq alist (cdr alist))
        (when (> count elmo-display-progress-threshold)
          (setq i (1+ i))
@@ -1235,12 +1233,11 @@ Set `wl-score-cache' nil."
           'wl-summary-score-update-all-lines "Updating score..."
           (/ (* i 100) count))))
       (when dels
-       (let ((marks dels))
-         (while marks
-           (elmo-message-set-flag wl-summary-buffer-elmo-folder
-                                  (pop marks) 'read)))
-       ;; XXX Does this work?? XXX
-       ;; XXX should it be in the killed list?
+       ;;(let ((marks dels))
+       ;;(while marks
+       ;;(elmo-message-set-flag wl-summary-buffer-elmo-folder
+       ;;                                 (pop marks) 'read)))
+       (elmo-folder-kill-messages wl-summary-buffer-elmo-folder dels)
        (wl-summary-delete-messages-on-buffer dels))
       (when (and update update-unread)
        ;; Update Folder mode