(defun wl-draft-insert-x-face-field ()
"Insert X-Face header."
(interactive)
- (if (not (file-exists-p wl-x-face-file))
- (error "File %s does not exist" wl-x-face-file)
- (beginning-of-buffer)
- (search-forward mail-header-separator nil t)
- (beginning-of-line)
- (wl-draft-insert-x-face-field-here)
- (run-hooks 'wl-draft-insert-x-face-field-hook))) ; highlight it if you want.
+ (unless (file-exists-p wl-x-face-file)
+ (error "File %s does not exist" wl-x-face-file))
+ (beginning-of-buffer)
+ (search-forward mail-header-separator nil t)
+ (beginning-of-line)
+ (wl-draft-insert-x-face-field-here)
+ (run-hooks 'wl-draft-insert-x-face-field-hook)) ; highlight it if you want.
(defun wl-draft-insert-x-face-field-here ()
"Insert X-Face field at point."
(defun wl-draft-confirm ()
"Confirm send message."
(interactive)
- (y-or-n-p (format "Send current draft as %s? "
- (cond ((and (wl-message-mail-p) (wl-message-news-p))
- "Mail and News")
- ((wl-message-mail-p) "Mail")
- ((wl-message-news-p) "News")))))
-
-(defun wl-message-news-p ()
- "If exist valid Newsgroups field, return non-nil."
- (std11-field-body "Newsgroups"))
+ (y-or-n-p
+ (cond ((and (wl-message-mail-p) (wl-message-news-p))
+ "Send current draft as Mail and News? ")
+ ((wl-message-mail-p) "Send current draft as Mail? ")
+ ((wl-message-news-p) "Send current draft as News? "))))
(defun wl-message-field-exists-p (field)
"If FIELD exist and FIELD value is not empty, return non-nil."
(and value
(not (string= value "")))))
+(defun wl-message-news-p ()
+ "If exist valid Newsgroups field, return non-nil."
+ (std11-field-body "Newsgroups"))
+
(defun wl-message-mail-p ()
"If exist To, Cc or Bcc field, return non-nil."
(or (wl-message-field-exists-p "To")
(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)
(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
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)))
(let ((msg (and wl-draft-buffer-file-name
(string-match "[0-9]+$" wl-draft-buffer-file-name)
(string-to-int
- (elmo-match-string 0 wl-draft-buffer-file-name)))))
+ (match-string 0 wl-draft-buffer-file-name)))))
(wl-draft-config-info-operation msg 'delete))))
(set-buffer-modified-p nil) ; force kill
(kill-buffer editing-buffer))))
(if (and sent-via wl-draft-fcc-list)
(progn
(wl-draft-do-fcc (wl-draft-get-header-delimiter) wl-draft-fcc-list)
- (setq wl-draft-fcc-list nil))
- (if wl-draft-use-cache
- (let ((id (std11-field-body "Message-ID"))
- (elmo-enable-disconnected-operation t))
- (elmo-cache-save id nil nil nil))))
+ (setq wl-draft-fcc-list nil)))
+ (if wl-draft-use-cache
+ (let ((id (std11-field-body "Message-ID"))
+ (elmo-enable-disconnected-operation t))
+ (elmo-cache-save id nil nil nil)))
;; If one unplugged, append queue.
(when (and unplugged-via
wl-sent-message-modified)
(wl-draft-config-info-operation
(and (string-match "[0-9]+$" wl-draft-buffer-file-name)
(string-to-int
- (elmo-match-string 0 wl-draft-buffer-file-name)))
+ (match-string 0 wl-draft-buffer-file-name)))
'save))
(defun wl-draft-mimic-kill-buffer ()
nil
(if (re-search-forward ":" pos t) nil t)))))))
-(defun wl-draft-random-alphabet ()
- (let ((alphabet '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z)))
- (nth (abs (% (random) 26)) alphabet)))
-
;;;###autoload
(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)
(if (or (eq wl-draft-reply-buffer-style 'full)
(eq this-command 'wl-draft)
(eq this-command 'wl-summary-write)
- (eq this-command 'wl-summary-write-current-newsgroup))
+ (eq this-command 'wl-summary-write-current-folder))
(delete-other-windows))
(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)