* wl-draft.el (wl-draft-edit-string): Fetch From: field value and
authorteranisi <teranisi>
Wed, 13 Jun 2001 08:42:04 +0000 (08:42 +0000)
committerteranisi <teranisi>
Wed, 13 Jun 2001 08:42:04 +0000 (08:42 +0000)
Call wl-draft with `from' argument if its address is included in
`wl-user-mail-address-list'.
(wl-draft): Added `from' argument.

wl/ChangeLog
wl/wl-draft.el

index 622cc92..cabd3ee 100644 (file)
@@ -1,5 +1,10 @@
 2001-06-13  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * wl-draft.el (wl-draft-edit-string): Fetch From: field value and
+       Call wl-draft with `from' argument if its address is included in
+       `wl-user-mail-address-list'.
+       (wl-draft): Added `from' argument.
+
        * wl.el (wl-exit): Delete current frame if wl-folder-use-frame is
        non-nil.
 
index 5ae1f9c..e7d7787 100644 (file)
@@ -491,9 +491,8 @@ Reply to author if WITH-ARG is non-nil."
   (let ((cur-buf (current-buffer))
        (tmp-buf (get-buffer-create " *wl-draft-edit-string*"))
        to subject in-reply-to cc references newsgroups mail-followup-to
-       content-type content-transfer-encoding
-       body-beg buffer-read-only
-       )
+       content-type content-transfer-encoding from
+       body-beg buffer-read-only)
     (set-buffer tmp-buf)
     (erase-buffer)
     (insert string)
@@ -509,6 +508,12 @@ Reply to author if WITH-ARG is non-nil."
                        (decode-mime-charset-string
                         subject
                         wl-mime-charset))))
+    (setq from (std11-field-body "From")
+         from (and from
+                   (eword-decode-string
+                    (decode-mime-charset-string
+                     from
+                     wl-mime-charset))))    
     (setq in-reply-to (std11-field-body "In-Reply-To"))
     (setq cc (std11-field-body "Cc"))
     (setq cc (and cc
@@ -530,8 +535,10 @@ Reply to author if WITH-ARG is non-nil."
                   mail-followup-to
                   content-type content-transfer-encoding
                   (buffer-substring (point) (point-max))
-                  'edit-again
-                  ))
+                  'edit-again nil
+                  (if (member (nth 1 (std11-extract-address-components from))
+                              wl-user-mail-address-list)
+                      from)))
       (and to (mail-position-on-field "To"))
       (delete-other-windows)
       (kill-buffer tmp-buf)))
@@ -1274,7 +1281,7 @@ If optional argument is non-nil, current draft buffer is killed"
 (defun wl-draft (&optional to subject in-reply-to cc references newsgroups
                           mail-followup-to
                           content-type content-transfer-encoding
-                          body edit-again summary-buf)
+                          body edit-again summary-buf from)
   "Write and send mail/news message with Wanderlust."
   (interactive)
   (unless (featurep 'wl)
@@ -1312,8 +1319,8 @@ If optional argument is non-nil, current draft buffer is killed"
     (auto-save-mode -1)
     (wl-draft-mode)
     (setq wl-sent-message-via nil)
-    (if (stringp wl-from)
-       (insert "From: " wl-from "\n"))
+    (if (stringp (or from wl-from))
+       (insert "From: " (or from wl-from) "\n"))
     (and (or (interactive-p)
             (eq this-command 'wl-summary-write)
             to)