+1998-08-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * emu-nemacs.el, emu-mule.el (decode-mime-charset-region): Add new
+ argument `lbt'.
+ (decode-mime-charset-string): Likewise.
+
+ * emu-mule.el (mime-charset-to-coding-system): Regard `CRLF',
+ `LF', `CR' as line break code type.
+
1998-08-11 MORIOKA Tomohiko <morioka@jaist.ac.jp>
* emu-latin1.el, emu-nemacs.el (write-region-as-raw-text-CRLF):
* emu-mule.el (write-region-as-raw-text-CRLF): New function.
* emu-18.el (generate-new-buffer-name): New function (Emacs 19
- mulating function).
+ emulating function).
1998-08-10 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>
(code-convert start end *internal* cs)
)))
-(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."
- (let ((cs (mime-charset-to-coding-system charset)))
+ (let ((cs (mime-charset-to-coding-system charset lbt)))
(if cs
(code-convert start end cs *internal*)
)))
(code-convert-string string *internal* cs)
string)))
-(defun decode-mime-charset-string (string charset)
+(defun decode-mime-charset-string (string charset &optional lbt)
"Decode the STRING which is encoded in MIME CHARSET."
- (let ((cs (mime-charset-to-coding-system charset)))
+ (let ((cs (mime-charset-to-coding-system charset lbt)))
(if cs
(decode-coding-string string cs)
string)))
(if (or (null lbt)
(null cs))
cs
- (intern (concat (symbol-name cs) (symbol-name lbt)))
+ (intern (format "%s%s" cs (cond ((eq lbt 'CRLF) 'dos)
+ ((eq lbt 'LF) 'unix)
+ ((eq lbt 'CR) 'mac)
+ (t lbt))))
)))
))
))))
-(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.
\[emu-nemacs.el]"
- (let ((cs (mime-charset-to-coding-system charset)))
+ (let ((cs (mime-charset-to-coding-system charset))
+ (nl (cdr (assq lbt '((CRLF . "\r\n") (CR . "\r")
+ (dos . "\r\n") (mac . "\r"))))))
(and (numberp cs)
(or (= cs 3)
(save-excursion
(save-restriction
(narrow-to-region start end)
(convert-region-kanji-code start end cs 3)
+ (if nl
+ (progn
+ (goto-char (point-min))
+ (while (search-forward nl nil t)
+ (replace-match "\n"))))
))
))))
(convert-string-kanji-code string 3 cs)
string)))
-(defun decode-mime-charset-string (string charset)
+(defun decode-mime-charset-string (string charset &optional lbt)
"Decode the STRING as MIME CHARSET. [emu-nemacs.el]"
- (let ((cs (mime-charset-to-coding-system charset)))
- (if cs
- (convert-string-kanji-code string cs 3)
- string)))
+ (with-temp-buffer
+ (insert string)
+ (decode-mime-charset-region (point-min)(point-max) charset lbt)
+ (buffer-string)))
(defun write-region-as-mime-charset (charset start end filename)
"Like `write-region', q.v., but code-convert by MIME CHARSET.