From 7ad922b2b5844ab41f056fce8d4af50a56fdc69b Mon Sep 17 00:00:00 2001 From: keiichi Date: Thu, 21 Jan 1999 10:09:51 +0000 Subject: [PATCH] (mime-edit-line-break-type): New variable. (mime-edit-normalize-body): Canonicalize line break code in the text part with `encode-mime-charset-region'. --- mime-edit.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/mime-edit.el b/mime-edit.el index 89b4655..01f9bfa 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -175,6 +175,12 @@ To insert a signature file automatically, call the function :group 'mime-edit :type 'hook) +(defcustom mime-edit-line-break-type 'LF + "*Line break code type of encoded message. `LF' is default." + :group 'mime-edit + :type '(choice (const LF) + (const :tag "CR + LF" CRLF))) + (defcustom mime-edit-exit-hook nil "*Hook called when exit MIME mode." :group 'mime-edit @@ -2111,8 +2117,12 @@ Content-Transfer-Encoding: 7bit (mime-encoding-name bits) conv))) (beg (mime-edit-content-beginning))) - (encode-mime-charset-region beg (mime-edit-content-end) - charset) + (encode-mime-charset-region + beg (mime-edit-content-end) + charset + (if (member encoding '(nil "7bit" "8bit" "quoted-printable")) + mime-edit-line-break-type + 'CRLF)) ;; Protect "From " in beginning of line (save-restriction (narrow-to-region beg (mime-edit-content-end)) @@ -2130,13 +2140,6 @@ Content-Transfer-Encoding: 7bit )) (setq encoding "quoted-printable") ))))) - ;; canonicalize line break code - (or (member encoding '(nil "7bit" "8bit" "quoted-printable")) - (save-restriction - (narrow-to-region beg (mime-edit-content-end)) - (goto-char beg) - (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t) - (replace-match "\\1\r\n")))) (goto-char beg) (mime-encode-region beg (mime-edit-content-end) (or encoding "7bit")) -- 1.7.10.4