annotate lisp/coding.el @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 7347b34c275b
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
1 ;;; coding.el --- Coding-system functions for XEmacs.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
2
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
4 ;; Licensed to the Free Software Foundation.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995 Amdahl Corporation.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
6 ;; Copyright (C) 1995 Sun Microsystems.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
7 ;; Copyright (C) 1997 MORIOKA Tomohiko
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
8
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
10
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
11 ;; This file is very similar to mule-coding.el
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
12
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
16 ;; any later version.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
17
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
21 ;; General Public License for more details.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
22
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
26 ;; Boston, MA 02111-1307, USA.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
27
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
28 ;;; Commentary:
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
29
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
30 ;;; split off of mule.el.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
31
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
32 ;;; Code:
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
33
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
34 (defalias 'check-coding-system 'get-coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
35
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
36 (defconst modeline-multibyte-status '("%C")
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
37 "Modeline control for showing multibyte extension status.")
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
38
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
39 ;; override the default value defined in loaddefs.el.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
40 (setq-default modeline-format
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
41 (cons (purecopy "")
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
42 (cons 'modeline-multibyte-status
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
43 (cdr modeline-format))))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
44
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
45 (defun modify-coding-system-alist (target-type regexp coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
46 "Modify one of look up tables for finding a coding system on I/O operation.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
47 There are three of such tables, `file-coding-system-alist',
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
48 `process-coding-system-alist', and `network-coding-system-alist'.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
49
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
50 TARGET-TYPE specifies which of them to modify.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
51 If it is `file', it affects `file-coding-system-alist' (which see).
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
52 If it is `process', it affects `process-coding-system-alist' (which see).
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
53 If it is `network', it affects `network-codign-system-alist' (which see).
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
54
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
55 REGEXP is a regular expression matching a target of I/O operation.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
56 The target is a file name if TARGET-TYPE is `file', a program name if
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
57 TARGET-TYPE is `process', or a network service name or a port number
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
58 to connect to if TARGET-TYPE is `network'.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
59
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
60 CODING-SYSTEM is a coding system to perform code conversion on the I/O
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
61 operation, or a cons cell (DECODING . ENCODING) specifying the coding systems
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
62 for decoding and encoding respectively,
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
63 or a function symbol which, when called, returns such a cons cell."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
64 (or (memq target-type '(file process network))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
65 (error "Invalid target type: %s" target-type))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
66 (or (stringp regexp)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
67 (and (eq target-type 'network) (integerp regexp))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
68 (error "Invalid regular expression: %s" regexp))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
69 (if (symbolp coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
70 (if (not (fboundp coding-system))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
71 (progn
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
72 (check-coding-system coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
73 (setq coding-system (cons coding-system coding-system))))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
74 (check-coding-system (car coding-system))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
75 (check-coding-system (cdr coding-system)))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
76 (cond ((eq target-type 'file)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
77 (let ((slot (assoc regexp file-coding-system-alist)))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
78 (if slot
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
79 (setcdr slot coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
80 (setq file-coding-system-alist
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
81 (cons (cons regexp coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
82 file-coding-system-alist)))))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
83 ((eq target-type 'process)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
84 (let ((slot (assoc regexp process-coding-system-alist)))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
85 (if slot
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
86 (setcdr slot coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
87 (setq process-coding-system-alist
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
88 (cons (cons regexp coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
89 process-coding-system-alist)))))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
90 (t
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
91 (let ((slot (assoc regexp network-coding-system-alist)))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
92 (if slot
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
93 (setcdr slot coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
94 (setq network-coding-system-alist
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
95 (cons (cons regexp coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
96 network-coding-system-alist)))))))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
97
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
98 (defsubst keyboard-coding-system ()
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
99 "Return coding-system of what is sent from terminal keyboard."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
100 keyboard-coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
101
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
102 (defun set-keyboard-coding-system (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
103 "Set the coding system used for TTY keyboard input. Currently broken."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
104 (interactive "zkeyboard-coding-system: ")
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
105 (get-coding-system coding-system) ; correctness check
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
106 (setq keyboard-coding-system coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
107 (redraw-modeline t))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
108
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
109 (defsubst terminal-coding-system ()
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
110 "Return coding-system of your terminal."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
111 terminal-coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
112
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
113 (defun set-terminal-coding-system (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
114 "Set the coding system used for TTY display output. Currently broken."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
115 (interactive "zterminal-coding-system: ")
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
116 (get-coding-system coding-system) ; correctness check
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
117 (setq terminal-coding-system coding-system)
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 361
diff changeset
118 (set-console-tty-coding-system (device-console) terminal-coding-system)
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
119 (redraw-modeline t))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
120
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
121 (defun set-pathname-coding-system (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
122 "Set the coding system used for file system path names."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
123 (interactive "zPathname-coding-system: ")
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
124 (get-coding-system coding-system) ; correctness check
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
125 (setq file-name-coding-system coding-system))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
126
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
127 (defun what-coding-system (start end &optional arg)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
128 "Show the encoding of text in the region.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
129 This function is meant to be called interactively;
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
130 from a Lisp program, use `detect-coding-region' instead."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
131 (interactive "r\nP")
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
132 (princ (detect-coding-region start end)))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
133
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
134 (defun decode-coding-string (str coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
135 "Decode the string STR which is encoded in CODING-SYSTEM.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
136 Does not modify STR. Returns the decoded string on successful conversion."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
137 (with-string-as-buffer-contents
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
138 str (decode-coding-region (point-min) (point-max) coding-system)))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
139
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
140 (defun encode-coding-string (str coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
141 "Encode the string STR using CODING-SYSTEM.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
142 Does not modify STR. Returns the encoded string on successful conversion."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
143 (with-string-as-buffer-contents
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
144 str (encode-coding-region (point-min) (point-max) coding-system)))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
145
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
146
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
147 ;;;; Coding system accessors
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
148
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
149 (defun coding-system-mnemonic (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
150 "Return the 'mnemonic property of CODING-SYSTEM."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
151 (coding-system-property coding-system 'mnemonic))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
152
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
153 (defalias 'coding-system-docstring 'coding-system-doc-string)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
154
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
155 (defun coding-system-eol-type (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
156 "Return the 'eol-type property of CODING-SYSTEM."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
157 (coding-system-property coding-system 'eol-type))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
158
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
159 (defun coding-system-eol-lf (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
160 "Return the 'eol-lf property of CODING-SYSTEM."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
161 (coding-system-property coding-system 'eol-lf))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
162
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
163 (defun coding-system-eol-crlf (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
164 "Return the 'eol-crlf property of CODING-SYSTEM."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
165 (coding-system-property coding-system 'eol-crlf))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
166
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
167 (defun coding-system-eol-cr (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
168 "Return the 'eol-cr property of CODING-SYSTEM."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
169 (coding-system-property coding-system 'eol-cr))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
170
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
171 (defun coding-system-post-read-conversion (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
172 "Return the 'post-read-conversion property of CODING-SYSTEM."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
173 (coding-system-property coding-system 'post-read-conversion))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
174
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
175 (defun coding-system-pre-write-conversion (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
176 "Return the 'pre-write-conversion property of CODING-SYSTEM."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
177 (coding-system-property coding-system 'pre-write-conversion))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
178
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
179 (defun coding-system-base (coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
180 "Return the base coding system of CODING-SYSTEM."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
181 (if (not (coding-system-eol-type coding-system))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
182 coding-system
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
183 (find-coding-system
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
184 (intern
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
185 (substring
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
186 (symbol-name (coding-system-name coding-system))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
187 0
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
188 (string-match "-unix$\\|-dos$\\|-mac$"
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
189 (symbol-name (coding-system-name coding-system))))))))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
190
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
191 ;;;; Definitions of predefined coding systems
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
192
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
193 (make-coding-system
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
194 'undecided 'undecided
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
195 "Automatic conversion."
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
196 '(mnemonic "Auto"))
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
197
261
405dd6d1825b Import from CVS: tag r20-5b29
cvs
parents: 259
diff changeset
198 ;; these are so that gnus and friends work when not mule
405dd6d1825b Import from CVS: tag r20-5b29
cvs
parents: 259
diff changeset
199 (or (featurep 'mule)
405dd6d1825b Import from CVS: tag r20-5b29
cvs
parents: 259
diff changeset
200 (progn
405dd6d1825b Import from CVS: tag r20-5b29
cvs
parents: 259
diff changeset
201 (copy-coding-system 'undecided 'iso-8859-1)
405dd6d1825b Import from CVS: tag r20-5b29
cvs
parents: 259
diff changeset
202 (copy-coding-system 'undecided 'iso-8859-2)))
405dd6d1825b Import from CVS: tag r20-5b29
cvs
parents: 259
diff changeset
203
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
204 ;; compatibility for old XEmacsen (don't use it)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
205 (copy-coding-system 'undecided 'automatic-conversion)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
206
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
207 (copy-coding-system 'no-conversion 'raw-text)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
208
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
209 (make-compatible-variable 'enable-multibyte-characters "Unimplemented")
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
210
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
211 (define-obsolete-variable-alias
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
212 'pathname-coding-system 'file-name-coding-system)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
213
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
214 ;;; mule-coding.el ends here