From 8282f99f2c8a1ad6b8b6682a29d629fbe2e83419 Mon Sep 17 00:00:00 2001 From: yoichi Date: Tue, 20 Jul 2004 14:30:52 +0000 Subject: [PATCH] Merge from trunk: 2004-07-15 Yoichi NAKAYAMA * elmo-archive.el (elmo-archive-folder-append-buffer): Return nil on failure. 2004-07-12 Yoichi NAKAYAMA * elmo.el (elmo-folder-append-messages): Note on return value. * elmo-archive.el (elmo-folder-append-messages): Don't return message numbers which could not be appended. 2004-04-11 Yoichi NAKAYAMA * elmo.el (elmo-folder-append-buffer): Add note on return value. * elmo-cache.el (elmo-folder-append-buffer): Return nil on failure. * elmo-localdir.el (elmo-folder-append-buffer): Ditto. * elmo-split.el (elmo-split-subr): Check return value of elmo-folder-append-buffer. * elmo-cache.el (elmo-folder-append-buffer): Check existence of message-id. --- elmo/ChangeLog | 22 ++++++++++++++++++++++ elmo/elmo-archive.el | 13 +++++++------ elmo/elmo-cache.el | 20 ++++++++++++-------- elmo/elmo-localdir.el | 3 ++- elmo/elmo-split.el | 2 +- elmo/elmo.el | 8 +++++--- 6 files changed, 49 insertions(+), 19 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index a16b217..dc10948 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,25 @@ +2004-07-15 Yoichi NAKAYAMA + + * elmo-archive.el (elmo-archive-folder-append-buffer): Return nil + on failure. + +2004-07-12 Yoichi NAKAYAMA + + * elmo.el (elmo-folder-append-messages): Note on return value. + * elmo-archive.el (elmo-folder-append-messages): Don't return + message numbers which could not be appended. + +2004-04-11 Yoichi NAKAYAMA + + * elmo.el (elmo-folder-append-buffer): Add note on return value. + * elmo-cache.el (elmo-folder-append-buffer): Return nil on failure. + * elmo-localdir.el (elmo-folder-append-buffer): Ditto. + * elmo-split.el (elmo-split-subr): Check return value of + elmo-folder-append-buffer. + + * elmo-cache.el (elmo-folder-append-buffer): Check existence of + message-id. + 2002-05-05 David Smith * elmo-imap4.el (elmo-imap4-folder-diff-plugged): diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index f76d026..211303c 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -616,8 +616,7 @@ TYPE specifies the archiver's symbol." (copy-to-buffer dst-buffer (point-min) (point-max))) (as-binary-output-file (write-region (point-min) (point-max) newfile nil 'no-msg)) - (elmo-archive-call-method method (list arc newfile)) - t) + (elmo-archive-call-method method (list arc newfile))) nil)))))) (luna-define-method elmo-folder-append-messages :around @@ -630,9 +629,10 @@ TYPE specifies the archiver's symbol." (elmo-folder-message-file-p src-folder) (elmo-folder-message-file-number-p src-folder)) ;; same-number(localdir, localnews) -> archive - (elmo-archive-append-files folder - (elmo-folder-message-file-directory src-folder) - numbers) + (unless (elmo-archive-append-files folder + (elmo-folder-message-file-directory src-folder) + numbers) + (setq numbers nil)) (elmo-progress-notify 'elmo-folder-move-messages (length numbers)) numbers) ((elmo-folder-message-make-temp-file-p src-folder) @@ -667,7 +667,8 @@ TYPE specifies the archiver's symbol." (if (elmo-archive-append-files folder base-dir files) - (elmo-delete-directory temp-dir))) + (elmo-delete-directory temp-dir) + (setq numbers nil))) (elmo-progress-notify 'elmo-folder-move-messages (length numbers)) numbers) (t (luna-call-next-method))))) diff --git a/elmo/elmo-cache.el b/elmo/elmo-cache.el index 67d80b7..4d8fa17 100644 --- a/elmo/elmo-cache.el +++ b/elmo/elmo-cache.el @@ -131,14 +131,18 @@ &optional number) ;; dir-name is changed according to msgid. (unless (elmo-cache-folder-dir-name-internal folder) - (let* ((file (elmo-file-cache-get-path (std11-field-body "message-id"))) - (dir (directory-file-name (file-name-directory file)))) - (unless (file-exists-p dir) - (elmo-make-directory dir)) - (when (file-writable-p file) - (write-region-as-binary - (point-min) (point-max) file nil 'no-msg)))) - t) + (let ((msgid (std11-field-body "message-id")) + file dir) + (when msgid + (setq file (elmo-file-cache-get-path msgid)) + (setq dir (directory-file-name (file-name-directory file))) + (unless (file-exists-p dir) + (elmo-make-directory dir)) + (when (and (file-writable-p file) + (not (file-exists-p file))) + (write-region-as-binary + (point-min) (point-max) file nil 'no-msg) + t))))) (luna-define-method elmo-map-folder-delete-messages ((folder elmo-cache-folder) locations) diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 176b4ef..7836769 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -224,7 +224,8 @@ folder (or number (1+ (car (elmo-folder-status folder))))))) - (when (file-writable-p filename) + (when (and (file-writable-p filename) + (not (file-exists-p filename))) (write-region-as-binary (point-min) (point-max) filename nil 'no-msg) t))) diff --git a/elmo/elmo-split.el b/elmo/elmo-split.el index 03a975e..24c6789 100644 --- a/elmo/elmo-split.el +++ b/elmo/elmo-split.el @@ -326,7 +326,7 @@ If prefix argument ARG is specified, do a reharsal (no harm)." action))) (elmo-folder-create target-folder))) (elmo-folder-open-internal target-folder) - (elmo-folder-append-buffer target-folder 'unread) + (setq failure (not (elmo-folder-append-buffer target-folder 'unread))) (elmo-folder-close-internal target-folder)) (error (setq failure t) (incf fcount))) diff --git a/elmo/elmo.el b/elmo/elmo.el index 3dcec71..43e0d90 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -362,7 +362,8 @@ NUMBERS is a list of message numbers to be processed.") FOLDER is the destination folder(ELMO folder structure). If UNREAD is non-nil, message is appended as unread. If optional argument NUMBER is specified, the new message number is set -\(if possible\).") +\(if possible\). +Return nil on failure.") (luna-define-generic elmo-folder-append-messages (folder src-folder @@ -373,12 +374,13 @@ If optional argument NUMBER is specified, the new message number is set "Append messages from folder. FOLDER is the ELMO folder structure. Caller should make sure FOLDER is `writable'. -(Can be checked with `elmo-folder-writable-p'). +\(Can be checked with `elmo-folder-writable-p'). SRC-FOLDER is the source ELMO folder structure. NUMBERS is the message numbers to be appended in the SRC-FOLDER. UNREAD-MARKS is a list of unread mark string. If second optional argument SAME-NUMBER is specified, -message number is preserved (if possible).") +message number is preserved \(if possible\). +Returns a list of message numbers successfully appended.") (luna-define-generic elmo-folder-pack-numbers (folder) "Pack message numbers of FOLDER.") -- 1.7.10.4