1 ;;; mule-coding.el --- Coding-system functions for Mule.
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 1995 Amdahl Corporation.
6 ;; Copyright (C) 1995 Sun Microsystems.
7 ;; Copyright (C) 1997 MORIOKA Tomohiko
9 ;; This file is part of SXEmacs.
11 ;; SXEmacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; SXEmacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
26 ;;; split off of mule.el and mostly moved to coding.el
30 (defun coding-system-force-on-output (coding-system register)
31 "Return the 'force-on-output property of CODING-SYSTEM for the specified REGISTER."
32 (check-type register integer)
33 (coding-system-property
36 (0 'force-g0-on-output)
37 (1 'force-g1-on-output)
38 (2 'force-g2-on-output)
39 (3 'force-g3-on-output)
40 (t (signal 'args-out-of-range (list register 0 3))))))
42 (defun coding-system-short (coding-system)
43 "Return the 'short property of CODING-SYSTEM."
44 (coding-system-property coding-system 'short))
46 (defun coding-system-no-ascii-eol (coding-system)
47 "Return the 'no-ascii-eol property of CODING-SYSTEM."
48 (coding-system-property coding-system 'no-ascii-eol))
50 (defun coding-system-no-ascii-cntl (coding-system)
51 "Return the 'no-ascii-cntl property of CODING-SYSTEM."
52 (coding-system-property coding-system 'no-ascii-cntl))
54 (defun coding-system-seven (coding-system)
55 "Return the 'seven property of CODING-SYSTEM."
56 (coding-system-property coding-system 'seven))
58 (defun coding-system-lock-shift (coding-system)
59 "Return the 'lock-shift property of CODING-SYSTEM."
60 (coding-system-property coding-system 'lock-shift))
62 ;;(defun coding-system-use-japanese-jisx0201-roman (coding-system)
63 ;; "Return the 'use-japanese-jisx0201-roman property of CODING-SYSTEM."
64 ;; (coding-system-property coding-system 'use-japanese-jisx0201-roman))
66 ;;(defun coding-system-use-japanese-jisx0208-1978 (coding-system)
67 ;; "Return the 'use-japanese-jisx0208-1978 property of CODING-SYSTEM."
68 ;; (coding-system-property coding-system 'use-japanese-jisx0208-2978))
70 (defun coding-system-no-iso6429 (coding-system)
71 "Return the 'no-iso6429 property of CODING-SYSTEM."
72 (coding-system-property coding-system 'no-iso6429))
74 (defun coding-system-ccl-encode (coding-system)
75 "Return the CCL 'encode property of CODING-SYSTEM."
76 (coding-system-property coding-system 'encode))
78 (defun coding-system-ccl-decode (coding-system)
79 "Return the CCL 'decode property of CODING-SYSTEM."
80 (coding-system-property coding-system 'decode))
83 ;;;; Definitions of predefined coding systems
87 "Coding-system used in X as Compound Text Encoding."
89 charset-g1 latin-iso8859-1
93 ;;; iso-8859-1 and ctext are aliases.
95 ;; (copy-coding-system 'ctext 'iso-8859-1)
97 'iso-8859-1 'no-conversion
98 "Coding-system used in X as Compound Text Encoding."
99 '(eol-type nil mnemonic "Noconv"))
102 'iso-2022-8bit-ss2 'iso2022
103 "ISO-2022 coding system using SS2 for 96-charset in 8-bit code."
105 charset-g1 latin-iso8859-1
106 charset-g2 t ;; unspecified but can be used later.
112 'iso-2022-7bit-ss2 'iso2022
113 "ISO-2022 coding system using SS2 for 96-charset in 7-bit code."
115 charset-g2 t ;; unspecified but can be used later.
121 ;; (copy-coding-system 'iso-2022-7bit-ss2 'iso-2022-jp-2)
123 'iso-2022-jp-2 'iso2022
124 "ISO-2022 coding system using SS2 for 96-charset in 7-bit code."
126 charset-g2 t ;; unspecified but can be used later.
133 'iso-2022-7bit 'iso2022
134 "ISO 2022 based 7-bit encoding using only G0"
140 ;; compatibility for old XEmacsen
141 (copy-coding-system 'iso-2022-7bit 'iso-2022-7)
145 "ISO-2022 eight-bit coding system. No single-shift or locking-shift."
147 charset-g1 latin-iso8859-1
153 'escape-quoted 'iso2022
154 "ISO-2022 eight-bit coding system with escape quoting; used for .ELC files."
156 charset-g1 latin-iso8859-1
161 ;; compatibility for new Emacsen (don't use it)
162 (copy-coding-system 'escape-quoted 'emacs-internal)
165 'iso-2022-lock 'iso2022
166 "ISO-2022 coding system using Locking-Shift for 96-charset."
168 charset-g1 t ;; unspecified but can be used later.
174 ;; initialize the coding categories to something semi-reasonable
175 ;; so that the remaining Lisp files can contain extended characters.
176 ;; (They will be in ISO-7 format)
177 ;; #### This list needs to be synched with the ones in mule-cmds.el.
179 (set-coding-priority-list '(iso-7
191 (set-coding-category-system 'iso-7 'iso-2022-7)
192 (set-coding-category-system 'iso-8-designate 'ctext)
193 (set-coding-category-system 'iso-8-1 'ctext)
194 (set-coding-category-system 'iso-lock-shift 'iso-2022-lock)
195 (set-coding-category-system 'no-conversion 'no-conversion)
197 (setq-default buffer-file-coding-system 'iso-2022-8)
199 ;;; mule-coding.el ends here