+2004-09-04 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * wl-folder.el (wl-folder-set-flag): Renamed from
+ `wl-draft-set-flag-on-parent'.
+
+ * wl-draft.el (wl-draft-quit-preview): New function.
+ (wl-draft-send-confirm): Call it instead of `mime-preview-quit'.
+ (wl-draft-send): Call `wl-folder-set-flag' instead of
+ `wl-draft-set-flag-on-parent'.
+ (wl-draft-set-flag-on-parent): Renamed to `wl-folder-set-flag'.
+
2004-09-03 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* wl-draft.el (wl-draft-forward): Fixed parenthesis.
:type 'boolean
:group 'wl-draft)
+(defun wl-draft-quit-preview ()
+ "Quitting method for mime-view."
+ (let* ((temp mime-edit-temp-message-buffer)
+ (window (selected-window))
+ buf)
+ (mime-preview-kill-buffer)
+ (set-buffer temp)
+ (setq buf mime-edit-buffer)
+ (kill-buffer temp)
+ (select-window window)
+ (switch-to-buffer buf)))
+
(defun wl-draft-send-confirm ()
(let (answer)
(unwind-protect
(throw 'done nil)))))))
(quit nil))
(when wl-draft-send-confirm-with-preview
- (mime-preview-quit)))))
+ (wl-draft-quit-preview)))))
(defun wl-draft-send (&optional kill-when-done mes-string)
"Send current draft message.
" *wl-draft-sending-buffer*"
(append wl-draft-config-variables
(wl-draft-clone-local-variables))))
+ (parent-flag wl-draft-parent-flag)
+ (parent-number wl-draft-parent-number)
+ (parent-folder wl-draft-parent-folder)
(wl-draft-verbose-msg nil)
err)
(unwind-protect
;;
(if wl-draft-verbose-send
(message "%s" (or mes-string "Sending...")))
+ ;; Set flag before send-function because
+ ;; there's no need to change current mailbox at this time.
+ ;; If flag is set after send-function, the current mailbox
+ ;; might changed by Fcc.
+ ;; It causes a huge loss in the IMAP folder.
+ (when (and parent-flag parent-number parent-folder)
+ (wl-folder-set-flag parent-folder parent-number parent-flag))
(funcall wl-draft-send-function editing-buffer kill-when-done)
;; Now perform actions on successful sending.
(while mail-send-actions
(message "%sdone"
(or wl-draft-verbose-msg
mes-string
- "Sending...")))
- (with-current-buffer sending-buffer
- (when (and wl-draft-parent-flag
- wl-draft-parent-number
- wl-draft-parent-folder
- (wl-draft-set-flag-on-parent wl-draft-parent-flag)))))
+ "Sending..."))))
;; kill sending buffer, anyway.
(and (buffer-live-p sending-buffer)
(kill-buffer sending-buffer))))))
wl-user-agent-headers-and-body-alist 'ignore-case)))))
t))
-(defun wl-draft-set-flag-on-parent (flag)
- "Set FLAG on parent message."
- (let ((buffer (wl-summary-get-buffer wl-draft-parent-folder))
- (number wl-draft-parent-number)
- folder)
- (if buffer
- (with-current-buffer buffer
- (wl-summary-set-persistent-mark flag number))
- ;; Parent buffer does not exist.
- (when (setq folder (and wl-draft-parent-folder
- (wl-folder-get-elmo-folder
- wl-draft-parent-folder)))
- (elmo-folder-open folder 'load-msgdb)
- (elmo-folder-set-flag folder (list wl-draft-parent-number) flag)
- (elmo-folder-close folder)))))
-
(defun wl-draft-setup-parent-flag (flag)
"Setup a FLAG for parent message."
(when (and (> (length wl-draft-parent-folder) 0)
(wl-folder-toggle-disp-summary 'off wl-queue-folder)
(switch-to-buffer cur-buf))))))
+(defun wl-folder-set-flag (folder number flag)
+ "Set FLAG on the message."
+ (let ((buffer (wl-summary-get-buffer folder))
+ elmo-folder)
+ (if buffer
+ (with-current-buffer buffer
+ (wl-summary-set-persistent-mark flag number))
+ ;; Parent buffer does not exist.
+ (when (setq elmo-folder (and folder
+ (wl-folder-get-elmo-folder folder)))
+ (elmo-folder-open elmo-folder 'load-msgdb)
+ (elmo-folder-set-flag elmo-folder (list wl-draft-parent-number) flag)
+ (elmo-folder-close elmo-folder)))))
+
(defun wl-folder-empty-trash ()
"Empty trash."
(interactive)