+1999-01-21 Keiichi Suzuki <kei-suzu@mail.wbs.ne.jp>
+
+ * mcs-xm.el (encode-mime-charset-region): Add new optional
+ argument `lbt'.
+ (encode-mime-charset-string): Ditto.
+
+ * mcs-nemacs.el (lbt-to-string): New inline function.
+ (encode-mime-charset-region): Add new optional argument `lbt'.
+ (encode-mime-charset-string): Ditto.
+
+ * mcs-ltn1.el (lbt-to-string): New inline function.
+ (encode-mime-charset-region): Add new optional argument `lbt'.
+ (encode-mime-charset-string): Ditto.
+ (decode-mime-charset-region): Use `lbt-to-string'.
+
+ * mcs-e20.el (encode-mime-charset-region): Add new optional
+ argument `lbt'.
+ (encode-mime-charset-string): Ditto.
+
+ * mcs-om.el (lbt-to-string): New inline function.
+ (encode-mime-charset-region): Add new optional argument `lbt'.
+ (encode-mime-charset-string): Ditto.
+ (decode-mime-charset-region): Use `lbt-to-string'.
+ (decode-mime-charset-string): Ditto.
+
1998-12-24 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* mcs-om.el (default-mime-charset-for-write): New variable.
1998-04-27 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* calist.el (ctree-find-calist): Renamed from
- 'ctree-match-calist-all.
+ 'ctree-match-calist-all.
\f
1998-04-25 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* APEL: Version 8.4 was released.
- * EMU-ELS: Don't use HIRAGANA LETTER A (\e$(B$"\e(B) to detect character
+ * EMU-ELS: Don't use HIRAGANA LETTER A (\e$B$"\e(B) to detect character
indexing (Emacs 20.3 or later).
1998-04-20 MORIOKA Tomohiko <morioka@jaist.ac.jp>
(defvar default-mime-charset 'iso-8859-1)
+(defsubst lbt-to-string (lbt)
+ (cdr (assq lbt '((nil . nil)
+ (CRLF . "\r\n")
+ (CR . "\r")
+ (dos . "\r\n")
+ (mac . "\r"))))
+ )
+
(defun mime-charset-to-coding-system (charset)
(if (stringp charset)
(setq charset (intern (downcase charset)))
default-mime-charset
'us-ascii))
-(defun encode-mime-charset-region (start end charset)
+(defun encode-mime-charset-region (start end charset &optional lbt)
"Encode the text between START and END as MIME CHARSET."
- )
+ (let ((newline (lbt-to-string lbt)))
+ (if newline
+ (save-excursion
+ (save-restriction
+ (narrow-to-region start end)
+ (goto-char (point-min))
+ (while (search-forward "\n" nil t)
+ (replace-match newline))
+ )))
+ ))
(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)
+ (let ((newline (lbt-to-string lbt)))
+ (if newline
+ (save-excursion
+ (save-restriction
+ (narrow-to-region start end)
+ (goto-char (point-min))
+ (while (search-forward newline nil t)
+ (replace-match "\n"))
+ )))
+ ))
+
+(defun encode-mime-charset-string (string charset &optional lbt)
"Encode the STRING as MIME CHARSET."
- string)
+ (if lbt
+ (with-temp-buffer
+ (insert string)
+ (encode-mime-charset-region (point-min)(point-max) charset lbt)
+ (buffer-string))
+ string))
(defun decode-mime-charset-string (string charset &optional lbt)
"Decode the STRING as MIME CHARSET."