From 3e637190b7d16aef88d1481d983b2cc2bb836063 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 15 Jul 2003 16:06:41 +0000 Subject: [PATCH] * wl-draft.el (wl-draft-normal-send-func): Fixed bug for removing empty lines. --- wl/ChangeLog | 5 +++++ wl/wl-draft.el | 24 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 0bde812..be92688 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2003-07-15 Yuuichi Teranishi + + * wl-draft.el (wl-draft-normal-send-func): Fixed bug for removing + empty lines. + 2003-07-12 Yoichi NAKAYAMA * wl-vars.el (wl-thread-indent-level, wl-thread-*-str): Choose diff --git a/wl/wl-draft.el b/wl/wl-draft.el index c773a86..7f11643 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -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 -- 1.7.10.4