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