tm 7.67.
[elisp/tm.git] / tm-nemacs.el
1 ;;;
2 ;;; tm-nemacs.el --- tm definitions depended on NEmacs
3 ;;;
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko
6 ;;;
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;;; Version:
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
11 ;;;
12 ;;; This file is part of tm (Tools for MIME).
13 ;;;
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.
18 ;;;
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.
23 ;;;
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.
27 ;;;
28 ;;; Code:
29
30 (require 'emu)
31
32
33 ;;; @ variables
34 ;;;
35
36 (defvar mime/default-coding-system *junet*)
37
38 (defvar mime/lc-charset-alist
39   (list
40    (cons (list lc-ascii)       "US-ASCII")
41    (cons (list lc-ascii lc-jp) "ISO-2022-JP")
42    ))
43
44 (defvar mime/unknown-charset "ISO-2022-JP")
45
46
47 ;;; @ functions
48 ;;;
49
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))
56         ))
57
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)
62         ))
63
64 (defun mime/code-convert-region-to-emacs (beg end charset &optional encoding)
65   (if (stringp charset)
66       (progn
67         (setq charset (upcase charset))
68         (if (string= charset "ISO-2022-JP")
69             (code-convert-region beg end *junet* *internal*)
70           ))))
71
72
73 ;;; @ end
74 ;;;
75
76 (provide 'tm-nemacs)
77
78 (run-hooks 'tm-nemacs-load-hook)
79
80 ;;; tm-nemacs.el ends here