+2004-09-03 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * wl-vars.el (wl-draft-reply-hook): Changed default value.
+ (wl-draft-kill-pre-hook): Set default value as nil.
+ (wl-summary-reply-hook): Ditto.
+ (wl-draft-kill-flags): Abolish.
+
+ * wl-draft.el (wl-draft-parent-flag): New buffer local variable.
+ (wl-draft-parent-variables): Renamed from
+ wl-draft-reply-saved-variables and added wl-draft-parent-flag.
+ (wl-draft-forward): Call wl-draft-config-info-operation with 'save
+ argument; Add wl-draft-parent-variables to
+ wl-draft-config-variables.
+ (wl-draft-reply): Likewise.
+ (wl-draft-kill-flags): Abolish.
+ (wl-draft-send): Call wl-draft-set-flag-on-parent.
+ (wl-draft-set-flag-on-parent): New function.
+ (wl-draft-setup-parent-flag): Ditto.
+
2004-09-02 Tetsurou Okazaki <okazaki@be.to>
* wl-draft.el (wl-draft-kill-flags): Avoid error when
(\"From\" . \"user@domain2\"))))")
(defvar wl-draft-parent-number nil)
+(defvar wl-draft-parent-flag nil)
-(defconst wl-draft-reply-saved-variables
+(defconst wl-draft-parent-variables
'(wl-draft-parent-folder
- wl-draft-parent-number))
+ wl-draft-parent-number
+ wl-draft-parent-flag))
(defvar wl-draft-config-sub-func-alist
'((body . wl-draft-config-sub-body)
(make-variable-buffer-local 'wl-draft-reply-buffer)
(make-variable-buffer-local 'wl-draft-parent-folder)
(make-variable-buffer-local 'wl-draft-parent-number)
+(make-variable-buffer-local 'wl-draft-parent-flag)
(defvar wl-draft-folder-internal nil
"Internal variable for caching `opened' draft folder.")
(cons 'References references))
nil nil nil nil parent-folder))
(setq wl-draft-parent-number number)
+ (wl-draft-config-info-operation wl-draft-buffer-message-number 'save)
(goto-char (point-max))
(wl-draft-insert-message)
(mail-position-on-field "To")
+ (setq wl-draft-config-variables
+ (append wl-draft-parent-variables
+ wl-draft-config-variables)))
(run-hooks 'wl-draft-forward-hook))
(defun wl-draft-self-reply-p ()
(cons 'Mail-Followup-To mail-followup-to))
nil nil nil nil parent-folder)
(setq wl-draft-parent-number number)
+ (wl-draft-config-info-operation wl-draft-buffer-message-number 'save)
(setq wl-draft-reply-buffer buf)
(setq wl-draft-config-variables
- (append wl-draft-reply-saved-variables
+ (append wl-draft-parent-variables
wl-draft-config-variables)))
(run-hooks 'wl-draft-reply-hook))
(set-buffer-modified-p nil) ; force kill
(kill-buffer editing-buffer))))
-(defun wl-draft-kill-flags ()
- "Remove flags on parent message when current draft is killed."
- (let ((buffer (wl-summary-get-buffer wl-draft-parent-folder))
- (number wl-draft-parent-number)
- folder)
- (if buffer
- (with-current-buffer buffer
- (dolist (flag wl-draft-kill-flags)
- (wl-summary-unset-persistent-mark flag number)))
- ;; Parent buffer does not exist.
- (when (setq folder (and wl-draft-parent-folder
- (string< "" wl-draft-parent-folder)
- (wl-folder-get-elmo-folder
- wl-draft-parent-folder)))
- (elmo-folder-open folder 'load-msgdb)
- (dolist (flag wl-draft-kill-flags)
- (elmo-folder-unset-flag folder (list wl-draft-parent-number) flag))
- (elmo-folder-close folder)))))
-
(defun wl-draft-kill (&optional force-kill)
"Kill current draft buffer and quit editing."
(interactive "P")
(message "%sdone"
(or wl-draft-verbose-msg
mes-string
- "Sending..."))))
+ "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))))
;; 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-draft-parent-number)
+ (setq wl-draft-parent-flag flag)
+ (wl-draft-config-info-operation wl-draft-buffer-message-number 'save)))
+
(require 'product)
(product-provide (provide 'wl-draft) (require 'wl-version))
(defvar wl-hook nil
"A hook called when Wanderlust is invoked.")
-(defvar wl-draft-reply-hook nil
+(defvar wl-draft-reply-hook
+ '((lambda () (wl-draft-setup-parent-flag 'answered)))
"A hook called when replied.
This hook runs on the draft buffer.")
"A hook called when forwarded.
This hook runs on the draft buffer.")
-(defvar wl-draft-kill-pre-hook '(wl-draft-kill-flags)
+(defvar wl-draft-kill-pre-hook nil
"A hook called just before the draft buffer is killed.")
-(defvar wl-summary-reply-hook
- '((lambda () (wl-summary-set-persistent-mark 'answered)))
+(defvar wl-summary-reply-hook nil
"A hook called when `wl-summary-reply' is called.
This hook runs on the summary buffer.")
:group 'wl-pref
:group 'wl-draft)
-(defcustom wl-draft-kill-flags '(answered)
- "Remove specified flags on parent message when current draft is killed."
- :type '(repeat (symbol :tag "flag"))
- :group 'wl-draft)
-
(defcustom wl-subject-re-prefix-regexp "^[ \t]*\\([Rr][Ee][:>][ \t]*\\)*[ \t]*"
"*Regexp matching \"Re: \" in the subject line."
:type 'regexp