Mercurial > hg > xemacs-beta
comparison lisp/tl/emu-orig.el @ 4:b82b59fe008d r19-15b3
Import from CVS: tag r19-15b3
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:56 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:30df88044ec6 | 4:b82b59fe008d |
---|---|
1 ;;; | |
2 ;;; emu-orig.el --- Mule 2 emulation module for Original Emacs and XEmacs | |
3 ;;; | |
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc. | |
5 ;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko | |
6 ;;; | |
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> | |
8 ;;; Version: | |
9 ;;; $Id: emu-orig.el,v 1.1.1.1 1996/12/18 03:55:31 steve Exp $ | |
10 ;;; Keywords: emulation, compatibility, Mule | |
11 ;;; | |
12 ;;; This file is part of tl (Tiny Library). | |
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 ;;; @ leading-char | |
31 ;;; | |
32 | |
33 (defconst lc-ascii 0) | |
34 (defconst lc-ltn1 129) | |
35 | |
36 (defun char-leading-char (chr) | |
37 "Return leading character of CHAR. | |
38 \[emu-orig.el; Mule emulating function]" | |
39 (if (< chr 128) | |
40 lc-ascii | |
41 lc-ltn1)) | |
42 | |
43 (defalias 'get-lc 'char-leading-char) | |
44 | |
45 (defun find-charset-string (str) | |
46 "Return a list of leading-chars in the string. | |
47 \[emu-orig.el; Mule emulating function]" | |
48 (if (string-match "[\200-\377]" str) | |
49 (list lc-ltn1) | |
50 )) | |
51 | |
52 (defun find-charset-region (start end) | |
53 "Return a list of leading-chars in the region between START and END. | |
54 \[emu-orig.el; Mule emulating function]" | |
55 (if (save-excursion | |
56 (save-restriction | |
57 (narrow-to-region start end) | |
58 (goto-char start) | |
59 (re-search-forward "[\200-\377]" nil t) | |
60 )) | |
61 (list lc-ltn1) | |
62 )) | |
63 | |
64 | |
65 ;;; @ coding-system | |
66 ;;; | |
67 | |
68 (defconst *internal* nil) | |
69 (defconst *ctext* nil) | |
70 (defconst *noconv* nil) | |
71 | |
72 (defun code-convert-string (str ic oc) | |
73 "Convert code in STRING from SOURCE code to TARGET code, | |
74 On successful converion, returns the result string, | |
75 else returns nil. [emu-orig.el; Mule emulating function]" | |
76 str) | |
77 | |
78 (defun code-convert-region (beg end ic oc) | |
79 "Convert code of the text between BEGIN and END from SOURCE | |
80 to TARGET. On successful conversion returns t, | |
81 else returns nil. [emu-orig.el; Mule emulating function]" | |
82 t) | |
83 | |
84 (defun code-detect-region (beg end) | |
85 "Detect coding-system of the text in the region between START and END. | |
86 \[emu-orig.el; Mule emulating function]" | |
87 ) | |
88 | |
89 (defun set-file-coding-system (coding-system &optional force) | |
90 ) | |
91 | |
92 | |
93 ;;; @ character and string | |
94 ;;; | |
95 | |
96 (defun char-bytes (chr) 1) | |
97 (defun char-width (chr) 1) | |
98 | |
99 (defalias 'string-width 'length) | |
100 | |
101 (defun string-to-char-list (str) | |
102 (mapcar (function identity) str) | |
103 ) | |
104 | |
105 (defun truncate-string (str width &optional start-column) | |
106 "Truncate STR to fit in WIDTH columns. | |
107 Optional non-nil arg START-COLUMN specifies the starting column. | |
108 \[emu-orig.el; Mule 2.3 emulating function]" | |
109 (or start-column | |
110 (setq start-column 0)) | |
111 (substring str start-column width) | |
112 ) | |
113 | |
114 | |
115 ;;; @ etc | |
116 ;;; | |
117 | |
118 (cond (running-xemacs | |
119 (require 'emu-xemacs)) | |
120 (running-emacs-19 | |
121 (require 'emu-19) | |
122 )) | |
123 | |
124 | |
125 ;;; @ end | |
126 ;;; | |
127 | |
128 (provide 'emu-orig) | |
129 | |
130 ;;; emu-orig.el ends here |