* wl-util.el (wl-biff-check-folder-async-callback): Ditto.
* mmimap.el (mmimap-entity-section): If node-id is nil, return "0".
* elmo.el (elmo-diff-new): New inline function.
(elmo-diff-unread): Ditto.
(elmo-diff-all): Ditto.
* elmo-imap4.el (elmo-imap4-server-diff-async-callback-1): Get recent
value from responseb.
(elmo-imap4-folder-diff-plugged): Ditto.
(elmo-imap4-server-diff-async): Added recent argument.
(elmo-server-diff-async): Ditto.
(elmo-imap4-folder-diff-plugged): Ditto.
 2001-11-08  Yuuichi Teranishi  <teranisi@gohome.org>
 
-       * elmo-version.el (elmo-version): Up to 2.7.6.
-
        * mmimap.el (mmimap-entity-section): If node-id is nil, return "0".
 
+       * elmo.el (elmo-diff-new): New inline function.
+       (elmo-diff-unread): Ditto.
+       (elmo-diff-all): Ditto.
+
+       * elmo-imap4.el (elmo-imap4-server-diff-async-callback-1): Get recent
+       value from responseb.
+       (elmo-imap4-folder-diff-plugged): Ditto.
+       (elmo-imap4-server-diff-async): Added recent argument.
+       (elmo-server-diff-async): Ditto.
+       (elmo-imap4-folder-diff-plugged): Ditto.
+
+       * elmo-version.el (elmo-version): Up to 2.7.6.
+
 2001-11-05  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * elmo-util.el (elmo-parse-token): Fixed how to treat quoted-pair
 
 
 (defun elmo-imap4-server-diff-async-callback-1 (status data)
   (funcall elmo-imap4-server-diff-async-callback
-          (cons (elmo-imap4-response-value status 'unseen)
+          (list (elmo-imap4-response-value status 'recent)
+                (elmo-imap4-response-value status 'unseen)
                 (elmo-imap4-response-value status 'messages))
           data))
 
                              "status "
                              (elmo-imap4-mailbox
                               (elmo-imap4-folder-mailbox-internal folder))
-                             " (unseen messages)"))))
+                             " (recent unseen messages)"))))
 
 (luna-define-method elmo-server-diff-async ((folder elmo-imap4-folder))
   (let ((session (elmo-imap4-get-session folder)))
                              "status "
                              (elmo-imap4-mailbox
                               (elmo-imap4-folder-mailbox-internal folder))
-                             " (unseen messages)"))))
+                             " (recent unseen messages)"))))
 
 ;;; IMAP parser.
 
                                         (elmo-imap4-mailbox
                                          (elmo-imap4-folder-mailbox-internal
                                           folder))
-                                        " (unseen messages)")))
+                                        " (recent unseen messages)")))
     (setq response (elmo-imap4-response-value response 'status))
     (setq messages (elmo-imap4-response-value response 'messages))
     (setq killed (elmo-msgdb-killed-list-load (elmo-folder-msgdb-path folder)))
        (setq messages (- messages
                          (elmo-msgdb-killed-list-length
                           killed))))
-    (cons (elmo-imap4-response-value response 'unseen)
+    (list (elmo-imap4-response-value response 'recent)
+         (elmo-imap4-response-value response 'unseen)
          messages)))
 
 (luna-define-method elmo-folder-diff-plugged ((folder elmo-imap4-folder))
 
      info-alist)
     (setq elmo-folder-info-hashtb hashtb)))
 
+(defsubst elmo-diff-new (diff)
+  (when (consp (cdr diff))
+    (car diff)))
+
+(defsubst elmo-diff-unread (diff)
+  (if (consp (cdr diff))
+      (nth 1 diff)
+    (car diff)))
+
+(defsubst elmo-diff-all (diff)
+  (if (consp (cdr diff))
+      (nth 2 diff)
+    (cdr diff)))
+
 (defsubst elmo-strict-folder-diff (folder)
   "Return folder diff information strictly from FOLDER."
   (let* ((dir (elmo-folder-msgdb-path folder))
 
 (defun mmimap-entity-section (node-id)
   "Return a section string from NODE-ID"
   (cond
+   ((null node-id)
+    "0")
    ((numberp node-id)
     (number-to-string (1+ node-id)))
    ((listp node-id)
 
 2001-11-08  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * wl-folder.el (wl-folder-check-one-entity): Use `new' value of diff.
+
+       * wl-util.el (wl-biff-check-folder-async-callback): Ditto.
+
        * Version number is increased to 2.7.6.
 
 2001-11-05  Yuuichi Teranishi  <teranisi@gohome.org>
 
                           (not (elmo-folder-exists-p folder)))
                      (wl-folder-create-subr folder)
                    (signal (car err) (cdr err))))))
+        (new (elmo-diff-new nums))
+        (nums (cons (elmo-diff-unread nums) (elmo-diff-all nums)))
         unread unsync nomif)
     (if (and (eq wl-folder-notify-deleted 'sync)
             (car nums)
       (setq unread (or ;; If server diff, All unreads are
                        ; treated as unsync.
                    (if (elmo-folder-use-flag-p folder)
-                       0)
+                       (car nums))
                    (elmo-folder-get-info-unread folder)
                    (wl-summary-count-unread (elmo-msgdb-mark-load
                                              (elmo-folder-msgdb-path
                                               folder)))))
       (setq unread (min unread (- (or (cdr nums) 0) (or (car nums) 0))))
+      (when new (setq unread (- unread new)))
       (wl-folder-entity-hashtb-set wl-folder-entity-hashtb entity
-                                  (list (car nums)
+                                  (list (or new (car nums))
                                         unread
                                         (cdr nums))
                                   (get-buffer wl-folder-buffer-name)))
     (sit-for 0)
     (list (if wl-folder-notify-deleted
              (car nums)
-           (max (or (car nums) 0))) unread (cdr nums))))
+           (or new (max (or (car nums) 0)))) unread (cdr nums))))
 
 (defun wl-folder-check-entity-async (entity &optional auto)
   (let ((elmo-nntp-groups-async t)
 
       (with-current-buffer (nth 1 data)
        (wl-folder-entity-hashtb-set wl-folder-entity-hashtb
                                     (nth 0 data)
-                                    (list (car diff) 0 (cdr diff))
+                                    (list (nth 0 diff)
+                                          (nth 1 diff)
+                                          (nth 2 diff))
                                     (current-buffer))))
   (setq wl-folder-info-alist-modified t)
   (setq wl-biff-check-folders-running nil)