+2004-07-15 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * elmo-archive.el (elmo-archive-folder-append-buffer): Return nil
+ on failure.
+
+2004-07-12 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * 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 <yoichi@geiin.org>
+
+ * 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 <ultrasoul@ultrasoul.com>
* elmo-imap4.el (elmo-imap4-folder-diff-plugged):
(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
(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)
(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)))))
&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)
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)))
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)))
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
"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.")