annotate lisp/mule/mule-coding.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents
children 54cc21c15cbb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1 ;;; mule-coding.el --- Coding-system functions for Mule.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3 ;; Copyright (C) 1992,93,94,95 Free Software Foundation, Inc.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995 Amdahl Corporation.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995 Sun Microsystems.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 ;; This file is part of XEmacs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9 ;; XEmacs is free software; you can redistribute it and/or modify it
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10 ;; under the terms of the GNU General Public License as published by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 ;; any later version.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14 ;; XEmacs is distributed in the hope that it will be useful, but
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 ;; General Public License for more details.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20 ;; along with XEmacs; see the file COPYING. If not, write to the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24 ;;; Commentary:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26 ;;; split off of mule.el.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28 ;;; Code:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30 (defun set-terminal-coding-system (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
31 "Set the coding system used for TTY display output."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 (interactive "zterminal-coding-system: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 (get-coding-system coding-system) ;; correctness check
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34 (setq terminal-coding-system coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35 (redraw-modeline t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37 (defun set-pathname-coding-system (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38 "Set the coding system used for file system path names."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
39 (interactive "zPathname-coding-system: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40 (get-coding-system coding-system) ;; correctness check
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41 (setq pathname-coding-system coding-system))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43 (defun what-coding-system (start end &optional arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44 "Show the encoding of text in the region.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45 With prefix arg, show all possible coding systems.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 This function is meant to be called interactively;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 from a Lisp program, use `detect-coding-region' instead."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 (interactive "r\nP")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49 (let ((codings (detect-coding-region start end)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50 (message "%s" (if (or arg (symbolp codings)) codings (car codings)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 (defmacro with-string-as-buffer-contents (str &rest body)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53 "With the contents of the current buffer being STR, run BODY.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 Returns the new contents of the buffer, as modified by BODY.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 The original current buffer is restored afterwards."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
56 `(let ((curbuf (current-buffer))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
57 (tempbuf (get-buffer-create " *string-as-buffer-contents*")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
58 (unwind-protect
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60 (set-buffer tempbuf)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 (buffer-disable-undo (current-buffer))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62 (erase-buffer)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
63 (insert ,str)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 ,@body
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 (buffer-string))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 (erase-buffer tempbuf)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 (set-buffer curbuf))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
69 (defun decode-coding-string (str coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70 "Decode the string STR which is encoded in CODING-SYSTEM.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 Does not modify STR. Returns the decoded string on successful conversion."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72 (with-string-as-buffer-contents
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 str (decode-coding-region (point-min) (point-max) coding-system)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 (defun encode-coding-string (str coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76 "Encode the string STR using CODING-SYSTEM.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77 Does not modify STR. Returns the encoded string on successful conversion."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78 (with-string-as-buffer-contents
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 str (encode-coding-region (point-min) (point-max) coding-system)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
81
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
82 ;;;; Coding system accessors
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
83
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
84 (defun coding-system-mnemonic (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
85 "Return the 'mnemonic property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
86 (coding-system-property coding-system 'mnemonic))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
87
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88 (defun coding-system-eol-type (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
89 "Return the 'eol-type property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
90 (coding-system-property coding-system 'eol-type))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
91
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
92 (defun coding-system-eol-lf (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
93 "Return the 'eol-lf property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
94 (coding-system-property coding-system 'eol-lf))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
95
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
96 (defun coding-system-eol-crlf (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
97 "Return the 'eol-crlf property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
98 (coding-system-property coding-system 'eol-crlf))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
99
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
100 (defun coding-system-eol-cr (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
101 "Return the 'eol-cr property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
102 (coding-system-property coding-system 'eol-cr))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
103
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
104 (defun coding-system-post-read-conversion (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
105 "Return the 'post-read-conversion property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
106 (coding-system-property coding-system 'post-read-conversion))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
107
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
108 (defun coding-system-pre-write-conversion (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
109 "Return the 'pre-write-conversion property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
110 (coding-system-property coding-system 'pre-write-conversion))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
111
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
112 (defun coding-system-charset (coding-system register)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
113 "Return the 'charset property of CODING-SYSTEM for the specified REGISTER."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
114 (cond ((not (integerp register))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
115 (signal 'wrong-type-argument (list 'integerp register)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
116 ((= register 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
117 (coding-system-property coding-system 'charset-g0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
118 ((= register 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
119 (coding-system-property coding-system 'charset-g1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
120 ((= register 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
121 (coding-system-property coding-system 'charset-g2))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
122 ((= register 3)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
123 (coding-system-property coding-system 'charset-g3))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
124 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
125 (signal 'args-out-of-range (list register 0 3)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
126
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
127 (defun coding-system-force-on-output (coding-system register)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
128 "Return the 'force-on-output property of CODING-SYSTEM for the specified REGISTER."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
129 (cond ((not (integerp register))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
130 (signal 'wrong-type-argument (list 'integerp register)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
131 ((= register 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
132 (coding-system-property coding-system 'force-g0-on-output))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
133 ((= register 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
134 (coding-system-property coding-system 'force-g1-on-output))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
135 ((= register 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
136 (coding-system-property coding-system 'force-g2-on-output))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
137 ((= register 3)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
138 (coding-system-property coding-system 'force-g3-on-output))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
139 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
140 (signal 'args-out-of-range (list register 0 3)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
141
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
142 (defun coding-system-short (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
143 "Return the 'short property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
144 (coding-system-property coding-system 'short))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
145
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
146 (defun coding-system-no-ascii-eol (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
147 "Return the 'no-ascii-eol property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
148 (coding-system-property coding-system 'no-ascii-eol))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
149
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
150 (defun coding-system-no-ascii-cntl (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
151 "Return the 'no-ascii-cntl property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
152 (coding-system-property coding-system 'no-ascii-cntl))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
153
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
154 (defun coding-system-seven (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
155 "Return the 'seven property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
156 (coding-system-property coding-system 'seven))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
157
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
158 (defun coding-system-lock-shift (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
159 "Return the 'lock-shift property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
160 (coding-system-property coding-system 'lock-shift))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
161
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
162 (defun coding-system-use-japanese-jisx0201-roman (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
163 "Return the 'use-japanese-jisx0201-roman property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
164 (coding-system-property coding-system 'use-japanese-jisx0201-roman))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
165
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
166 (defun coding-system-use-japanese-jisx0208-1978 (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
167 "Return the 'use-japanese-jisx0208-1978 property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
168 (coding-system-property coding-system 'use-japanese-jisx0208-2978))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
169
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
170 (defun coding-system-no-iso6429 (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
171 "Return the 'no-iso6429 property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
172 (coding-system-property coding-system 'no-iso6429))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
173
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
174 (defun coding-system-ccl-encode (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
175 "Return the CCL 'encode property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
176 (coding-system-property coding-system 'encode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
177
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
178 (defun coding-system-ccl-decode (coding-system)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
179 "Return the CCL 'decode property of CODING-SYSTEM."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
180 (coding-system-property coding-system 'decode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
181
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
182
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
183 ;;;; Definitions of predefined coding systems
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
184
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
185 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
186 'autodetect 'autodetect
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
187 "Automatic conversion."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
188 '(mnemonic "Auto"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
189
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
190 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
191 'ctext 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
192 "Coding-system used in X as Compound Text Encoding."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
193 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
194 charset-g1 latin-1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
195 eol-type lf
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
196 mnemonic "CText"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
197 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
198
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
199 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
200 'iso-2022-ss2-8 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
201 "ISO-2022 coding system using SS2 for 96-charset in 8-bit code."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
202 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
203 charset-g1 latin-1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
204 charset-g2 t ;; unspecified but can be used later.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
205 short t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
206 mnemonic "ISO8/SS"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
207 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
208
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
209 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
210 'iso-2022-ss2-7 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
211 "ISO-2022 coding system using SS2 for 96-charset in 7-bit code."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
212 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
213 charset-g2 t ;; unspecified but can be used later.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
214 seven t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
215 short t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
216 mnemonic "ISO7/SS"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
217 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
218
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
219 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
220 'iso-2022-7 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
221 "ISO-2022 seven-bit coding system. No single-shift or locking-shift."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
222 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
223 seven t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
224 short t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
225 mnemonic "ISO7"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
226 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
227
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
228 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
229 'iso-2022-8 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
230 "ISO-2022 eight-bit coding system. No single-shift or locking-shift."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
231 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
232 charset-g1 latin-1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
233 short t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
234 mnemonic "ISO8"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
235 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
236
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
237 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
238 'escape-quoted 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
239 "ISO-2022 eight-bit coding system with escape quoting; used for .ELC files."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
240 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
241 charset-g1 latin-1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
242 eol-type lf
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
243 escape-quoted t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
244 mnemonic "ESC/Quot"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
245 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
246
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
247 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
248 'iso-2022-lock 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
249 "ISO-2022 coding system using Locking-Shift for 96-charset."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
250 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
251 charset-g1 t ;; unspecified but can be used later.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
252 seven t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
253 lock-shift t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
254 mnemonic "ISO7/Lock"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
255 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
256
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
257 ;; initialize the coding categories to something semi-reasonable
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
258 ;; so that the remaining Lisp files can contain extended characters.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
259 ;; (They will be in ISO-7 format)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
260
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
261 (set-coding-priority-list '(iso-8-2 shift-jis iso-8-designate iso-8-1 big5
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
262 iso-7 iso-lock-shift no-conversion))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
263
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
264 (set-coding-category-system 'iso-7 'iso-2022-7)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
265 (set-coding-category-system 'iso-8-designate 'ctext)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
266 (set-coding-category-system 'iso-8-1 'ctext)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
267 (set-coding-category-system 'iso-lock-shift 'iso-2022-lock)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
268 (set-coding-category-system 'no-conversion 'no-conversion)