2002-01-24 Yuuichi Teranishi <teranisi@gohome.org>
+ * wl-summary.el (wl-summary-reedit): Don't enclose wl-draft-reedit
+ with unwind-protect.
+
* wl-draft.el (wl-draft-reedit): Rewrite.
(wl-jump-to-draft-buffer): Don't use `buffer-file-name'.
+ (wl-draft-save): Insert header separator if it does not exist;
+ Removed condition-case.
* wl-summary.el (wl-summary-reedit): Revert last change.
(let ((msg (buffer-substring-no-properties (point-min) (point-max))))
(with-temp-file wl-draft-buffer-file-name
(insert msg)
- ;; XXX Discard error to ignore invalid content. Is it dangerous?
- (condition-case nil
- (mime-edit-translate-buffer)
- (error))
+ ;; If no header separator, insert it.
+ (save-excursion
+ (goto-char (point-min))
+ (unless (re-search-forward
+ (concat "^" (regexp-quote mail-header-separator) "$")
+ nil t)
+ (goto-char (point-min))
+ (if (re-search-forward "\n\n" nil t)
+ (replace-match (concat "\n" mail-header-separator "\n"))
+ (goto-char (point-max))
+ (insert (if (eq (char-before) ?\n) "" "\n")
+ mail-header-separator "\n"))))
+ (mime-edit-translate-buffer)
(wl-draft-get-header-delimiter t)))
(set-buffer-modified-p nil)
(wl-draft-config-info-operation
(wl-summary-supersedes-message)
(if (string= (wl-summary-buffer-folder-name) wl-draft-folder)
(if (wl-summary-message-number)
- (unwind-protect
- (wl-draft-reedit (wl-summary-message-number))
+ (progn
+ (wl-draft-reedit (wl-summary-message-number))
(if (wl-message-news-p)
(mail-position-on-field "Newsgroups")
(mail-position-on-field "To"))
- (delete-other-windows)))
+ (delete-other-windows)))
(wl-draft-edit-string (wl-summary-message-string)))))
(defun wl-summary-resend-bounced-mail ()