Mercurial > emacs
annotate lisp/international/codepage.el @ 89762:e061826245f3
New file (automatically generated by admin/charset/Makefile).
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 27 Jan 2004 08:40:02 +0000 |
parents | 2f877ed80fa6 |
children | 68c22ea6027c |
rev | line source |
---|---|
38412
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
36579
diff
changeset
|
1 ;;; codepage.el --- MS-DOS/MS-Windows specific coding systems |
23915 | 2 |
3 ;; Copyright (C) 1998 Free Software Foundation, Inc. | |
4 | |
5 ;; Author: Eli Zaretskii | |
6 ;; Maintainer: FSF | |
88563 | 7 ;; Keywords: i18n ms-dos ms-windows codepage obsolete |
23915 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs 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 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs 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. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
29922
9473e3466947
(cp-coding-system-for-codepage-1): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents:
29721
diff
changeset
|
28 ;; Special coding systems for DOS/Windows codepage support. |
88563 | 29 ;; Obsolete. |
23915 | 30 |
31 ;;; Code: | |
32 | |
88563 | 33 ;; I doubt we need compatibility versions of any of these autoloaded |
34 ;; functions apart from codepage-setup, which users may call. | |
23915 | 35 |
88563 | 36 ;; ;;;###autoload |
37 ;; (defun cp-make-coding-systems-for-codepage (codepage iso-name offset) | |
38 ;; "Create a coding system to convert IBM CODEPAGE into charset ISO-NAME | |
39 ;; whose first character is at offset OFFSET from the beginning of 8-bit | |
40 ;; ASCII table. | |
23915 | 41 |
88563 | 42 ;; The created coding system has the usual 3 subsidiary systems: for Unix-, |
43 ;; DOS- and Mac-style EOL conversion. However, unlike built-in coding | |
44 ;; systems, the Mac-style EOL conversion is currently not supported by the | |
45 ;; decoder and encoder created by this function." | |
46 ;; (let* ((decode-table (intern (format "%s-decode-table" codepage))) | |
47 ;; (nonascii-table | |
48 ;; (intern (format "%s-nonascii-translation-table" codepage))) | |
49 ;; (decode-translation | |
50 ;; (intern (format "%s-decode-translation-table" codepage))) | |
51 ;; (encode-translation | |
52 ;; (intern (format "%s-encode-translation-table" codepage)))) | |
53 ;; (set nonascii-table | |
54 ;; (make-translation-table-from-vector | |
55 ;; (cp-decoding-vector-for-codepage | |
56 ;; (symbol-value decode-table) iso-name offset))) | |
57 ;; (define-translation-table encode-translation | |
58 ;; (char-table-extra-slot (symbol-value nonascii-table) 0)) | |
59 ;; ;; For charsets other than ascii, eight-bit-* and ISO-NAME, set | |
60 ;; ;; `?' for one-column charsets, and some Japanese character for | |
61 ;; ;; wide-column charsets. CCL encoder convert that Japanese | |
62 ;; ;; character to either dos-unsupported-char-glyph or "??". | |
63 ;; (let ((tbl (char-table-extra-slot (symbol-value nonascii-table) 0)) | |
64 ;; (undef (if (eq system-type 'ms-dos) | |
65 ;; (if dos-unsupported-char-glyph | |
66 ;; (logand dos-unsupported-char-glyph 255) | |
67 ;; 127) | |
68 ;; ??)) | |
69 ;; (charsets (delq 'ascii | |
70 ;; (delq 'eight-bit-control | |
71 ;; (delq 'eight-bit-graphic | |
72 ;; (delq iso-name | |
73 ;; (copy-sequence charset-list)))))) | |
74 ;; (wide-column-char (make-char 'japanese-jisx0208 32 32))) | |
75 ;; (while charsets | |
76 ;; (aset tbl (make-char (car charsets)) | |
77 ;; (if (= (charset-width (car charsets)) 1) undef wide-column-char)) | |
78 ;; (setq charsets (cdr charsets)))) | |
79 ;; (define-translation-table decode-translation | |
80 ;; (symbol-value nonascii-table)) | |
81 ;; (cp-coding-system-for-codepage-1 | |
82 ;; (intern codepage) ?D iso-name decode-translation encode-translation) | |
83 ;; )) | |
23915 | 84 |
88563 | 85 ;; ;;;###autoload |
86 ;; (defun cp-charset-for-codepage (codepage) | |
87 ;; "Return the charset for which there is a translation table to DOS CODEPAGE. | |
88 ;; CODEPAGE must be the name of a DOS codepage, a string." | |
89 ;; (let ((cp-decoder (cp-codepage-decoder codepage))) | |
90 ;; (if (null cp-decoder) | |
91 ;; (error "Unsupported codepage %s" codepage) | |
92 ;; (get cp-decoder 'charset)))) | |
36579 | 93 |
88563 | 94 ;; ;;;###autoload |
95 ;; (defun cp-language-for-codepage (codepage) | |
96 ;; "Return the name of the MULE language environment for CODEPAGE. | |
97 ;; CODEPAGE must be the name of a DOS codepage, a string." | |
98 ;; (let ((cp-decoder (cp-codepage-decoder codepage))) | |
99 ;; (if (null cp-decoder) | |
100 ;; (error "Unsupported codepage %s" codepage) | |
101 ;; (get cp-decoder 'language)))) | |
23915 | 102 |
88563 | 103 ;; ;;;###autoload |
104 ;; (defun cp-offset-for-codepage (codepage) | |
105 ;; "Return the offset to be used in setting up coding systems for CODEPAGE. | |
106 ;; CODEPAGE must be the name of a DOS codepage, a string." | |
107 ;; (let ((cp-decoder (cp-codepage-decoder codepage))) | |
108 ;; (if (null cp-decoder) | |
109 ;; (error "Unsupported codepage %s" codepage) | |
110 ;; (get cp-decoder 'offset)))) | |
24454
fe0089dd2d2f
(cp1250-decode-table, cp1251-decode-table, cp1253-decode-table,
Eli Zaretskii <eliz@gnu.org>
parents:
24371
diff
changeset
|
111 |
88563 | 112 ;; ;;;###autoload |
113 ;; (defun cp-supported-codepages () | |
114 ;; "Return an alist of supported codepages. | |
24454
fe0089dd2d2f
(cp1250-decode-table, cp1251-decode-table, cp1253-decode-table,
Eli Zaretskii <eliz@gnu.org>
parents:
24371
diff
changeset
|
115 |
88563 | 116 ;; Each association in the alist has the form (NNN . CHARSET), where NNN is the |
117 ;; codepage number, and CHARSET is the MULE charset which is the closest match | |
118 ;; for the character set supported by that codepage. | |
24454
fe0089dd2d2f
(cp1250-decode-table, cp1251-decode-table, cp1253-decode-table,
Eli Zaretskii <eliz@gnu.org>
parents:
24371
diff
changeset
|
119 |
88563 | 120 ;; A codepage NNN is supported if a variable called `cpNNN-decode-table' exists, |
121 ;; is a vector, and has a charset property." | |
122 ;; (save-match-data | |
123 ;; (let (alist chset sname) | |
124 ;; (mapatoms | |
125 ;; (function | |
126 ;; (lambda (sym) | |
127 ;; (if (and (boundp sym) | |
128 ;; (string-match "\\`cp\\([1-9][0-9][0-9][0-9]?\\)-decode-table\\'" | |
129 ;; (setq sname (symbol-name sym))) | |
130 ;; (vectorp (symbol-value sym)) | |
131 ;; (setq chset (get sym 'charset))) | |
132 ;; (setq alist | |
133 ;; (cons (cons (match-string 1 sname) chset) alist)))))) | |
134 ;; alist))) | |
24454
fe0089dd2d2f
(cp1250-decode-table, cp1251-decode-table, cp1253-decode-table,
Eli Zaretskii <eliz@gnu.org>
parents:
24371
diff
changeset
|
135 |
23915 | 136 ;;;###autoload |
88563 | 137 (defun codepage-setup (&optional codepage) |
138 "Obsolete. All coding systems are set up initially." | |
139 (interactive)) | |
140 (make-obsolete 'codepage-setup "no longer relevant" "22.1") | |
23915 | 141 |
142 (provide 'codepage) | |
143 | |
38412
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
36579
diff
changeset
|
144 ;;; codepage.el ends here |