Changed codename to Venus-pre2.
[elisp/wanderlust.git] / elmo / elmo-maildir.el
index c53ee3a..6fe8c22 100644 (file)
 (require 'elmo)
 (require 'elmo-map)
 
+(defcustom elmo-maildir-folder-path "~/Maildir"
+  "*Maildir folder path."
+  :type 'directory
+  :group 'elmo)
+
 ;;; ELMO Maildir folder
 (eval-and-compile
   (luna-define-class elmo-maildir-folder
 
 (luna-define-method elmo-folder-expand-msgdb-path ((folder
                                                    elmo-maildir-folder))
-  (expand-file-name 
-   (elmo-replace-string-as-filename 
+  (expand-file-name
+   (elmo-replace-string-as-filename
     (elmo-maildir-folder-directory-internal folder))
    (expand-file-name
     "maildir"
-    elmo-msgdb-dir)))
+    elmo-msgdb-directory)))
 
 (defun elmo-maildir-message-file-name (folder location)
   "Get a file name of the message from FOLDER which corresponded to
@@ -209,7 +214,10 @@ LOCATION."
     (while news
       (rename-file
        (expand-file-name (car news) (expand-file-name "new" maildir))
-       (expand-file-name (concat (car news) ":2,")
+       (expand-file-name (concat
+                         (car news)
+                         (unless (string-match ":2,[A-Z]*$" (car news))
+                           ":2,"))
                         (expand-file-name "cur" maildir)))
       (setq news (cdr news)))))
 
@@ -377,7 +385,7 @@ file name for maildir directories."
                                                         numbers
                                                         &optional
                                                         start-number)
-  (let ((temp-dir (elmo-folder-make-temp-dir folder))
+  (let ((temp-dir (elmo-folder-make-temporary-directory folder))
        (cur-number (if start-number 0)))
     (dolist (number numbers)
       (elmo-copy-file
@@ -457,7 +465,7 @@ file name for maildir directories."
          t)
       (error))))
 
-(luna-define-method elmo-folder-delete ((folder elmo-maildir-folder))
+(luna-define-method elmo-folder-delete :before ((folder elmo-maildir-folder))
   (let ((basedir (elmo-maildir-folder-directory-internal folder)))
     (condition-case nil
        (let ((tmp-files (directory-files
@@ -474,27 +482,6 @@ file name for maildir directories."
          t)
       (error nil))))
 
-(luna-define-method elmo-folder-search ((folder elmo-maildir-folder)
-                                       condition &optional numbers)
-  (save-excursion
-    (let* ((msgs (or numbers (elmo-folder-list-messages folder)))
-          (i 0)
-          case-fold-search matches
-          percent num
-          (len (length msgs))
-          number-list msg-num)
-      (setq number-list msgs)
-      (dolist (number numbers)
-       (if (elmo-file-field-condition-match
-            (elmo-message-file-name folder number)
-            condition number number-list)
-           (setq matches (cons number matches)))
-       (setq i (1+ i))
-       (elmo-display-progress
-        'elmo-maildir-search "Searching..."
-        (/ (* i 100) len)))
-      (nreverse matches))))
-
 (require 'product)
 (product-provide (provide 'elmo-maildir) (require 'elmo-version))