* elmo-pop3.el (elmo-pop3-read-contents): Add `elmo-pop3-read-point' barrier.
[elisp/wanderlust.git] / elmo / elmo-split.el
index 28bebd2..630b707 100644 (file)
@@ -297,7 +297,7 @@ If prefix argument ARG is specified, do a reharsal (no harm)."
        (fcount 0)
        ret)
     (dolist (folder folders)
-      (setq ret (elmo-split-subr (elmo-make-folder folder) arg)
+      (setq ret (elmo-split-subr (elmo-get-folder folder) arg)
            count (+ count (car ret))
            fcount (+ fcount (cdr ret))))
     (run-hooks 'elmo-split-hook)
@@ -316,8 +316,7 @@ If prefix argument ARG is specified, do a reharsal (no harm)."
     count))
 
 (defun elmo-split-subr (folder &optional reharsal)
-  (let ((elmo-inhibit-display-retrieval-progress t)
-       (count 0)
+  (let ((count 0)
        (fcount 0)
        (default-rule `((t ,elmo-split-default-action)))
        msgs action target-folder failure delete-substance
@@ -325,10 +324,10 @@ If prefix argument ARG is specified, do a reharsal (no harm)."
     (message "Splitting...")
     (elmo-folder-open-internal folder)
     (setq msgs (elmo-folder-list-messages folder))
-    (elmo-progress-set 'elmo-split (length msgs) "Splitting...")
-    (unwind-protect
-       (progn
+    (elmo-with-progress-display (elmo-split (length msgs)) "Splitting messages"
+      (unwind-protect
          (with-temp-buffer
+           (set-buffer-multibyte nil)
            (dolist (msg msgs)
              (erase-buffer)
              (when (ignore-errors
@@ -358,7 +357,7 @@ If prefix argument ARG is specified, do a reharsal (no harm)."
                         ((stringp action)
                          (condition-case nil
                              (progn
-                               (setq target-folder (elmo-make-folder action))
+                               (setq target-folder (elmo-get-folder action))
                                (unless (elmo-folder-exists-p target-folder)
                                  (when
                                      (and
@@ -435,8 +434,7 @@ If prefix argument ARG is specified, do a reharsal (no harm)."
                      (unless (eq (nth 2 rule) 'continue)
                        (throw 'terminate nil))))))
              (elmo-progress-notify 'elmo-split)))
-         (elmo-folder-close-internal folder))
-      (elmo-progress-clear 'elmo-split))
+       (elmo-folder-close-internal folder)))
     (cons count fcount)))
 
 (require 'product)