Obtain number of appended draft message by `elmo-folder-append-buffer'
authordmaus <dmaus>
Sun, 5 Jun 2011 09:06:10 +0000 (09:06 +0000)
committerdmaus <dmaus>
Sun, 5 Jun 2011 09:06:10 +0000 (09:06 +0000)
* wl-draft.el (wl-draft-save): Obtain number of appended draft message
by `elmo-folder-append-buffer', handle case UID of appended message
could not be found.

wl/ChangeLog
wl/wl-draft.el

index d9703a4..531fa16 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-05  David Maus  <dmaus@ictsoc.de>
+
+       * wl-draft.el (wl-draft-save): Obtain number of appended draft
+       message by `elmo-folder-append-buffer', handle case UID of
+       appended message could not be found.
+
 2010-08-31  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * wl-summary.el: Delete trailing whitespace.
index 28b73b2..08995f7 100644 (file)
@@ -1439,15 +1439,16 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
              (mime-edit-translate-buffer))
            (wl-draft-get-header-delimiter t)
            (setq next-number
-                 (elmo-folder-next-message-number (wl-draft-get-folder)))
-           (elmo-folder-append-buffer (wl-draft-get-folder)))
+                 (elmo-folder-append-buffer (wl-draft-get-folder) nil nil t)))
          (elmo-folder-check (wl-draft-get-folder))
          (elmo-folder-commit (wl-draft-get-folder))
-         (setq wl-draft-buffer-message-number next-number)
-         (rename-buffer (format "%s/%d" wl-draft-folder next-number) t)
+         (if (not (numberp next-number))
+             (setq wl-draft-buffer-message-number nil)
+           (setq wl-draft-buffer-message-number next-number)
+           (rename-buffer (format "%s/%d" wl-draft-folder next-number) t)
+           (wl-draft-config-info-operation wl-draft-buffer-message-number 'save))
          (setq buffer-file-name (buffer-name))
          (set-buffer-modified-p nil)
-         (wl-draft-config-info-operation wl-draft-buffer-message-number 'save)
          (message "Saving...done")))
     (message "(No changes need to be saved)")))