X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tm-def.el;h=d554a8bf837f033cd11306fd90175dbdd4af74e9;hb=a5ffa065614536ca388988f44c80bebcca51a483;hp=5de868a66a8f3498d5e1b3588ff689c8ad061f0b;hpb=cac5fe424e2e46ed07ac582692c3d5b11db677d7;p=elisp%2Ftm.git diff --git a/tm-def.el b/tm-def.el index 5de868a..d554a8b 100644 --- a/tm-def.el +++ b/tm-def.el @@ -6,7 +6,7 @@ ;;; ;;; Author: MORIOKA Tomohiko ;;; Version: -;;; $Id: tm-def.el,v 7.35 1996/04/25 14:29:51 morioka Exp $ +;;; $Id: tm-def.el,v 7.36 1996/04/27 15:30:29 morioka Exp $ ;;; Keywords: mail, news, MIME, multimedia, definition ;;; ;;; This file is part of tm (Tools for MIME). @@ -164,44 +164,55 @@ ;;; (defvar mime/charset-coding-system-alist - (foldr (function - (lambda (a cell) - (if (boundp (cdr cell)) - (cons (cons (car cell) (symbol-value (cdr cell))) a) - a))) - nil - '(("ISO-2022-JP" . *junet*) - ("ISO-2022-KR" . *iso-2022-kr*) - ("EUC-KR" . *euc-kr*) - ("ISO-8859-1" . *ctext*) - ("ISO-8859-2" . *iso-8859-2*) - ("ISO-8859-3" . *iso-8859-3*) - ("ISO-8859-4" . *iso-8859-4*) - ("ISO-8859-5" . *iso-8859-5*) - ("KOI8-R" . *koi8*) - ("ISO-8859-7" . *iso-8859-7*) - ("ISO-8859-8" . *iso-8859-8*) - ("ISO-8859-9" . *iso-8859-9*) - ("ISO-2022-JP-2" . *iso-2022-ss2-7*) - ("X-ISO-2022-JP-2" . *iso-2022-ss2-7*) - ("ISO-2022-INT-1" . *iso-2022-int-1*) - ("SHIFT_JIS" . *sjis*) - ("X-SHIFTJIS" . *sjis*) - ("BIG5" . *big5*) - ))) + (let* (csl + (f (if (and running-xemacs-20 (featurep 'mule)) + (progn + (setq csl (coding-system-list)) + (function + (lambda (a cell) + (if (memq (cdr cell) csl) + (cons cell a) + a)))) + (function + (lambda (a cell) + (let ((sym (symbol-concat "*" (cdr cell) "*"))) + (if (boundp sym) + (cons (cons (car cell) (symbol-value sym)) a) + a)))) + ))) + (foldr f nil + '(("ISO-2022-JP" . junet) + ("ISO-2022-KR" . iso-2022-kr) + ("EUC-KR" . euc-kr) + ("ISO-8859-1" . ctext) + ("ISO-8859-2" . iso-8859-2) + ("ISO-8859-3" . iso-8859-3) + ("ISO-8859-4" . iso-8859-4) + ("ISO-8859-5" . iso-8859-5) + ("KOI8-R" . koi8) + ("ISO-8859-7" . iso-8859-7) + ("ISO-8859-8" . iso-8859-8) + ("ISO-8859-9" . iso-8859-9) + ("ISO-2022-JP-2" . iso-2022-ss2-7) + ("X-ISO-2022-JP-2" . iso-2022-ss2-7) + ("ISO-2022-INT-1" . iso-2022-int-1) + ("SHIFT_JIS" . sjis) + ("X-SHIFTJIS" . sjis) + ("BIG5" . big5) + )))) (defvar mime/default-coding-system *ctext*) (defun mime/convert-string-to-emacs (str charset) (let ((cs (assoc charset mime/charset-coding-system-alist))) (if cs - (code-convert-string str (cdr cs) *internal*) + (decode-coding-string str (cdr cs)) ))) (defun mime/convert-string-from-emacs (str charset) (let ((cs (assoc charset mime/charset-coding-system-alist))) (if cs - (code-convert-string str *internal* (cdr cs)) + (encode-coding-string str (cdr cs)) ))) (defun mime/code-convert-region-to-emacs (beg end charset &optional encoding) @@ -210,7 +221,7 @@ (cdr (assoc (upcase charset) mime/charset-coding-system-alist)) mime/default-coding-system))) (if ct - (code-convert-region beg end ct *internal*) + (decode-coding-region beg end ct) ))) (defun mime/code-convert-region-from-emacs (beg end charset &optional encoding) @@ -219,7 +230,7 @@ (cdr (assoc (upcase charset) mime/charset-coding-system-alist)) mime/default-coding-system))) (if ct - (code-convert-region beg end *internal* ct) + (encode-coding-region beg end ct) )))