From af6559a8072829ccd1887e6e9c4033a05eec5a26 Mon Sep 17 00:00:00 2001 From: dmaus Date: Sun, 29 May 2011 12:57:01 +0000 Subject: [PATCH] Return number of appended message, implemented all except IMAP * elmo-maildir.el (elmo-folder-append-buffer): Return number of appended message. * elmo-localdir.el (elmo-folder-append-buffer): Dto. * elmo-archive.el (elmo-archive-folder-append-buffer): Dto. --- elmo/ChangeLog | 5 +++++ elmo/elmo-archive.el | 4 +++- elmo/elmo-localdir.el | 4 +++- elmo/elmo-maildir.el | 4 +++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index d746c4f..597f7ec 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,10 @@ 2011-05-29 David Maus + * elmo-maildir.el (elmo-folder-append-buffer): Return number of + appended message. + * elmo-localdir.el (elmo-folder-append-buffer): Dto. + * elmo-archive.el (elmo-archive-folder-append-buffer): Dto. + * elmo.el (elmo-folder-append-buffer): Add optional fourth argument, return number of appended message if possible. * elmo-pipe.el (elmo-folder-append-buffer): Dto. diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index fb71e1a..5c00d43 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -616,7 +616,9 @@ TYPE specifies the archiver's symbol." (with-current-buffer src-buffer (elmo-msgdb-get-message-id-from-buffer)) flags) - t)) + (if return-number + next-num + t))) nil))))) (defun elmo-folder-append-messages-*-archive (folder diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 5285659..3d2ad25 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -203,7 +203,9 @@ (point-min) (point-max) filename nil 'no-msg) (elmo-folder-preserve-flags folder (elmo-msgdb-get-message-id-from-buffer) flags) - t))) + (if return-number + (car (elmo-folder-status folder)) + t)))) (defun elmo-folder-append-messages-*-localdir (folder src-folder diff --git a/elmo/elmo-maildir.el b/elmo/elmo-maildir.el index c185b5f..1a10de5 100644 --- a/elmo/elmo-maildir.el +++ b/elmo/elmo-maildir.el @@ -450,7 +450,9 @@ file name for maildir directories." basedir)) (elmo-folder-preserve-flags folder (elmo-msgdb-get-message-id-from-buffer) flags) - t) + (if return-number + (car (elmo-folder-status folder)) + t)) ;; If an error occured, return nil. (error)))) -- 1.7.10.4