+2000-10-06   Daiki Ueno  <ueno@unixuser.org>
+
+       * wl-fldmgr.el (wl-fldmgr-add-completion-all-completions): Pass
+       the 5th argument of `elmo-network-get-spec'.
+
+       * wl-thread.el (wl-thread-reparent-children): New inline function.
+       (wl-thread-delete-message): Use it.
+
+       * wl-score.el (wl-score-headers): Abolish local variable
+       (wl-summary-score-update-all-lines): Don't use `dolist'.
+
 2000-10-06  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * wl-score.el (toplevel): Remove (provide 'elmo-msgdb).  And add
 
 (eval-when-compile
   (require 'elmo-msgdb))               ; for inline functions
 
-(eval-when-compile (require 'cl))      ; dolist
-
 (defvar wl-score-edit-header-char
   '((?a "from" nil string)
     (?s "subject" nil string)
        (setq wl-scores-messages (cdr wl-scores-messages))))
     (message "Scoring...done")
     ;; Remove buffers.
-    (let (buffer)
-      (while (setq buffer (pop wl-score-header-buffer-list))
-       (elmo-kill-buffer buffer)))))
+    (while wl-score-header-buffer-list
+      (elmo-kill-buffer (pop wl-score-header-buffer-list)))))
 
 (defun wl-score-integer (scores header now expire)
   (let ((wl-score-index (nth 2 (assoc header wl-score-header-index)))
           'wl-summary-score-update-all-lines "Updating score..."
           (/ (* i 100) count))))
       (when dels
-;      (elmo-msgdb-delete-msgs wl-summary-buffer-folder-name
-;                              dels wl-summary-buffer-msgdb t)
-       ;; mark as read.
-       (setq mark-alist (elmo-msgdb-get-mark-alist wl-summary-buffer-msgdb))
-       (dolist (del dels)
-         (setq mark-alist (elmo-msgdb-mark-set mark-alist del nil)))
+       (setq mark-alist
+             (elmo-msgdb-get-mark-alist wl-summary-buffer-msgdb))
+       (let ((marks dels))
+         (while marks
+           (setq mark-alist
+                 (elmo-msgdb-mark-set mark-alist (pop marks) nil))))
        (elmo-mark-as-read wl-summary-buffer-folder-name
                           dels wl-summary-buffer-msgdb)
        (elmo-msgdb-set-mark-alist wl-summary-buffer-msgdb mark-alist)
 
 (require 'wl-summary)
 (require 'wl-highlight)
 
-(eval-when-compile (require 'cl))      ; dolist
-
 ;; buffer local variables.
 ;(defvar wl-thread-top-entity '(nil t nil nil)) ; top entity
 (defvar wl-thread-tops nil)           ; top number list (number)
     (message "Resuming thread structure...")
     ;; set obarray value.
     (setq wl-thread-entity-hashtb (elmo-make-hash (* (length entities) 2)))
-    (dolist (entity entities)
-      (elmo-set-hash-val (format "#%d" (car entity)) entity
-                        wl-thread-entity-hashtb))
     ;; set buffer local variables.
     (setq wl-thread-entities entities)
     (setq wl-thread-entity-list top-list)
+    (while entities
+      (elmo-set-hash-val (format "#%d" (car (car entities))) (car entities)
+                        wl-thread-entity-hashtb)
+      (setq entities (cdr entities)))
     (message "Resuming thread structure...done.")))
 
 (defun wl-thread-save-entity (dir)
     (nconc entity (list linked)))
   entity)
 
+(defsubst wl-thread-reparent-children (children parent)
+  (while children
+    (wl-thread-entity-set-parent
+     (wl-thread-get-entity (car children)) parent)
+    (wl-thread-entity-set-linked
+     (wl-thread-get-entity (car children)) t)
+    (setq children (cdr children))))
+
 (defsubst wl-thread-entity-insert-as-top (entity)
   (when (and entity
             (car entity))
              ;;
              (unless deep
                (setq children (wl-thread-entity-get-children entity))
-               (dolist (entity children)
-                 (wl-thread-entity-set-parent
-                  (wl-thread-get-entity entity)
-                  (wl-thread-entity-get-number parent))
-                 (wl-thread-entity-set-linked
-                  (wl-thread-get-entity entity)
-                  t)
-                 (wl-append update-msgs
-                            (wl-thread-get-children-msgs entity t))))
+               (wl-thread-reparent-children
+                children (wl-thread-entity-get-number parent))
+               (setq update-msgs
+                     (apply (function nconc)
+                            update-msgs
+                            (mapcar
+                             (function
+                              (lambda (message)
+                                (wl-thread-get-children-msgs message t))
+                              children)))))
              (wl-thread-entity-set-children
-              parent
-              (append
-               (append
-                older-brothers
-                children)
-               younger-brothers))
+              parent (append older-brothers children younger-brothers))
              ;; If chidren and younger-brothers not exists,
              ;; update nearly older brother.
              (when (and older-brothers
               (append
                (wl-thread-entity-get-children top-entity)
                children))
-             (dolist (entity children)
-               (wl-thread-entity-set-parent (wl-thread-get-entity entity)
-                                            top-child)
-               (wl-thread-entity-set-linked (wl-thread-get-entity entity)
-                                            t))
+             (wl-thread-reparent-children children top-child)
              (wl-append update-msgs children)))
          ;; delete myself from top list.
          (setq older-brothers (wl-thread-entity-get-older-brothers