up
authorokada <okada>
Sat, 17 Feb 2001 12:33:45 +0000 (12:33 +0000)
committerokada <okada>
Sat, 17 Feb 2001 12:33:45 +0000 (12:33 +0000)
elmo/ChangeLog
elmo/elmo-imap4.el
elmo/elmo-msgdb.el

index f851331..e0edbdf 100644 (file)
@@ -1,5 +1,10 @@
 2000-02-17  Kenichi OKADA  <okada@opaopa.org>
 
+       * elmo-msgdb.el (elmo-msgdb-max-of-killed): New function.
+       * elmo-imap4.el (elmo-imap4-list-folder): Use killed-list.
+
+2000-02-17  Kenichi OKADA  <okada@opaopa.org>
+
        * elmo-pop3.el (elmo-network-authenticate-session): Bind `sasl-mechanisms'
 
 2001-02-16  Yuuichi Teranishi  <teranisi@gohome.org>
index aa0c58a..30954c8 100644 (file)
@@ -750,11 +750,15 @@ Returns response value if selecting folder succeed. "
      'search)))
 
 (defun elmo-imap4-list-folder (spec)
-  (let ((killed (and elmo-use-killed-list
-                    (elmo-msgdb-killed-list-load
-                     (elmo-msgdb-expand-path spec))))
-       numbers)
-    (setq numbers (elmo-imap4-list spec "all"))
+  (let* ((killed (and elmo-use-killed-list
+                     (elmo-msgdb-killed-list-load
+                      (elmo-msgdb-expand-path spec))))
+        (max (elmo-msgdb-max-of-killed killed))
+        numbers)
+    (setq numbers (elmo-imap4-list spec
+                                  (if (null (eq max 0))
+                                      (format "%d:*" (1+ max))
+                                    "all")))
     (elmo-living-messages numbers killed)))
 
 (defun elmo-imap4-list-folder-unread (spec number-alist mark-alist
index b4cbcf4..47dcd3d 100644 (file)
@@ -664,6 +664,20 @@ content of MSGDB is changed."
       (setq killed (cdr killed)))
     ret-val))
 
+(defun elmo-msgdb-max-of-killed (killed-list)
+  (let ((klist killed-list)
+       (max 0)
+       k)
+    (while (car klist)
+      (if (< max
+            (setq k
+                  (if (consp (car klist))
+                      (cdar klist)
+                    (car klist))))
+         (setq max k))
+      (setq klist (cdr klist)))
+    max))
+
 (defun elmo-living-messages (messages killed-list)
   (if killed-list
       (delq nil