* wl-draft.el (wl-draft-normal-send-func): Fixed bug for removing empty lines.
authorteranisi <teranisi>
Tue, 15 Jul 2003 16:06:41 +0000 (16:06 +0000)
committerteranisi <teranisi>
Tue, 15 Jul 2003 16:06:41 +0000 (16:06 +0000)
wl/ChangeLog
wl/wl-draft.el

index 0bde812..be92688 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-15  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-draft.el (wl-draft-normal-send-func): Fixed bug for removing
+       empty lines.
+
 2003-07-12  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
        * wl-vars.el (wl-thread-indent-level, wl-thread-*-str): Choose
index c773a86..7f11643 100644 (file)
@@ -1132,15 +1132,23 @@ If FORCE-MSGID, insert message-id regardless of `wl-insert-message-id'."
 (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)
-    (wl-draft-insert-required-fields)
-    ;; Delete null fields.
-    (goto-char (point-min))
-    (while (re-search-forward "^[^ \t\n:]+:[ \t]*\n" nil t)
-      (replace-match ""))
+    (narrow-to-region (goto-char (point-min))
+                     (if (re-search-forward
+                          (concat
+                           "^" (regexp-quote mail-header-separator) "$")
+                          nil t)
+                         (match-beginning 0)
+                       (point-max)))
     ;; 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