Mercurial > hg > xemacs-beta
comparison lisp/tl/emu-x20.el @ 86:364816949b59 r20-0b93
Import from CVS: tag r20-0b93
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:09:02 +0200 |
parents | 6a378aca36af |
children | 0d2f883870bc |
comparison
equal
deleted
inserted
replaced
85:c661705957e0 | 86:364816949b59 |
---|---|
1 ;;; emu-x20.el --- emu API implementation for XEmacs 20 with mule | 1 ;;; emu-x20.el --- emu API implementation for XEmacs 20 with mule |
2 | 2 |
3 ;; Copyright (C) 1995 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1994,1995,1996,1997 MORIOKA Tomohiko |
4 ;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko | |
5 | 4 |
6 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> | 5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> |
7 ;; Version: $Id: emu-x20.el,v 1.2 1997/01/23 05:29:40 steve Exp $ | 6 ;; Version: $Id: emu-x20.el,v 1.3 1997/01/30 02:22:46 steve Exp $ |
8 ;; Keywords: emulation, compatibility, Mule, XEmacs | 7 ;; Keywords: emulation, compatibility, Mule, XEmacs |
9 | 8 |
10 ;; This file is part of tl (Tiny Library). | 9 ;; This file is part of XEmacs. |
11 | 10 |
12 ;; This program is free software; you can redistribute it and/or | 11 ;; This program is free software; you can redistribute it and/or |
13 ;; modify it under the terms of the GNU General Public License as | 12 ;; modify it under the terms of the GNU General Public License as |
14 ;; published by the Free Software Foundation; either version 2, or (at | 13 ;; published by the Free Software Foundation; either version 2, or (at |
15 ;; your option) any later version. | 14 ;; your option) any later version. |
32 (defvar xemacs-beta-version | 31 (defvar xemacs-beta-version |
33 (if (string-match "(beta\\([0-9]+\\))" emacs-version) | 32 (if (string-match "(beta\\([0-9]+\\))" emacs-version) |
34 (string-to-number | 33 (string-to-number |
35 (substring emacs-version (match-beginning 1)(match-end 1)) | 34 (substring emacs-version (match-beginning 1)(match-end 1)) |
36 ))) | 35 ))) |
37 | |
38 | |
39 ;;; @ graphic character set | |
40 ;;; | |
41 | |
42 (defalias 'charset-description 'charset-doc-string) | |
43 | |
44 (defalias 'find-charset-string 'charsets-in-string) | |
45 (defalias 'find-charset-region 'charsets-in-region) | |
46 | |
47 (defun find-non-ascii-charset-string (string) | |
48 "Return a list of charsets in the STRING except ascii. | |
49 \[emu-x20.el; Mule emulating function]" | |
50 (delq 'ascii (charsets-in-string string)) | |
51 ) | |
52 | |
53 (defun find-non-ascii-charset-region (start end) | |
54 "Return a list of charsets except ascii | |
55 in the region between START and END. | |
56 \[emu-x20.el; Mule emulating function]" | |
57 (delq 'ascii (charsets-in-region start end)) | |
58 ) | |
59 | 36 |
60 | 37 |
61 ;;; @ coding-system | 38 ;;; @ coding-system |
62 ;;; | 39 ;;; |
63 | 40 |
94 ((ascii cyrillic-iso8859-5) . koi8-r) | 71 ((ascii cyrillic-iso8859-5) . koi8-r) |
95 ((ascii arabic-iso8859-6) . iso-8859-6) | 72 ((ascii arabic-iso8859-6) . iso-8859-6) |
96 ((ascii greek-iso8859-7) . iso-8859-7) | 73 ((ascii greek-iso8859-7) . iso-8859-7) |
97 ((ascii hebrew-iso8859-8) . iso-8859-8) | 74 ((ascii hebrew-iso8859-8) . iso-8859-8) |
98 ((ascii latin-iso8859-9) . iso-8859-9) | 75 ((ascii latin-iso8859-9) . iso-8859-9) |
99 ((ascii japanese-jisx0208-1978 japanese-jisx0208) . iso-2022-jp) | 76 ((ascii latin-jisx0201 |
77 japanese-jisx0208-1978 japanese-jisx0208) . iso-2022-jp) | |
100 ((ascii korean-ksc5601) . euc-kr) | 78 ((ascii korean-ksc5601) . euc-kr) |
101 ((ascii chinese-big5-1 chinese-big5-2) . big5) | 79 ((ascii chinese-gb2312) . cn-gb-2312) |
102 ((ascii japanese-jisx0208-1978 chinese-gb | 80 ((ascii chinese-big5-1 chinese-big5-2) . cn-big5) |
103 japanese-jisx0208 korean-ksc5601 | 81 ((ascii latin-iso8859-1 greek-iso8859-7 |
104 japanese-jisx0212 latin-iso8859-1 | 82 latin-jisx0201 japanese-jisx0208-1978 |
105 greek-iso8859-7) . iso-2022-jp-2) | 83 chinese-gb2312 japanese-jisx0208 |
106 ((ascii japanese-jisx0208-1978 chinese-gb2312 | 84 korean-ksc5601 japanese-jisx0212) . iso-2022-jp-2) |
107 japanese-jisx0208 korean-ksc5601 | 85 ((ascii latin-iso8859-1 greek-iso8859-7 |
108 japanese-jisx0212 | 86 latin-jisx0201 japanese-jisx0208-1978 |
87 chinese-gb2312 japanese-jisx0208 | |
88 korean-ksc5601 japanese-jisx0212 | |
89 chinese-cns11643-1 chinese-cns11643-2) . iso-2022-int-1) | |
90 ((ascii latin-iso8859-1 latin-iso8859-2 | |
91 cyrillic-iso8859-5 greek-iso8859-7 | |
92 latin-jisx0201 japanese-jisx0208-1978 | |
93 chinese-gb2312 japanese-jisx0208 | |
94 korean-ksc5601 japanese-jisx0212 | |
109 chinese-cns11643-1 chinese-cns11643-2 | 95 chinese-cns11643-1 chinese-cns11643-2 |
110 latin-iso8859-1 greek-iso8859-7) . iso-2022-int-1) | 96 chinese-cns11643-3 chinese-cns11643-4 |
97 chinese-cns11643-5 chinese-cns11643-6 | |
98 chinese-cns11643-7) . iso-2022-int-1) | |
111 )) | 99 )) |
112 | 100 |
113 (defvar default-mime-charset 'iso-2022-int-1) | 101 (defvar default-mime-charset 'x-ctext) |
114 | 102 |
115 (defvar mime-charset-coding-system-alist | 103 (defvar mime-charset-coding-system-alist |
116 '((iso-8859-1 . ctext) | 104 '((iso-8859-1 . ctext) |
117 (gb2312 . euc-china) | 105 (x-ctext . ctext) |
118 (koi8-r . koi8) | 106 (hz-gb-2312 . hz) |
119 (iso-2022-jp-2 . iso-2022-ss2-7) | 107 (cn-gb-2312 . euc-china) |
120 (x-iso-2022-jp-2 . iso-2022-ss2-7) | 108 (gb2312 . euc-china) |
121 (shift_jis . sjis) | 109 (cn-big5 . big5) |
122 (x-shiftjis . sjis) | 110 (koi8-r . koi8) |
111 (iso-2022-jp-2 . iso-2022-ss2-7) | |
123 )) | 112 )) |
124 | 113 |
125 (defun mime-charset-to-coding-system (charset) | 114 (defun mime-charset-to-coding-system (charset) |
126 "Return coding-system by MIME charset. [emu-x20.el]" | 115 "Return coding-system by MIME charset. [emu-x20.el]" |
127 (if (stringp charset) | 116 (if (stringp charset) |
168 | 157 |
169 | 158 |
170 ;;; @ character | 159 ;;; @ character |
171 ;;; | 160 ;;; |
172 | 161 |
173 ;(defun char-bytes (chr) 1) | 162 ;; (defun char-bytes (chr) 1) |
174 | 163 |
175 ;(defun char-length (character) | 164 ;; (defun char-length (character) |
176 ; "Return number of elements a CHARACTER occupies in a string or buffer. | 165 ;; "Return number of elements a CHARACTER occupies in a string or buffer. |
177 ;\[emu-x20.el]" | 166 ;; \[emu-x20.el]" |
178 ; 1) | 167 ;; 1) |
179 | 168 |
180 ;(defun char-columns (character) | 169 ;; (defun char-columns (character) |
181 ; "Return number of columns a CHARACTER occupies when displayed. | 170 ;; "Return number of columns a CHARACTER occupies when displayed. |
182 ;\[emu-x20.el]" | 171 ;; \[emu-x20.el]" |
183 ; (charset-columns (char-charset character)) | 172 ;; (charset-columns (char-charset character)) |
184 ; ) | 173 ;; ) |
185 | 174 |
186 ;;; @@ Mule emulating aliases | 175 ;;; @@ Mule emulating aliases |
187 ;;; | 176 ;;; |
188 ;;; You should not use them. | 177 ;;; You should not use them. |
189 | 178 |
190 ;(defalias 'char-width 'char-columns) | 179 ;;(defalias 'char-width 'char-columns) |
191 | 180 |
192 (defalias 'char-leading-char 'char-charset) | 181 (defalias 'char-leading-char 'char-charset) |
193 | 182 |
194 (defun char-category (character) | 183 (defun char-category (character) |
195 "Return string of category mnemonics for CHAR in TABLE. | 184 "Return string of category mnemonics for CHAR in TABLE. |
204 | 193 |
205 | 194 |
206 ;;; @ string | 195 ;;; @ string |
207 ;;; | 196 ;;; |
208 | 197 |
209 ;(defun string-columns (string) | 198 ;; (defun string-columns (string) |
210 ; "Return number of columns STRING occupies when displayed. | 199 ;; "Return number of columns STRING occupies when displayed. |
211 ;\[emu-x20.el]" | 200 ;; \[emu-x20.el]" |
212 ; (let ((col 0) | 201 ;; (let ((col 0) |
213 ; (len (length string)) | 202 ;; (len (length string)) |
214 ; (i 0)) | 203 ;; (i 0)) |
215 ; (while (< i len) | 204 ;; (while (< i len) |
216 ; (setq col (+ col (char-columns (aref string i)))) | 205 ;; (setq col (+ col (char-columns (aref string i)))) |
217 ; (setq i (1+ i)) | 206 ;; (setq i (1+ i)) |
218 ; ) | 207 ;; ) |
219 ; col)) | 208 ;; col)) |
220 | 209 |
221 ;(defalias 'string-width 'string-columns) | 210 ;;(defalias 'string-width 'string-columns) |
222 | 211 |
223 (defun string-to-int-list (str) | 212 (defun string-to-int-list (str) |
224 (mapcar #'char-int str) | 213 (mapcar #'char-int str) |
225 ) | 214 ) |
226 | 215 |
227 ;(defalias 'sref 'aref) | 216 ;;(defalias 'sref 'aref) |
228 | 217 |
229 ;(defun truncate-string (str width &optional start-column) | 218 ;; (defun truncate-string (str width &optional start-column) |
230 ; "Truncate STR to fit in WIDTH columns. | 219 ;; "Truncate STR to fit in WIDTH columns. |
231 ;Optional non-nil arg START-COLUMN specifies the starting column. | 220 ;; Optional non-nil arg START-COLUMN specifies the starting column. |
232 ;\[emu-x20.el; Mule 2.3 emulating function]" | 221 ;; \[emu-x20.el; Mule 2.3 emulating function]" |
233 ; (or start-column | 222 ;; (or start-column |
234 ; (setq start-column 0)) | 223 ;; (setq start-column 0)) |
235 ; (substring str start-column width) | 224 ;; (substring str start-column width) |
236 ; ) | 225 ;; ) |
237 | 226 |
238 | 227 |
239 ;;; @ end | 228 ;;; @ end |
240 ;;; | 229 ;;; |
241 | 230 |