From: teranisi Date: Thu, 24 Jan 2002 08:45:37 +0000 (+0000) Subject: * wl-summary.el (wl-summary-reedit): Don't enclose wl-draft-reedit X-Git-Tag: wl-2_9_7~39 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f3d9904c7ca0f96e7ba0bcae3771145428e19008;p=elisp%2Fwanderlust.git * wl-summary.el (wl-summary-reedit): Don't enclose wl-draft-reedit with unwind-protect. * wl-draft.el (wl-draft-save): Insert header separator if it does not exist; Removed condition-case. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 0ae0e31..a686a69 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,7 +1,12 @@ 2002-01-24 Yuuichi Teranishi + * 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. diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 2447e07..7852e1e 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1224,10 +1224,19 @@ Derived from `message-save-drafts' in T-gnus." (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 diff --git a/wl/wl-summary.el b/wl/wl-summary.el index bc73637..74093f9 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -595,12 +595,12 @@ If ARG is non-nil, Supersedes message" (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 ()