annotate lisp/tl/emu-e19.el @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents c0c698873ce1
children 4be1180a9e89
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
1 ;;; emu-e19.el --- emu module for Emacs 19 and XEmacs 19
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995,1996 Free Software Foundation, Inc.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
4
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
6 ;; Version: $Id: emu-e19.el,v 1.2 1996/12/28 21:03:08 steve Exp $
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
7 ;; Keywords: emulation, compatibility, mule, Latin-1
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
8
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
9 ;; This file is part of emu.
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
10
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
11 ;; This program is free software; you can redistribute it and/or
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
12 ;; modify it under the terms of the GNU General Public License as
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
13 ;; published by the Free Software Foundation; either version 2, or (at
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
14 ;; your option) any later version.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
15
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
16 ;; This program is distributed in the hope that it will be useful, but
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
19 ;; General Public License for more details.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
20
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
25
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
26 ;;; Code:
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
27
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
28 ;;; @ version and variant specific features
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
29 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
30
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
31 (cond (running-xemacs
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
32 (require 'emu-xemacs))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
33 (running-emacs-19
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
34 (require 'emu-19)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
35 ))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
36
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
37
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
38 ;;; @ character set
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
39 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
40
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
41 (defconst charset-ascii 0 "Character set of ASCII")
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
42 (defconst charset-latin-iso8859-1 129 "Character set of ISO-8859-1")
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
43
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
44 (defun charset-description (charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
45 "Return description of CHARSET. [emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
46 (if (< charset 128)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
47 (documentation-property 'charset-ascii 'variable-documentation)
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
48 (documentation-property 'charset-latin-iso8859-1 'variable-documentation)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
49 ))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
50
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
51 (defun charset-registry (charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
52 "Return registry name of CHARSET. [emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
53 (if (< charset 128)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
54 "ASCII"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
55 "ISO8859-1"))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
56
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
57 (defun charset-columns (charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
58 "Return number of columns a CHARSET occupies when displayed.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
59 \[emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
60 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
61
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
62 (defun charset-direction (charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
63 "Return the direction of a character of CHARSET by
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
64 0 (left-to-right) or 1 (right-to-left). [emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
65 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
66
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
67 (defun find-charset-string (str)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
68 "Return a list of charsets in the string.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
69 \[emu-e19.el; Mule emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
70 (if (string-match "[\200-\377]" str)
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
71 (list charset-latin-iso8859-1)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
72 ))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
73
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
74 (defalias 'find-non-ascii-charset-string 'find-charset-string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
75
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
76 (defun find-charset-region (start end)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
77 "Return a list of charsets in the region between START and END.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
78 \[emu-e19.el; Mule emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
79 (if (save-excursion
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
80 (save-restriction
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
81 (narrow-to-region start end)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
82 (goto-char start)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
83 (re-search-forward "[\200-\377]" nil t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
84 ))
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
85 (list charset-latin-iso8859-1)
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
86 ))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
87
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
88 (defalias 'find-non-ascii-charset-region 'find-charset-region)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
89
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
90
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
91 ;;; @ coding-system
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
92 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
93
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
94 (defconst *internal* nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
95 (defconst *ctext* nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
96 (defconst *noconv* nil)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
97
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
98 (defun decode-coding-string (string coding-system)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
99 "Decode the STRING which is encoded in CODING-SYSTEM.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
100 \[emu-e19.el; Emacs 20 emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
101 string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
102
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
103 (defun encode-coding-string (string coding-system)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
104 "Encode the STRING as CODING-SYSTEM.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
105 \[emu-e19.el; Emacs 20 emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
106 string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
107
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
108 (defun decode-coding-region (start end coding-system)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
109 "Decode the text between START and END which is encoded in CODING-SYSTEM.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
110 \[emu-e19.el; Emacs 20 emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
111 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
112
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
113 (defun encode-coding-region (start end coding-system)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
114 "Encode the text between START and END to CODING-SYSTEM.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
115 \[emu-e19.el; Emacs 20 emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
116 0)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
117
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
118 (defun detect-coding-region (start end)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
119 "Detect coding-system of the text in the region between START and END.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
120 \[emu-e19.el; Emacs 20 emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
121 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
122
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
123 (defun set-buffer-file-coding-system (coding-system &optional force)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
124 "Set buffer-file-coding-system of the current buffer to CODING-SYSTEM.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
125 \[emu-e19.el; Emacs 20 emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
126 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
127
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
128 (defmacro as-binary-process (&rest body)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
129 (` (let (selective-display) ; Disable ^M to nl translation.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
130 (,@ body)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
131 )))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
132
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
133 (defmacro as-binary-input-file (&rest body)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
134 (` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
135 (,@ body)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
136 )))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
137
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
138
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
139 ;;; @@ for old MULE emulation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
140 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
141
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
142 (defun code-convert-string (str ic oc)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
143 "Convert code in STRING from SOURCE code to TARGET code,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
144 On successful converion, returns the result string,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
145 else returns nil. [emu-e19.el; old MULE emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
146 str)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
147
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
148 (defun code-convert-region (beg end ic oc)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
149 "Convert code of the text between BEGIN and END from SOURCE
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
150 to TARGET. On successful conversion returns t,
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
151 else returns nil. [emu-e19.el; old MULE emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
152 t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
153
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
154
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
155 ;;; @ MIME charset
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
156 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
157
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
158 (defvar charsets-mime-charset-alist
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
159 (list (cons (list charset-ascii) 'us-ascii)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
160
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
161 (defvar default-mime-charset 'iso-8859-1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
162
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
163 (defun mime-charset-to-coding-system (charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
164 (if (stringp charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
165 (setq charset (intern (downcase charset)))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
166 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
167 (and (memq charset (list 'us-ascii default-mime-charset))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
168 charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
169 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
170
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
171 (defun detect-mime-charset-region (start end)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
172 "Return MIME charset for region between START and END.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
173 \[emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
174 (if (save-excursion
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
175 (save-restriction
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
176 (narrow-to-region start end)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
177 (goto-char start)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
178 (re-search-forward "[\200-\377]" nil t)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
179 ))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
180 default-mime-charset
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
181 'us-ascii))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
182
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
183 (defun encode-mime-charset-region (start end charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
184 "Encode the text between START and END as MIME CHARSET.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
185 \[emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
186 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
187
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
188 (defun decode-mime-charset-region (start end charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
189 "Decode the text between START and END as MIME CHARSET.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
190 \[emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
191 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
192
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
193 (defun encode-mime-charset-string (string charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
194 "Encode the STRING as MIME CHARSET. [emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
195 string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
196
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
197 (defun decode-mime-charset-string (string charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
198 "Decode the STRING as MIME CHARSET. [emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
199 string)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
200
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
201
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
202 ;;; @ character
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
203 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
204
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
205 (defun char-charset (chr)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
206 "Return the character set of char CHR.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
207 \[emu-e19.el; XEmacs 20 emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
208 (if (< chr 128)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
209 charset-ascii
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 72
diff changeset
210 charset-latin-iso8859-1))
72
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
211
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
212 (defun char-bytes (char)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
213 "Return number of bytes a character in CHAR occupies in a buffer.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
214 \[emu-e19.el; MULE emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
215 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
216
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
217 (defalias 'char-length 'char-bytes)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
218
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
219 (defun char-columns (character)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
220 "Return number of columns a CHARACTER occupies when displayed.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
221 \[emu-e19.el]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
222 1)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
223
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
224 ;;; @@ for old MULE emulation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
225 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
226
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
227 (defalias 'char-width 'char-columns)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
228
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
229 (defalias 'char-leading-char 'char-charset)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
230
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
231
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
232 ;;; @ string
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
233 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
234
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
235 (defalias 'string-columns 'length)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
236
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
237 (defun string-to-char-list (str)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
238 (mapcar (function identity) str)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
239 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
240
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
241 (defalias 'string-to-int-list 'string-to-char-list)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
242
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
243 (defalias 'sref 'aref)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
244
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
245 (defun truncate-string (str width &optional start-column)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
246 "Truncate STR to fit in WIDTH columns.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
247 Optional non-nil arg START-COLUMN specifies the starting column.
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
248 \[emu-e19.el; MULE 2.3 emulating function]"
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
249 (or start-column
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
250 (setq start-column 0))
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
251 (substring str start-column width)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
252 )
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
253
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
254 ;;; @@ for old MULE emulation
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
255 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
256
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
257 (defalias 'string-width 'length)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
258
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
259
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
260 ;;; @ end
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
261 ;;;
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
262
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
263 (provide 'emu-e19)
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
264
b9518feda344 Import from CVS: tag r20-0b31
cvs
parents:
diff changeset
265 ;;; emu-e19.el ends here