From 6ad8542ce0dddd4b9f3201e11df26e4640dce6a1 Mon Sep 17 00:00:00 2001 From: hmurata Date: Sun, 14 Jul 2002 04:18:33 +0000 Subject: [PATCH] * elmo-split.el (elmo-split-subr): New function (renamed from elmo-split-subr). (elmo-split): Changed to call elmo-split-subr by element of elmo-split-folder. (elmo-split-folder): Changed customization type to choice. --- elmo/ChangeLog | 8 ++++++++ elmo/elmo-split.el | 28 +++++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 5c12eb2..a20dc1a 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,11 @@ +2002-07-14 Hiroya Murata + + * elmo-split.el (elmo-split-subr): New function (renamed from + elmo-split-subr). + (elmo-split): Changed to call elmo-split-subr by element of + elmo-split-folder. + (elmo-split-folder): Changed customization type to choice. + 2002-07-12 Hiroya Murata * elmo-split.el (elmo-split-and): Fixed condition. diff --git a/elmo/elmo-split.el b/elmo/elmo-split.el index 0b41a3e..a9765a4 100644 --- a/elmo/elmo-split.el +++ b/elmo/elmo-split.el @@ -100,8 +100,9 @@ Example: :type 'sexp) (defcustom elmo-split-folder "%inbox" - "Target folder for splitting." - :type 'string + "Target folder or list of folders for splitting." + :type '(choice (string :tag "folder name") + (repeat (string :tag "folder name"))) :group 'elmo) (defcustom elmo-split-log-coding-system 'x-ctext @@ -118,7 +119,7 @@ Example: (defvar elmo-split-match-string-internal nil "Internal variable for string matching. Don't touch this variable by hand.") -;;; +;;; (defun elmo-split-or (buffer &rest args) (catch 'done (dolist (arg args) @@ -206,9 +207,14 @@ If prefix argument ARG is specified, do a reharsal (no harm)." (interactive "P") (unless elmo-split-rule (error "Split rule doest not exist. Set `elmo-split-rule' first.")) - (let ((folder (elmo-make-folder elmo-split-folder)) - (elmo-inhibit-display-retrieval-progress t) - (reharsal arg) + (let ((folders (if (listp elmo-split-folder) + elmo-split-folder + (list elmo-split-folder)))) + (dolist (folder folders) + (elmo-split-subr (elmo-make-folder folder) arg)))) + +(defun elmo-split-subr (folder &optional reharsal) + (let ((elmo-inhibit-display-retrieval-progress t) (count 0) (fcount 0) msgs fname target-folder failure) @@ -240,7 +246,7 @@ If prefix argument ARG is specified, do a reharsal (no harm)." (progn (setq target-folder (elmo-make-folder fname)) (unless (elmo-folder-exists-p target-folder) - (when + (when (and (elmo-folder-creatable-p target-folder) @@ -279,13 +285,13 @@ If prefix argument ARG is specified, do a reharsal (no harm)." (elmo-progress-clear 'elmo-split)) (run-hooks 'elmo-split-hook) (message - (concat - (cond + (concat + (cond ((eq count 0) "No message is splitted") ((eq count 1) - "1 message is splitted") - (t + "1 message is splitted") + (t (format "%d messages are splitted" count))) (if (eq fcount 0) "." -- 1.7.10.4