* elmo-nntp.el (elmo-folder-search): Body search is to search from
authorkaoru <kaoru>
Sun, 15 Jun 2003 15:50:38 +0000 (15:50 +0000)
committerkaoru <kaoru>
Sun, 15 Jun 2003 15:50:38 +0000 (15:50 +0000)
cache even if the folder is plugged.
(elmo-nntp-search-primitive): Do nothing when body search is
invoked (although it is not used by the change above).
(elmo-nntp-get-folders-info): Don't use replace-regexp.

elmo/ChangeLog
elmo/elmo-nntp.el

index 2f078d9..902bcf3 100644 (file)
@@ -1,5 +1,11 @@
 2003-06-15  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
+       * elmo-nntp.el (elmo-folder-search): Body search is to search from
+       cache even if the folder is plugged.
+       (elmo-nntp-search-primitive): Do nothing when body search is
+       invoked (although it is not used by the change above).
+       (elmo-nntp-get-folders-info): Don't use replace-regexp.
+       
        * elmo-multi.el (elmo-folder-search): Don't ignore error anymore.
 
        * elmo-localdir.el (elmo-folder-pack-numbers): onum, a member of
index 7f4e265..980db9c 100644 (file)
@@ -1164,8 +1164,7 @@ Returns a list of cons cells like (NUMBER . VALUE)"
            (elmo-list-filter from-msgs result)
          result)))
      ((string= "body" search-key)
-      (error
-"Search by BODY is not supported (Toggle the plug off to search from caches)"))
+      nil)
      (t
       (let ((val (elmo-filter-value condition))
            (negative (eq (elmo-filter-type condition) 'unmatch))
@@ -1214,7 +1213,8 @@ Returns a list of cons cells like (NUMBER . VALUE)"
 
 (luna-define-method elmo-folder-search :around ((folder elmo-nntp-folder)
                                                condition &optional from-msgs)
-  (if (elmo-folder-plugged-p folder)
+  (if (and (elmo-folder-plugged-p folder)
+          (not (string= "body" (elmo-filter-key condition))))
       (elmo-nntp-search-internal folder condition from-msgs)
     (luna-call-next-method)))
 
@@ -1272,11 +1272,11 @@ Returns a list of cons cells like (NUMBER . VALUE)"
                (postfix (elmo-nntp-folder-postfix user server port type)))
            (if (not (string= postfix ""))
                (save-excursion
-                 (replace-regexp "^\\(211 [0-9]+ [0-9]+ [0-9]+ [^ \n]+\\).*$"
-                                 (concat "\\1"
-                                         (elmo-replace-in-string
-                                          postfix
-                                          "\\\\" "\\\\\\\\\\\\\\\\"))))))
+                 (while (re-search-forward "^\\(211 [0-9]+ [0-9]+ [0-9]+ [^ \n]+\\)\\(.*\\)$" nil t)
+                   (replace-match (concat (match-string 1)
+                                          (elmo-replace-in-string
+                                           postfix
+                                           "\\\\" "\\\\\\\\\\\\\\\\")))))))
          (let (len min max group)
            (while (not (eobp))
              (condition-case ()