ba3240a1834e93078fcd8491ca8665ab5e41f01d
[elisp/apel.git] / emu-x20.el
1 ;;; emu-x20.el --- emu API implementation for XEmacs 20 with mule
2
3 ;; Copyright (C) 1994,1995,1996,1997 MORIOKA Tomohiko
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Version: $Id: emu-x20.el,v 7.66 1997/08/30 07:09:21 morioka Exp $
7 ;; Keywords: emulation, compatibility, Mule, XEmacs
8
9 ;; This file is part of XEmacs.
10
11 ;; XEmacs is free software; you can redistribute it and/or modify it
12 ;; under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; XEmacs is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 ;; General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with XEmacs; see the file COPYING.  If not, write to the Free
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 ;; 02111-1307, USA.
25
26 ;;; Commentary:
27
28 ;;    This module requires XEmacs 20.3-b5 or later with mule.
29
30 ;;; Code:
31
32 (require 'emu-xemacs)
33 (require 'emu-20)
34
35
36 ;;; @ MIME charset
37 ;;;
38
39 (defvar charsets-mime-charset-alist
40   '(((ascii)                                            . us-ascii)
41     ((ascii latin-iso8859-1)                            . iso-8859-1)
42     ((ascii latin-iso8859-2)                            . iso-8859-2)
43     ((ascii latin-iso8859-3)                            . iso-8859-3)
44     ((ascii latin-iso8859-4)                            . iso-8859-4)
45 ;;; ((ascii cyrillic-iso8859-5)                         . iso-8859-5)
46     ((ascii cyrillic-iso8859-5)                         . koi8-r)
47     ((ascii arabic-iso8859-6)                           . iso-8859-6)
48     ((ascii greek-iso8859-7)                            . iso-8859-7)
49     ((ascii hebrew-iso8859-8)                           . iso-8859-8)
50     ((ascii latin-iso8859-9)                            . iso-8859-9)
51     ((ascii latin-jisx0201
52             japanese-jisx0208-1978 japanese-jisx0208)   . iso-2022-jp)
53     ((ascii korean-ksc5601)                             . euc-kr)
54     ((ascii chinese-gb2312)                             . cn-gb-2312)
55     ((ascii chinese-big5-1 chinese-big5-2)              . cn-big5)
56     ((ascii latin-iso8859-1 greek-iso8859-7
57             latin-jisx0201 japanese-jisx0208-1978
58             chinese-gb2312 japanese-jisx0208
59             korean-ksc5601 japanese-jisx0212)           . iso-2022-jp-2)
60     ((ascii latin-iso8859-1 greek-iso8859-7
61             latin-jisx0201 japanese-jisx0208-1978
62             chinese-gb2312 japanese-jisx0208
63             korean-ksc5601 japanese-jisx0212
64             chinese-cns11643-1 chinese-cns11643-2)      . iso-2022-int-1)
65     ((ascii latin-iso8859-1 latin-iso8859-2
66             cyrillic-iso8859-5 greek-iso8859-7
67             latin-jisx0201 japanese-jisx0208-1978
68             chinese-gb2312 japanese-jisx0208
69             korean-ksc5601 japanese-jisx0212
70             chinese-cns11643-1 chinese-cns11643-2
71             chinese-cns11643-3 chinese-cns11643-4
72             chinese-cns11643-5 chinese-cns11643-6
73             chinese-cns11643-7)                         . iso-2022-int-1)
74     ))
75
76 (defun detect-mime-charset-region (start end)
77   "Return MIME charset for region between START and END."
78   (charsets-to-mime-charset (charsets-in-region start end)))
79
80
81 ;;; @ character
82 ;;;
83
84 ;;; @@ Mule emulating aliases
85 ;;;
86 ;;; You should not use them.
87
88 (defalias 'char-leading-char 'char-charset)
89
90 (defun char-category (character)
91   "Return string of category mnemonics for CHAR in TABLE.
92 CHAR can be any multilingual character
93 TABLE defaults to the current buffer's category table."
94   (mapconcat (lambda (chr)
95                (char-to-string (int-char chr))
96                )
97              (char-category-list character)
98              ""))
99
100
101 ;;; @ string
102 ;;;
103
104 (defun string-to-int-list (str)
105   (mapcar #'char-int str)
106   )
107
108
109 ;;; @ end
110 ;;;
111
112 (provide 'emu-x20)
113
114 ;;; emu-x20.el ends here