(mail-position-on-field "To"))
(defun wl-draft-strip-subject-re (subject)
- "Remove \"Re:\" from subject lines. Shamelessly copied from Gnus."
+ "Remove \"Re:\" from SUBJECT string. Shamelessly copied from Gnus."
(if (string-match wl-subject-prefix-regexp subject)
(substring subject (match-end 0))
subject))
+(defun wl-draft-self-reply-p ()
+ "Return t when From address in the current message is user's self one or not."
+ (wl-address-user-mail-address-p (or (elmo-field-body "From") "")))
+
(defun wl-draft-reply-list-symbol (with-arg)
"Return symbol `wl-draft-reply-*-argument-list' match condition.
Check WITH-ARG and From: field."
- (if (wl-address-user-mail-address-p (or (elmo-field-body "From") ""))
+ (if (wl-draft-self-reply-p)
(if with-arg
'wl-draft-reply-myself-with-argument-list
'wl-draft-reply-myself-without-argument-list)
((listp condition)
(catch 'done
(while condition
- (if (not (std11-field-body (car condition)))
- (throw 'done nil))
+ (cond
+ ((stringp (car condition))
+ (or (std11-field-body (car condition))
+ (throw 'done nil)))
+ ((symbolp (car condition))
+ (or (funcall (car condition))
+ (throw 'done nil)))
+ (t
+ (debug)))
(setq condition (cdr condition)))
t))
((symbolp condition)
r-to-list))
",")))
(if (and r-cc-list (symbolp r-cc-list))
- (setq cc (wl-concat-list (funcall r-to-list) ","))
+ (setq cc (wl-concat-list (funcall r-cc-list) ","))
(setq cc (wl-concat-list (cons cc
(elmo-multiple-fields-body-list
r-cc-list))
(insert cite-title "\n"))
(mail-indent-citation)))
-(defvar wl-draft-buffer nil "Draft buffer to yank content")
+(defvar wl-draft-buffer nil "Draft buffer to yank content.")
(defun wl-draft-yank-to-draft-buffer (buffer)
"Yank BUFFER content to `wl-draft-buffer'."
(set-buffer wl-draft-buffer)
(switch-to-buffer sum-buf))))))))
(defun wl-draft-delete (editing-buffer)
- "kill the editing draft buffer and delete the file corresponds to it."
+ "Kill the editing draft buffer and delete the file corresponds to it."
(save-excursion
(when editing-buffer
(set-buffer editing-buffer)
smtp-sasl-user-name
(car smtp-sasl-mechanisms)
smtp-server)))
+ (signal (car err) (cdr err)))
+ (quit
+ (wl-draft-write-sendlog 'uncertain 'smtp smtp-server
+ recipients id)
(signal (car err) (cdr err)))))
(wl-draft-set-sent-message 'mail 'sent)
(wl-draft-write-sendlog
(defun wl-draft-normal-send-func (editing-buffer kill-when-done)
"Send the message in the current buffer."
(save-restriction
- (std11-narrow-to-header mail-header-separator)
+ (narrow-to-region (goto-char (point-min))
+ (if (re-search-forward
+ (concat
+ "^" (regexp-quote mail-header-separator) "$")
+ nil t)
+ (match-beginning 0)
+ (point-max)))
(wl-draft-insert-required-fields)
- ;; Delete null fields.
- (goto-char (point-min))
- (while (re-search-forward "^[^ \t\n:]+:[ \t]*\n" nil t)
- (replace-match ""))
;; ignore any blank lines in the header
- (while (re-search-forward "\n\n\n*" nil t)
- (replace-match "\n")))
+ (while (progn (goto-char (point-min))
+ (re-search-forward "\n[ \t]*\n\n*" nil t))
+ (replace-match "\n"))
+ (goto-char (point-min))
+ (while (re-search-forward
+ "^[^ \t\n:]+:[ \t]*\\(.*\\(\n[ \t].*\\)*\\)\n"
+ nil t)
+ (when (string= "" (match-string 1))
+ (replace-match ""))))
;;; (run-hooks 'wl-mail-send-pre-hook) ;; X-PGP-Sig, Cancel-Lock
(wl-draft-dispatch-message)
(when kill-when-done
"Send the message in the current buffer. Not modified the header fields."
(let (delimline mime-bcc)
(if (and wl-draft-verbose-send mes-string)
- (message mes-string))
+ (message "%s" mes-string))
;; get fcc folders.
(setq delimline (wl-draft-get-header-delimiter t))
(unless wl-draft-fcc-list
(setq wl-draft-verbose-msg
(format "Sending%s and Queuing%s..."
sent-via unplugged-via))
- (message (concat wl-draft-verbose-msg "done")))
+ (message "%sdone" wl-draft-verbose-msg))
(if mes-string
- (message (concat mes-string
- (if sent-via "done" "failed")))))))))
+ (message "%s%s"
+ mes-string
+ (if sent-via "done" "failed"))))))))
(not wl-sent-message-modified)) ;; return value
(defun wl-draft-raw-send (&optional kill-when-done force-pre-hook mes-string)
(wl-draft-verbose-msg nil)
err)
(unwind-protect
- (save-excursion (set-buffer sending-buffer)
+ (save-excursion
+ (set-buffer sending-buffer)
(if (and (not (wl-message-mail-p))
(not (wl-message-news-p)))
(error "No recipient is specified"))
- (expand-abbrev) ; for mail-abbrevs
+ (expand-abbrev) ; for mail-abbrevs
(let ((mime-header-encode-method-alist
(append
'((wl-draft-eword-encode-address-list
- . (To Cc Bcc Resent-To Resent-Cc Bcc Resent-Bcc)))
+ . (To Cc Bcc Resent-To Resent-Cc Resent-Bcc From)))
(if (boundp 'mime-header-encode-method-alist)
(symbol-value 'mime-header-encode-method-alist)))))
(run-hooks 'mail-send-hook) ; translate buffer
)
;;
(if wl-draft-verbose-send
- (message (or mes-string "Sending...")))
+ (message "%s" (or mes-string "Sending...")))
(funcall wl-draft-send-function editing-buffer kill-when-done)
;; Now perform actions on successful sending.
(while mail-send-actions
(error))
(setq mail-send-actions (cdr mail-send-actions)))
(if wl-draft-verbose-send
- (message (concat (or wl-draft-verbose-msg
- mes-string "Sending...")
- "done"))))
+ (message "%sdone"
+ (or wl-draft-verbose-msg
+ mes-string
+ "Sending..."))))
;; kill sending buffer, anyway.
(and (buffer-live-p sending-buffer)
(kill-buffer sending-buffer))))))
(defun wl-draft-mime-bcc-field ()
- "Return the MIME-Bcc field body. The field is deleted."
+ "Return the MIME-Bcc field body. The field is deleted."
(prog1 (std11-field-body wl-draft-mime-bcc-field-name)
(wl-draft-delete-field wl-draft-mime-bcc-field-name)))
;; insert symbol-value: string
(symbol . nil) ;; do nothing
nil ;; do nothing
- )
-"
+ )"
(unless (eq major-mode 'wl-draft-mode)
- (error "wl-draft-create-header must be use in wl-draft-mode."))
+ (error "`wl-draft-create-header' must be use in wl-draft-mode"))
(let ((halist header-alist)
field value)
(while halist
(defun wl-draft-prepare-edit ()
(unless (eq major-mode 'wl-draft-mode)
- (error "wl-draft-create-header must be use in wl-draft-mode."))
+ (error "`wl-draft-create-header' must be use in wl-draft-mode"))
(let (change-major-mode-hook)
(wl-draft-editor-mode)
(add-hook 'local-write-file-hooks 'wl-draft-save)
(cdar condition))
(setq condition (cdr condition)))))
(unless elmo-nntp-default-function
- (error "wl-draft-nntp-send: posting-function is nil."))
+ (error "wl-draft-nntp-send: posting-function is nil"))
(if (not (elmo-plugged-p elmo-nntp-default-server elmo-nntp-default-port))
(wl-draft-set-sent-message 'news 'unplugged
(cons elmo-nntp-default-server
(put-text-property (point-min) (point-max) 'face nil)
(wl-highlight-message (point-min) (point-max) t))
(set-buffer-modified-p modified))))
+ (static-when (featurep 'xemacs)
+ ;; Cope with one of many XEmacs bugs that `recenter' takes
+ ;; a long time if there are a lot of invisible text lines.
+ (redraw-frame))
(recenter n))
;;;; user-agent support by Sen Nagata