Mercurial > emacs
annotate lisp/international/codepage.el @ 90182:f042e7c0fe20
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-53
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 302-319)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 69)
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 20 May 2005 04:22:05 +0000 |
parents | a01e7a9f1659 c36561fe0657 |
children | f9a65d7ebd29 |
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 |
90182
f042e7c0fe20
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-53
Miles Bader <miles@gnu.org>
diff
changeset
|
3 ;; Copyright (C) 1998, 1999, 2000, 2002, 2005 Free Software Foundation, Inc. |
62274 | 4 ;; Copyright (C) 2000 |
5 ;; National Institute of Advanced Industrial Science and Technology (AIST) | |
6 ;; Registration Number H14PRO021 | |
23915 | 7 |
8 ;; Author: Eli Zaretskii | |
9 ;; Maintainer: FSF | |
88563 | 10 ;; Keywords: i18n ms-dos ms-windows codepage obsolete |
23915 | 11 |
12 ;; This file is part of GNU Emacs. | |
13 | |
14 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
15 ;; it under the terms of the GNU General Public License as published by | |
16 ;; the Free Software Foundation; either version 2, or (at your option) | |
17 ;; any later version. | |
18 | |
19 ;; GNU Emacs is distributed in the hope that it will be useful, | |
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 ;; GNU General Public License for more details. | |
23 | |
24 ;; You should have received a copy of the GNU General Public License | |
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
27 ;; Boston, MA 02111-1307, USA. | |
28 | |
29 ;;; Commentary: | |
30 | |
29922
9473e3466947
(cp-coding-system-for-codepage-1): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents:
29721
diff
changeset
|
31 ;; Special coding systems for DOS/Windows codepage support. |
88563 | 32 ;; Obsolete. |
23915 | 33 |
34 ;;; Code: | |
35 | |
88563 | 36 ;; I doubt we need compatibility versions of any of these autoloaded |
37 ;; functions apart from codepage-setup, which users may call. | |
23915 | 38 |
88563 | 39 ;; ;;;###autoload |
40 ;; (defun cp-make-coding-systems-for-codepage (codepage iso-name offset) | |
41 ;; "Create a coding system to convert IBM CODEPAGE into charset ISO-NAME | |
42 ;; whose first character is at offset OFFSET from the beginning of 8-bit | |
43 ;; ASCII table. | |
23915 | 44 |
88563 | 45 ;; The created coding system has the usual 3 subsidiary systems: for Unix-, |
46 ;; DOS- and Mac-style EOL conversion. However, unlike built-in coding | |
47 ;; systems, the Mac-style EOL conversion is currently not supported by the | |
48 ;; decoder and encoder created by this function." | |
49 ;; (let* ((decode-table (intern (format "%s-decode-table" codepage))) | |
50 ;; (nonascii-table | |
51 ;; (intern (format "%s-nonascii-translation-table" codepage))) | |
52 ;; (decode-translation | |
53 ;; (intern (format "%s-decode-translation-table" codepage))) | |
54 ;; (encode-translation | |
55 ;; (intern (format "%s-encode-translation-table" codepage)))) | |
56 ;; (set nonascii-table | |
57 ;; (make-translation-table-from-vector | |
58 ;; (cp-decoding-vector-for-codepage | |
59 ;; (symbol-value decode-table) iso-name offset))) | |
60 ;; (define-translation-table encode-translation | |
61 ;; (char-table-extra-slot (symbol-value nonascii-table) 0)) | |
62 ;; ;; For charsets other than ascii, eight-bit-* and ISO-NAME, set | |
63 ;; ;; `?' for one-column charsets, and some Japanese character for | |
64 ;; ;; wide-column charsets. CCL encoder convert that Japanese | |
65 ;; ;; character to either dos-unsupported-char-glyph or "??". | |
66 ;; (let ((tbl (char-table-extra-slot (symbol-value nonascii-table) 0)) | |
67 ;; (undef (if (eq system-type 'ms-dos) | |
68 ;; (if dos-unsupported-char-glyph | |
69 ;; (logand dos-unsupported-char-glyph 255) | |
70 ;; 127) | |
71 ;; ??)) | |
72 ;; (charsets (delq 'ascii | |
73 ;; (delq 'eight-bit-control | |
74 ;; (delq 'eight-bit-graphic | |
75 ;; (delq iso-name | |
76 ;; (copy-sequence charset-list)))))) | |
77 ;; (wide-column-char (make-char 'japanese-jisx0208 32 32))) | |
78 ;; (while charsets | |
79 ;; (aset tbl (make-char (car charsets)) | |
80 ;; (if (= (charset-width (car charsets)) 1) undef wide-column-char)) | |
81 ;; (setq charsets (cdr charsets)))) | |
82 ;; (define-translation-table decode-translation | |
83 ;; (symbol-value nonascii-table)) | |
84 ;; (cp-coding-system-for-codepage-1 | |
85 ;; (intern codepage) ?D iso-name decode-translation encode-translation) | |
86 ;; )) | |
23915 | 87 |
88563 | 88 ;; ;;;###autoload |
89 ;; (defun cp-charset-for-codepage (codepage) | |
90 ;; "Return the charset for which there is a translation table to DOS CODEPAGE. | |
91 ;; CODEPAGE must be the name of a DOS codepage, a string." | |
92 ;; (let ((cp-decoder (cp-codepage-decoder codepage))) | |
93 ;; (if (null cp-decoder) | |
94 ;; (error "Unsupported codepage %s" codepage) | |
95 ;; (get cp-decoder 'charset)))) | |
36579 | 96 |
88563 | 97 ;; ;;;###autoload |
98 ;; (defun cp-language-for-codepage (codepage) | |
99 ;; "Return the name of the MULE language environment for CODEPAGE. | |
100 ;; CODEPAGE must be the name of a DOS codepage, a string." | |
101 ;; (let ((cp-decoder (cp-codepage-decoder codepage))) | |
102 ;; (if (null cp-decoder) | |
103 ;; (error "Unsupported codepage %s" codepage) | |
104 ;; (get cp-decoder 'language)))) | |
23915 | 105 |
88563 | 106 ;; ;;;###autoload |
107 ;; (defun cp-offset-for-codepage (codepage) | |
108 ;; "Return the offset to be used in setting up coding systems for CODEPAGE. | |
109 ;; CODEPAGE must be the name of a DOS codepage, a string." | |
110 ;; (let ((cp-decoder (cp-codepage-decoder codepage))) | |
111 ;; (if (null cp-decoder) | |
112 ;; (error "Unsupported codepage %s" codepage) | |
113 ;; (get cp-decoder 'offset)))) | |
24454
fe0089dd2d2f
(cp1250-decode-table, cp1251-decode-table, cp1253-decode-table,
Eli Zaretskii <eliz@gnu.org>
parents:
24371
diff
changeset
|
114 |
88563 | 115 ;; ;;;###autoload |
116 ;; (defun cp-supported-codepages () | |
117 ;; "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
|
118 |
88563 | 119 ;; Each association in the alist has the form (NNN . CHARSET), where NNN is the |
120 ;; codepage number, and CHARSET is the MULE charset which is the closest match | |
121 ;; 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
|
122 |
88563 | 123 ;; A codepage NNN is supported if a variable called `cpNNN-decode-table' exists, |
124 ;; is a vector, and has a charset property." | |
125 ;; (save-match-data | |
126 ;; (let (alist chset sname) | |
127 ;; (mapatoms | |
128 ;; (function | |
129 ;; (lambda (sym) | |
130 ;; (if (and (boundp sym) | |
131 ;; (string-match "\\`cp\\([1-9][0-9][0-9][0-9]?\\)-decode-table\\'" | |
132 ;; (setq sname (symbol-name sym))) | |
133 ;; (vectorp (symbol-value sym)) | |
134 ;; (setq chset (get sym 'charset))) | |
135 ;; (setq alist | |
136 ;; (cons (cons (match-string 1 sname) chset) alist)))))) | |
137 ;; alist))) | |
24454
fe0089dd2d2f
(cp1250-decode-table, cp1251-decode-table, cp1253-decode-table,
Eli Zaretskii <eliz@gnu.org>
parents:
24371
diff
changeset
|
138 |
23915 | 139 ;;;###autoload |
88563 | 140 (defun codepage-setup (&optional codepage) |
141 "Obsolete. All coding systems are set up initially." | |
142 (interactive)) | |
90104
a01e7a9f1659
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-14
Miles Bader <miles@gnu.org>
parents:
89909
diff
changeset
|
143 (make-obsolete 'codepage-setup "no longer relevant" "23.1") |
52435
528d8a1b09d5
("mule-diag"): Add eval-after-load
Dave Love <fx@gnu.org>
parents:
52401
diff
changeset
|
144 |
23915 | 145 (provide 'codepage) |
146 | |
52401 | 147 ;;; arch-tag: 80328de8-b94e-4386-be26-5876105731f0 |
38412
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
36579
diff
changeset
|
148 ;;; codepage.el ends here |