From: morioka Date: Mon, 10 Aug 1998 18:06:33 +0000 (+0000) Subject: (decode-mime-charset-region): Add new argument `lbt'. X-Git-Tag: apel-8_16~38 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc581e91cbabbebf5827068f3851678a05e4207f;p=elisp%2Fapel.git (decode-mime-charset-region): Add new argument `lbt'. (decode-mime-charset-string): Likewise. --- diff --git a/emu-latin1.el b/emu-latin1.el index e47ff64..5c0d151 100644 --- a/emu-latin1.el +++ b/emu-latin1.el @@ -216,17 +216,31 @@ find-file-hooks, etc. "Encode the text between START and END as MIME CHARSET." ) -(defun decode-mime-charset-region (start end charset) +(defun decode-mime-charset-region (start end charset &optional lbt) "Decode the text between START and END as MIME CHARSET." + (cond ((eq lbt 'CRLF) + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (while (search-forward "\r\n" nil t) + (replace-match "\n")) + )))) ) (defun encode-mime-charset-string (string charset) "Encode the STRING as MIME CHARSET." string) -(defun decode-mime-charset-string (string charset) +(defun decode-mime-charset-string (string charset &optional lbt) "Decode the STRING as MIME CHARSET." - string) + (if lbt + (with-temp-buffer + (insert string) + (decode-mime-charset-region (point-min)(point-max) charset lbt) + (buffer-string) + ) + string)) (defalias 'write-region-as-mime-charset 'write-region)