* wl-summary.el (wl-summary-reedit): Don't enclose wl-draft-reedit
authorteranisi <teranisi>
Thu, 24 Jan 2002 08:45:37 +0000 (08:45 +0000)
committerteranisi <teranisi>
Thu, 24 Jan 2002 08:45:37 +0000 (08:45 +0000)
with unwind-protect.

* wl-draft.el (wl-draft-save): Insert header separator if it does not exist;
Removed condition-case.

wl/ChangeLog
wl/wl-draft.el
wl/wl-summary.el

index 0ae0e31..a686a69 100644 (file)
@@ -1,7 +1,12 @@
 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.
 
index 2447e07..7852e1e 100644 (file)
@@ -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
index bc73637..74093f9 100644 (file)
@@ -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 ()