Mercurial > emacs
comparison lisp/international/codepage.el @ 30493:6ca8f913d1df
(cp-coding-system-for-codepage-1): Give `safe-chars' property to
make-coding-system.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 27 Jul 2000 06:15:33 +0000 |
parents | 9473e3466947 |
children | 8f55d03259de |
comparison
equal
deleted
inserted
replaced
30492:822b51279bd3 | 30493:6ca8f913d1df |
---|---|
56 (undef (if (eq system-type 'ms-dos) | 56 (undef (if (eq system-type 'ms-dos) |
57 (if dos-unsupported-char-glyph | 57 (if dos-unsupported-char-glyph |
58 (logand dos-unsupported-char-glyph 255) | 58 (logand dos-unsupported-char-glyph 255) |
59 127) | 59 127) |
60 ??)) | 60 ??)) |
61 (safe-chars (make-char-table 'safe-chars)) | |
61 (ccl-decoder | 62 (ccl-decoder |
62 (ccl-compile | 63 (ccl-compile |
63 ;; The 4 here supplies the buf_magnification parameter | 64 ;; The 4 here supplies the buf_magnification parameter |
64 ;; for the CCL program. A multibyte character may take | 65 ;; for the CCL program. A multibyte character may take |
65 ;; at most 4-bytes. | 66 ;; at most 4-bytes. |
82 (if (r0 == ,(charset-id 'japanese-jisx0208)) | 83 (if (r0 == ,(charset-id 'japanese-jisx0208)) |
83 ((r1 = ,undef) | 84 ((r1 = ,undef) |
84 (write r1))))) | 85 (write r1))))) |
85 (write-repeat r1)))))) | 86 (write-repeat r1)))))) |
86 | 87 |
88 ;; Set elements of safe multibyte characters for this codepage | |
89 ;; to t in the char-table safe-chars. | |
90 (let ((tbl (get decoder 'translation-table)) | |
91 (i 128) | |
92 ch) | |
93 (while (< i 256) | |
94 (setq ch (aref tbl i)) | |
95 (if ch (aset safe-chars ch t)) | |
96 (setq i (1+ i)))) | |
97 | |
87 ;; Make coding system CODING. | 98 ;; Make coding system CODING. |
88 (make-coding-system | 99 (make-coding-system |
89 coding 4 mnemonic | 100 coding 4 mnemonic |
90 (concat "8-bit encoding of " (symbol-name iso-name) | 101 (concat "8-bit encoding of " (symbol-name iso-name) |
91 " characters using IBM codepage " coding-name) | 102 " characters using IBM codepage " coding-name) |
92 (cons ccl-decoder ccl-encoder) | 103 (cons ccl-decoder ccl-encoder) |
93 `((safe-charsets ascii eight-bit-control eight-bit-graphic ,iso-name) | 104 `((safe-charsets ascii eight-bit-control eight-bit-graphic ,iso-name) |
105 (safe-chars . ,safe-chars) | |
94 (valid-codes (0 . 255))))))) | 106 (valid-codes (0 . 255))))))) |
95 | 107 |
96 (defun cp-decoding-vector-for-codepage (table charset offset) | 108 (defun cp-decoding-vector-for-codepage (table charset offset) |
97 "Create a vector for decoding IBM PC characters using conversion table | 109 "Create a vector for decoding IBM PC characters using conversion table |
98 TABLE into an ISO-8859 character set CHARSET whose first non-ASCII | 110 TABLE into an ISO-8859 character set CHARSET whose first non-ASCII |