2002-07-14 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+ * elmo-split.el (elmo-split): Moved to run hooks and to show
+ message from elmo-split-subr.
+ (elmo-split-subr): Follow the change above.
+
* elmo-split.el (elmo-split-subr): New function (renamed from
elmo-split-subr).
(elmo-split): Changed to call elmo-split-subr by element of
(error "Split rule doest not exist. Set `elmo-split-rule' first."))
(let ((folders (if (listp elmo-split-folder)
elmo-split-folder
- (list elmo-split-folder))))
+ (list elmo-split-folder)))
+ (count 0)
+ (fcount 0)
+ ret)
(dolist (folder folders)
- (elmo-split-subr (elmo-make-folder folder) arg))))
+ (setq ret (elmo-split-subr (elmo-make-folder folder) arg)
+ count (+ count (car ret))
+ fcount (+ fcount (cdr ret))))
+ (run-hooks 'elmo-split-hook)
+ (message
+ (concat
+ (cond
+ ((eq count 0)
+ "No message is splitted")
+ ((eq count 1)
+ "1 message is splitted")
+ (t
+ (format "%d messages are splitted" count)))
+ (if (eq fcount 0)
+ "."
+ (format " (%d failure)." fcount))))))
(defun elmo-split-subr (folder &optional reharsal)
(let ((elmo-inhibit-display-retrieval-progress t)
(elmo-progress-notify 'elmo-split)))
(elmo-folder-close-internal folder))
(elmo-progress-clear 'elmo-split))
- (run-hooks 'elmo-split-hook)
- (message
- (concat
- (cond
- ((eq count 0)
- "No message is splitted")
- ((eq count 1)
- "1 message is splitted")
- (t
- (format "%d messages are splitted" count)))
- (if (eq fcount 0)
- "."
- (format " (%d failure)." fcount))))))
+ (cons count fcount)))
(provide 'elmo-split)