APEL 3.4.1.
[elisp/apel.git] / emu-e20.el
1 ;;; emu-e20.el --- emu API implementation for Emacs/mule (19.34.91-delta)
2
3 ;; Copyright (C) 1996,1997 Free Software Foundation, Inc.
4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; Version: $Id: emu-e20.el,v 7.22 1997/08/30 07:46:40 morioka Exp $
7 ;; Keywords: emulation, compatibility, Mule
8
9 ;; This file is part of emu.
10
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
15
16 ;; This program 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 GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Commentary:
27
28 ;;    This module requires Emacs 20.0.90 or later.
29
30 ;;; Code:
31
32 (require 'emu-19)
33
34 (defun fontset-pixel-size (fontset)
35   (let* ((info (fontset-info fontset))
36          (height (aref info 1))
37          )
38     (cond ((> height 0) height)
39           ((string-match "-\\([0-9]+\\)-" fontset)
40            (string-to-number
41             (substring fontset (match-beginning 1)(match-end 1))
42             )
43            )
44           (t 0)
45           )))
46
47 (require 'emu-20)
48
49
50 ;;; @ character set
51 ;;;
52
53 ;; (defalias 'charset-columns 'charset-width)
54
55 (defun find-non-ascii-charset-string (string)
56   "Return a list of charsets in the STRING except ascii."
57   (delq 'ascii (find-charset-string string))
58   )
59
60 (defun find-non-ascii-charset-region (start end)
61   "Return a list of charsets except ascii
62 in the region between START and END."
63   (delq 'ascii (find-charset-string (buffer-substring start end)))
64   )
65
66
67 ;;; @ coding system
68 ;;;
69
70 (defalias 'set-process-input-coding-system 'set-process-coding-system)
71
72
73 ;;; @ MIME charset
74 ;;;
75
76 (defvar charsets-mime-charset-alist
77   '(((ascii)                                            . us-ascii)
78     ((ascii latin-iso8859-1)                            . iso-8859-1)
79     ((ascii latin-iso8859-2)                            . iso-8859-2)
80     ((ascii latin-iso8859-3)                            . iso-8859-3)
81     ((ascii latin-iso8859-4)                            . iso-8859-4)
82 ;;; ((ascii cyrillic-iso8859-5)                         . iso-8859-5)
83     ((ascii cyrillic-iso8859-5)                         . koi8-r)
84     ((ascii arabic-iso8859-6)                           . iso-8859-6)
85     ((ascii greek-iso8859-7)                            . iso-8859-7)
86     ((ascii hebrew-iso8859-8)                           . iso-8859-8)
87     ((ascii latin-iso8859-9)                            . iso-8859-9)
88     ((ascii latin-jisx0201
89             japanese-jisx0208-1978 japanese-jisx0208)   . iso-2022-jp)
90     ((ascii korean-ksc5601)                             . euc-kr)
91     ((ascii chinese-gb2312)                             . cn-gb-2312)
92     ((ascii chinese-big5-1 chinese-big5-2)              . cn-big5)
93     ((ascii latin-iso8859-1 greek-iso8859-7
94             latin-jisx0201 japanese-jisx0208-1978
95             chinese-gb2312 japanese-jisx0208
96             korean-ksc5601 japanese-jisx0212)           . iso-2022-jp-2)
97     ((ascii latin-iso8859-1 greek-iso8859-7
98             latin-jisx0201 japanese-jisx0208-1978
99             chinese-gb2312 japanese-jisx0208
100             korean-ksc5601 japanese-jisx0212
101             chinese-cns11643-1 chinese-cns11643-2)      . iso-2022-int-1)
102     ((ascii latin-iso8859-1 latin-iso8859-2
103             cyrillic-iso8859-5 greek-iso8859-7
104             latin-jisx0201 japanese-jisx0208-1978
105             chinese-gb2312 japanese-jisx0208
106             korean-ksc5601 japanese-jisx0212
107             chinese-cns11643-1 chinese-cns11643-2
108             chinese-cns11643-3 chinese-cns11643-4
109             chinese-cns11643-5 chinese-cns11643-6
110             chinese-cns11643-7)                         . iso-2022-int-1)
111     ))
112
113
114 ;;; @ character
115 ;;;
116
117 (defalias 'char-length 'char-bytes)
118
119 (defalias 'char-columns 'char-width)
120
121
122 ;;; @@ Mule emulating aliases
123 ;;;
124 ;;; You should not use them.
125
126 (defun char-category (character)
127   "Return string of category mnemonics for CHAR in TABLE.
128 CHAR can be any multilingual character
129 TABLE defaults to the current buffer's category table."
130   (category-set-mnemonics (char-category-set character))
131   )
132
133
134 ;;; @ string
135 ;;;
136
137 (defalias 'string-columns 'string-width)
138
139 (defalias 'sset 'store-substring)
140
141 (defun string-to-char-list (string)
142   "Return a list of which elements are characters in the STRING."
143   (let* ((len (length string))
144          (i 0)
145          l chr)
146     (while (< i len)
147       (setq chr (sref string i))
148       (setq l (cons chr l))
149       (setq i (+ i (char-bytes chr)))
150       )
151     (nreverse l)
152     ))
153
154 (defalias 'string-to-int-list 'string-to-char-list)
155
156
157 ;;; @ end
158 ;;;
159
160 (provide 'emu-e20)
161
162 ;;; emu-e20.el ends here