Add optional fourth argument, return number of appended message if possible
authordmaus <dmaus>
Sun, 29 May 2011 12:34:48 +0000 (12:34 +0000)
committerdmaus <dmaus>
Sun, 29 May 2011 12:34:48 +0000 (12:34 +0000)
* 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.
* elmo-maildir.el (elmo-folder-append-buffer): Dto.
* elmo-flag.el (elmo-folder-append-buffer): Dto.
* elmo-localdir.el (elmo-folder-append-buffer): Dto.
* elmo-filter.el (elmo-folder-append-buffer): Dto.
* elmo-cache.el (elmo-folder-append-buffer): Dto.
* elmo-archive.el (elmo-folder-append-buffer)
(elmo-archive-folder-append-buffer): Dto.

elmo/ChangeLog
elmo/elmo-archive.el
elmo/elmo-cache.el
elmo/elmo-filter.el
elmo/elmo-flag.el
elmo/elmo-imap4.el
elmo/elmo-localdir.el
elmo/elmo-maildir.el
elmo/elmo-pipe.el
elmo/elmo.el

index e0456a5..d746c4f 100644 (file)
@@ -1,3 +1,16 @@
+2011-05-29  David Maus  <dmaus@ictsoc.de>
+
+       * 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.
+       * elmo-maildir.el (elmo-folder-append-buffer): Dto.
+       * elmo-flag.el (elmo-folder-append-buffer): Dto.
+       * elmo-localdir.el (elmo-folder-append-buffer): Dto.
+       * elmo-filter.el (elmo-folder-append-buffer): Dto.
+       * elmo-cache.el (elmo-folder-append-buffer): Dto.
+       * elmo-archive.el (elmo-folder-append-buffer)
+       (elmo-archive-folder-append-buffer): Dto.
+
 2010-08-31  David Maus  <dmaus@ictsoc.de>
 
        * elmo-imap4.el (elmo-folder-delete-messages-plugged): Use smarter
index 274bde1..fb71e1a 100644 (file)
@@ -573,11 +573,12 @@ TYPE specifies the archiver's symbol."
   (elmo-archive-message-fetch-internal folder number))
 
 (luna-define-method elmo-folder-append-buffer ((folder elmo-archive-folder)
-                                              &optional flags number)
-  (elmo-archive-folder-append-buffer folder flags number))
+                                              &optional flags number
+                                              return-number)
+  (elmo-archive-folder-append-buffer folder flags number return-number))
 
 ;; verrrrrry slow!!
-(defun elmo-archive-folder-append-buffer (folder flags number)
+(defun elmo-archive-folder-append-buffer (folder flags number return-number)
   (let* ((type (elmo-archive-folder-archive-type-internal folder))
         (prefix (elmo-archive-folder-archive-prefix-internal folder))
         (arc (elmo-archive-get-archive-name folder))
index 37f506c..bd2df5f 100644 (file)
     new-msgdb))
 
 (luna-define-method elmo-folder-append-buffer ((folder elmo-cache-folder)
-                                              &optional flags number)
+                                              &optional flags number
+                                              return-number)
   ;; dir-name is changed according to msgid.
   (unless (elmo-cache-folder-dir-name-internal folder)
     (let ((msgid (std11-field-body "message-id"))
index 65aacfa..11b736d 100644 (file)
    type))
 
 (luna-define-method elmo-folder-append-buffer ((folder elmo-filter-folder)
-                                              &optional flag number)
+                                              &optional flag number
+                                              return-number)
   (elmo-folder-append-buffer
    (elmo-filter-folder-target-internal folder)
-   flag number))
+   flag number return-number))
 
 (defun elmo-folder-append-messages-filter-* (dst-folder
                                             src-folder
index 7765a8a..6c3dc7b 100644 (file)
   numbers)
 
 (luna-define-method elmo-folder-append-buffer ((folder elmo-flag-folder)
-                                              &optional flag number)
+                                              &optional flag number
+                                              return-number)
   (error "Cannot append to the flag folder"))
 
 (luna-define-method elmo-folder-unset-flag :before ((folder elmo-flag-folder)
index 20b2fa2..9feda9e 100644 (file)
@@ -2715,7 +2715,7 @@ If optional argument REMOVE is non-nil, remove FLAG."
     imap-flag))
 
 (luna-define-method elmo-folder-append-buffer
-  ((folder elmo-imap4-folder) &optional flags number)
+  ((folder elmo-imap4-folder) &optional flags number return-number)
   (if (elmo-folder-plugged-p folder)
       (let ((session (elmo-imap4-get-session folder))
            send-buffer result)
index 78a30f1..5285659 100644 (file)
       (sort flist '<))))
 
 (luna-define-method elmo-folder-append-buffer ((folder elmo-localdir-folder)
-                                              &optional flags number)
+                                              &optional flags number
+                                              return-number)
   (let ((filename (elmo-message-file-name
                   folder
                   (or number
index 2c29937..c185b5f 100644 (file)
@@ -430,7 +430,8 @@ file name for maildir directories."
       (rename-file src dst)))
 
 (luna-define-method elmo-folder-append-buffer ((folder elmo-maildir-folder)
-                                              &optional flags number)
+                                              &optional flags number
+                                              return-number)
   (let ((basedir (elmo-maildir-folder-directory-internal folder))
        (src-buf (current-buffer))
        dst-buf filename)
index 68bb479..2ae9626 100644 (file)
                               same-number))
 
 (luna-define-method elmo-folder-append-buffer ((folder elmo-pipe-folder)
-                                              &optional flag number)
+                                              &optional flag number
+                                              return-number)
   (elmo-folder-append-buffer (elmo-pipe-folder-dst-internal folder)
-                            flag number))
+                            flag number return-number))
 
 (luna-define-method elmo-message-fetch ((folder elmo-pipe-folder)
                                        number strategy
index c3c0bd7..1a92c4d 100644 (file)
@@ -427,7 +427,7 @@ If optional IS-LOCAL is non-nil, update only local (not server) status.")
 FOLDER is the ELMO folder structure.")
 
 (luna-define-generic elmo-folder-append-buffer (folder &optional flags
-                                                      number)
+                                                      number return-number)
   "Append current buffer as a new message.
 FOLDER is the destination folder (ELMO folder structure).
 FLAGS is the flag list for the appended message (list of symbols).
@@ -435,6 +435,9 @@ If FLAGS contain `read', the message is appended as `not-unread'.
 If it is nil, the appended message will be treated as `new'.
 If optional argument NUMBER is specified, the new message number is set
 \(if possible\).
+If optional argument RETURN-NUMBER is non-nil, return the number
+of the appended message if possible. If the number could not be
+obtained return t.
 Return nil on failure.")
 
 (luna-define-generic elmo-folder-pack-numbers (folder)