2 ;;; emu-x20.el --- Mule 2 emulation module for XEmacs 20 with Mule
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; $Id: emu-x20.el,v 3.1 1996/04/28 16:53:05 morioka Exp $
10 ;;; Keywords: emulation, compatibility, Mule, XEmacs
12 ;;; This file is part of tl (Tiny Library).
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.
33 (defalias 'char-leading-char 'char-charset)
35 (defun find-charset-string (string)
36 "Return a list of charsets in the STRING except ascii.
37 \[emu-x20.el; Mule emulating function]"
38 (delq 'ascii (charsets-in-string string))
41 (defun find-charset-region (start end)
42 "Return a list of charsets except ascii
43 in the region between START and END.
44 \[emu-x20.el; Mule emulating function]"
45 (delq 'ascii (charsets-in-region start end))
48 (defconst lc-ascii 'ascii)
49 (defconst lc-ltn1 'latin-1)
50 (defconst lc-ltn2 'latin-2)
51 (defconst lc-ltn3 'latin-3)
52 (defconst lc-ltn4 'latin-4)
53 (defconst lc-crl 'cyrillic)
54 (defconst lc-arb 'arabic)
55 (defconst lc-grk 'greek)
56 (defconst lc-hbw 'hebrew)
57 (defconst lc-ltn5 'latin-5)
58 (defconst lc-jp 'japanese)
59 (defconst lc-jp2 'japanese-2)
60 (defconst lc-kr 'korean)
61 (defconst lc-big5-1 'chinese-big5-1)
62 (defconst lc-big5-2 'chinese-big5-2)
63 (defconst lc-cn 'chinese-gb)
64 (defconst lc-cns1 'chinese-cns-1)
65 (defconst lc-cns2 'chinese-cns-2)
66 (defconst lc-cns3 'chinese-cns-3)
67 (defconst lc-cns4 'chinese-cns-4)
68 (defconst lc-cns5 'chinese-cns-5)
69 (defconst lc-cns6 'chinese-cns-6)
70 (defconst lc-cns7 'chinese-cns-7)
76 (defconst *noconv* 'noconv)
77 (defconst *ctext* 'ctext)
79 (defvar code-converter-is-broken (string-match "(beta17)" emacs-version))
81 (if code-converter-is-broken
84 (defun decode-coding-region (start end coding-system &optional buffer)
85 "Decode the text between START and END which is encoded in CODING-SYSTEM.
86 \[emu-x20.el; XEmacs 20 emulating function]"
92 (narrow-to-region start end)
93 (let ((process-output-coding-system 'noconv)
94 (process-input-coding-system coding-system))
95 (call-process-region start end "cat" t t nil)
98 (defun encode-coding-region (start end coding-system &optional buffer)
99 "Encode the text between START and END which is encoded in CODING-SYSTEM.
100 \[emu-x20.el; XEmacs 20 emulating function]"
106 (narrow-to-region start end)
107 (let ((process-output-coding-system coding-system)
108 (process-input-coding-system 'noconv))
109 (call-process-region start end "cat" t t nil)
115 ;;; @ character and string
118 (defun char-bytes (chr) 1)
119 (defun char-width (chr) 1)
121 (defalias 'string-width 'length)
123 (defalias 'sref 'aref)
125 (defun truncate-string (str width &optional start-column)
126 "Truncate STR to fit in WIDTH columns.
127 Optional non-nil arg START-COLUMN specifies the starting column.
128 \[emu-x20.el; Mule 2.3 emulating function]"
130 (setq start-column 0))
131 (substring str start-column width)
138 (require 'emu-xemacs)
146 ;;; emu-x20.el ends here