2 ;;; tm-nemacs.el --- tm definitions depended on NEmacs
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; $Id: tm-nemacs.el,v 7.6 1996/01/11 05:12:50 morioka Exp $
10 ;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word
12 ;;; This file is part of tm (Tools for MIME).
14 ;;; This program is free software; you can redistribute it and/or
15 ;;; modify it under the terms of the GNU General Public License as
16 ;;; published by the Free Software Foundation; either version 2, or
17 ;;; (at your option) any later version.
19 ;;; This program is distributed in the hope that it will be useful,
20 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 ;;; General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with This program. If not, write to the Free Software
26 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
36 (defvar mime/default-coding-system *junet*)
38 (defvar mime/lc-charset-alist
40 (cons (list lc-ascii) "US-ASCII")
41 (cons (list lc-ascii lc-jp) "ISO-2022-JP")
44 (defvar mime/unknown-charset "ISO-2022-JP")
50 (defun mime/convert-string-to-emacs (charset str)
51 (cond ((string= "ISO-2022-JP" charset)
52 (code-convert-string str *junet* *internal*))
53 ((string= "US-ASCII" charset) str)
54 ((string-match "^ISO-8859-[1-9]$" charset)
55 (check-ASCII-string str))
58 (defun mime/convert-string-from-emacs (string charset)
59 (cond ((string= charset "ISO-2022-JP")
60 (code-convert-string string *internal* *junet*))
61 ((string= charset "US-ASCII") string)
64 (defun mime/code-convert-region-to-emacs (beg end charset &optional encoding)
67 (setq charset (upcase charset))
68 (if (string= charset "ISO-2022-JP")
69 (code-convert-region beg end *junet* *internal*)
78 (run-hooks 'tm-nemacs-load-hook)
80 ;;; tm-nemacs.el ends here