* utils/bbdb-wl.el (bbdb-wl-get-update-record): Use `with-current-buffer'.
authorteranisi <teranisi>
Mon, 16 Apr 2001 02:51:21 +0000 (02:51 +0000)
committerteranisi <teranisi>
Mon, 16 Apr 2001 02:51:21 +0000 (02:51 +0000)
* wl.el (wl-plugged-change): Use '<' instead of '<='.

* wl-folder.el (wl-folder-check-one-entity): Fixed last change again.

* elmo-shimbun.el (elmo-folder-open-internal): Do nothing if unplugged.
 (elmo-folder-plugged-p): Define.
 (elmo-folder-set-plugged): Ditto.
 (elmo-shimbun-msgdb-create-entity): Do nothing if there's no header.
 (elmo-folder-list-messages-internal): Return t if unplugged.

* elmo-multi.el (elmo-folder-list-messages-internal): Fixed problem
 when elmo-folder-list-messages-internal method of children returns t.

* elmo-map.el (elmo-map-folder-update-locations): Fixed problem when
 pair is nil.
 (elmo-folder-open-internal): Don't update if unplugged status.

elmo/ChangeLog
elmo/elmo-map.el
elmo/elmo-multi.el
elmo/elmo-shimbun.el
utils/bbdb-wl.el
wl/ChangeLog
wl/wl-folder.el
wl/wl.el

index e7e1ace..40e5db7 100644 (file)
@@ -1,3 +1,18 @@
+2001-04-16  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-shimbun.el (elmo-folder-open-internal): Do nothing if unplugged.
+       (elmo-folder-plugged-p): Define.
+       (elmo-folder-set-plugged): Ditto.
+       (elmo-shimbun-msgdb-create-entity): Do nothing if there's no header.
+       (elmo-folder-list-messages-internal): Return t if unplugged.
+
+       * elmo-multi.el (elmo-folder-list-messages-internal): Fixed problem
+       when elmo-folder-list-messages-internal method of children returns t.
+
+       * elmo-map.el (elmo-map-folder-update-locations): Fixed problem when
+       pair is nil.
+       (elmo-folder-open-internal): Don't update if unplugged status.
+
 2001-04-13  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * elmo.el (elmo-folder-synchronize): Fixed problem when there's no
index 6b74027..d36d1b0 100644 (file)
                         (elmo-map-folder-location-hash-internal
                          folder)))
                  location-alist))
-      (elmo-clear-hash-val (concat "#" (int-to-string (car pair)))
-                          (elmo-map-folder-location-hash-internal
-                           folder))
-      (elmo-clear-hash-val location
-                          (elmo-map-folder-location-hash-internal
-                           folder)))
+      (when pair
+       (elmo-clear-hash-val (concat "#" (int-to-string (car pair)))
+                            (elmo-map-folder-location-hash-internal
+                             folder))
+       (elmo-clear-hash-val location
+                            (elmo-map-folder-location-hash-internal
+                             folder))))
     (setq i (elmo-map-folder-number-max-internal folder))
     (dolist (location new-locs)
       (setq i (1+ i))
   (elmo-map-folder-location-setup
    folder 
    (elmo-msgdb-location-load (elmo-folder-msgdb-path folder)))
-  (elmo-map-folder-update-locations
-   folder
-   (elmo-map-folder-list-message-locations folder)))
+  (if (elmo-folder-plugged-p folder)
+      (elmo-map-folder-update-locations
+       folder
+       (elmo-map-folder-list-message-locations folder))))
 
 (luna-define-method elmo-folder-commit :after ((folder elmo-map-folder))
   (when (elmo-folder-persistent-p folder)
index 6039f46..37eee2b 100644 (file)
   ((folder elmo-multi-folder) &optional nohide)
   (let* ((flds (elmo-multi-folder-children-internal folder))
         (cur-number 0)
-        numbers)
+        list numbers)
     (while flds
       (setq cur-number (+ cur-number 1))
-      (setq numbers (append
-                    numbers
-                    (mapcar
-                     (function
-                      (lambda (x)
-                        (+
-                         (* (elmo-multi-folder-divide-number-internal
-                             folder) cur-number) x)))
-                     (elmo-folder-list-messages-internal (car flds)))))
+      (setq list (elmo-folder-list-messages-internal (car flds)))
+      (setq numbers
+           (append
+            numbers
+            (if (listp list)
+                (mapcar
+                 (function
+                  (lambda (x)
+                    (+
+                     (* (elmo-multi-folder-divide-number-internal
+                         folder) cur-number) x)))
+                 list)
+              ;; Use current list.
+              (elmo-delete-if
+               (lambda (num)
+                 (not
+                  (eq cur-number (/ num
+                                    (elmo-multi-folder-divide-number-internal
+                                     folder)))))
+               (mapcar
+                'car
+                (elmo-msgdb-get-number-alist
+                 (elmo-folder-msgdb folder)))))))
       (setq flds (cdr flds)))
     numbers))
 
index e0caf68..1fb7e0e 100644 (file)
 
 (luna-define-method elmo-folder-open-internal :before ((folder
                                                        elmo-shimbun-folder))
-  (shimbun-open-group
-   (elmo-shimbun-folder-shimbun-internal folder)
-   (elmo-shimbun-folder-group-internal folder))
-  (elmo-shimbun-folder-set-headers-internal
-   folder (shimbun-headers
-          (elmo-shimbun-folder-shimbun-internal folder)))
-  (elmo-shimbun-folder-set-header-hash-internal
-   folder
-   (elmo-make-hash (length (elmo-shimbun-folder-headers-internal folder))))
-  ;; Set up header hash.
-  (dolist (header (elmo-shimbun-folder-headers-internal folder))
-    (elmo-set-hash-val
-     (shimbun-header-id header) header
-     (elmo-shimbun-folder-header-hash-internal folder))))
+  (when (elmo-folder-plugged-p folder)
+    (shimbun-open-group
+     (elmo-shimbun-folder-shimbun-internal folder)
+     (elmo-shimbun-folder-group-internal folder))
+    (elmo-shimbun-folder-set-headers-internal
+     folder (shimbun-headers
+            (elmo-shimbun-folder-shimbun-internal folder)))
+    (elmo-shimbun-folder-set-header-hash-internal
+     folder
+     (elmo-make-hash (length (elmo-shimbun-folder-headers-internal folder))))
+    ;; Set up header hash.
+    (dolist (header (elmo-shimbun-folder-headers-internal folder))
+      (elmo-set-hash-val
+       (shimbun-header-id header) header
+       (elmo-shimbun-folder-header-hash-internal folder)))))
 
 (luna-define-method elmo-folder-close-internal :after ((folder
                                                        elmo-shimbun-folder))
   (elmo-shimbun-folder-set-header-hash-internal
    folder nil))
 
+(luna-define-method elmo-folder-plugged-p ((folder elmo-shimbun-folder))
+  (elmo-plugged-p
+   "shimbun" 
+   (shimbun-server-internal (elmo-shimbun-folder-shimbun-internal folder))
+   nil nil
+   (shimbun-server-internal (elmo-shimbun-folder-shimbun-internal folder))))
+                           
+(luna-define-method elmo-folder-set-plugged ((folder elmo-shimbun-folder)
+                                            plugged &optional add)
+  (elmo-set-plugged plugged
+                   "shimbun"
+                   (shimbun-server-internal
+                    (elmo-shimbun-folder-shimbun-internal folder))
+                   nil nil nil
+                   (shimbun-server-internal
+                    (elmo-shimbun-folder-shimbun-internal folder))
+                   add))
+
 (luna-define-method elmo-folder-check :after ((folder elmo-shimbun-folder))
   (when (shimbun-current-group-internal 
         (elmo-shimbun-folder-shimbun-internal folder))
    (expand-file-name "shimbun" elmo-msgdb-dir)))
                     
 (defun elmo-shimbun-msgdb-create-entity (folder number)
-  (with-temp-buffer
-    (shimbun-header-insert
-     (elmo-get-hash-val
-      (elmo-map-message-location folder number)
-      (elmo-shimbun-folder-header-hash-internal folder)))
-    (elmo-msgdb-create-overview-from-buffer number)))
+  (let ((header (elmo-get-hash-val
+                (elmo-map-message-location folder number)
+                (elmo-shimbun-folder-header-hash-internal folder))))
+    (when header
+      (with-temp-buffer
+       (shimbun-header-insert header)
+       (elmo-msgdb-create-overview-from-buffer number)))))
 
 (luna-define-method elmo-folder-msgdb-create ((folder elmo-shimbun-folder)
                                              numlist new-mark
                        (elmo-shimbun-folder-header-hash-internal folder)))
       (buffer-string))))
 
+(luna-define-method elmo-folder-list-messages-internal :around
+  ((folder elmo-shimbun-folder) &optional nohide)
+  (if (elmo-folder-plugged-p folder)
+      (luna-call-next-method)
+    t))
+
 (luna-define-method elmo-map-folder-list-message-locations
   ((folder elmo-shimbun-folder))
   (mapcar
index 8f99292..e0ef325 100644 (file)
@@ -63,9 +63,9 @@
   (bbdb-save-db t))
 
 (defun bbdb-wl-get-update-record ()
-  (set-buffer (wl-message-get-original-buffer))
-  (bbdb-wl-update-record)
-  (run-hooks 'bbdb-wl-get-update-record-hook))
+  (with-current-buffer (wl-message-get-original-buffer)
+    (bbdb-wl-update-record)
+    (run-hooks 'bbdb-wl-get-update-record-hook)))
 
 (defun bbdb-wl-hide-bbdb-buffer ()
   (let (bbdb-buf bbdb-win)
index f02f064..6d69529 100644 (file)
@@ -1,3 +1,9 @@
+2001-04-16  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl.el (wl-plugged-change): Use '<' instead of '<='.
+
+       * wl-folder.el (wl-folder-check-one-entity): Fixed last change again.
+
 2001-04-14  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-folder.el (wl-folder-check-one-entity): Fixed last change.
index bd6a274..bd3bd1a 100644 (file)
@@ -837,7 +837,7 @@ Optional argument ARG is repeart count."
                    (wl-summary-count-unread (elmo-msgdb-mark-load
                                              (elmo-folder-msgdb-path
                                               folder)))))
-      (setq unread (min unread (cdr nums)))
+      (setq unread (min unread (- (or (cdr nums) 0) (or (car nums) 0))))
       (wl-folder-entity-hashtb-set wl-folder-entity-hashtb entity
                                   (list (car nums)
                                         unread
index fbccd34..ac33a30 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -450,7 +450,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
            (enlarge-window (- window-lines (window-height)))
            (when (fboundp 'pos-visible-in-window-p)
              (goto-char (point-min))
-             (while (and (<= (window-height) max-lines)
+             (while (and (< (window-height) max-lines)
                          (not (pos-visible-in-window-p (1- (point-max)))))
                (enlarge-window 2))))
        (error))