Fix typo.
[elisp/wanderlust.git] / elmo / elmo-internal.el
index e402bf8..1c5b66b 100644 (file)
@@ -1,6 +1,6 @@
 ;;; elmo-internal.el -- Internal Interface for ELMO.
 
-;; Copyright 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
+;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
 
 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
 ;; Keywords: mail, net news
@@ -49,7 +49,7 @@
       (setq numbers (sort flist '<))
       (elmo-living-messages numbers killed))))
 
-(defun elmo-internal-list-folder (spec)
+(defun elmo-internal-list-folder (spec &optional nohide)
   (elmo-internal-list-folder-subr spec))
 
 (defun elmo-internal-list-folder-by-location (spec location &optional msgdb)
                   mark-alist
                   (elmo-msgdb-overview-entity-get-number
                    entity)
-                                       ;(nth 0 entity)
+;;;               (nth 0 entity)
                   (or (elmo-msgdb-global-mark-get
                        (elmo-msgdb-overview-entity-get-id
                         entity))
           'elmo-internal-msgdb-create "Creating msgdb..."
           percent))
        (setq numlist (cdr numlist)))
-      (message "Creating msgdb...done.")
+      (message "Creating msgdb...done")
       (list overview number-alist mark-alist loc-alist))))
 
 (defalias 'elmo-internal-msgdb-create-as-numlist 'elmo-internal-msgdb-create)
   (let ((pair (assq number loc-alist)))
     (elmo-msgdb-global-mark-delete (cdr pair))))
 
-(defun elmo-internal-read-msg (spec number outbuf &optional msgdb)
+(defun elmo-internal-read-msg (spec number outbuf &optional msgdb unread)
   (save-excursion
     (let* ((loc-alist (if msgdb (elmo-msgdb-get-location msgdb)
                        (elmo-msgdb-location-load (elmo-msgdb-expand-path
   nil)
 
 (defun elmo-internal-search (spec condition &optional from-msgs msgdb)
-  (let* ((mark-alist
-        (or elmo-msgdb-global-mark-alist
-            (setq elmo-msgdb-global-mark-alist
-                  (elmo-object-load (expand-file-name
-                                     elmo-msgdb-global-mark-filename
-                                     elmo-msgdb-dir)))))
+  (let* ((msgs (or from-msgs (elmo-internal-list-folder spec)))
         (loc-alist (if msgdb (elmo-msgdb-get-location msgdb)
                      (elmo-msgdb-location-load (elmo-msgdb-expand-path
                                                 spec))))
         (number-list (mapcar 'car loc-alist))
+        (i 0)
+        (num (length msgs))
         cache-file
-        ret-val
-        case-fold-search msg
-        percent i num)
-    (setq num (length loc-alist))
-    (setq i 0)
-    (while loc-alist
-      (if (and (setq cache-file (elmo-cache-exists-p (cdr (car loc-alist))))
+        matched
+        case-fold-search)
+    (setq num (length msgs))
+    (while msgs
+      (if (and (setq cache-file (elmo-cache-get-path (cdr (assq (car msgs)
+                                                               loc-alist))))
+              (file-exists-p cache-file)
               (elmo-file-field-condition-match cache-file
                                                condition
-                                               (car (car loc-alist))
+                                               (car msgs)
                                                number-list))
-         (setq ret-val (append ret-val (list (car (car loc-alist))))))
-      (setq i (1+ i))
-      (setq percent (/ (* i 100) num))
+         (setq matched (nconc matched (list (car msgs)))))
       (elmo-display-progress
        'elmo-internal-search "Searching..."
-       percent)
-      (setq loc-alist (cdr loc-alist)))
-    ret-val))
+       (/ (* (setq i (1+ i)) 100) num))
+      (setq msgs (cdr msgs)))
+    matched))
 
 (defun elmo-internal-use-cache-p (spec number)
   nil)