# HG changeset patch # User Kenichi Handa # Date 1014949709 0 # Node ID fad0f879877f8135bd6930cdd32b8cf318bb07e0 # Parent 418777d5ccd432ea4527d42676eab6c8a5264a7b Call define-coding-system instead of make-coding-system. All CCL program deleted. diff -r 418777d5ccd4 -r fad0f879877f lisp/language/chinese.el --- a/lisp/language/chinese.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/chinese.el Fri Mar 01 02:28:29 2002 +0000 @@ -33,47 +33,50 @@ ;;; Chinese (general) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(make-coding-system - 'iso-2022-cn 2 ?C +(define-coding-system 'iso-2022-cn "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN)." - '(ascii - (nil chinese-gb2312 chinese-cns11643-1) - (nil chinese-cns11643-2) - nil - nil ascii-eol ascii-cntl seven locking-shift single-shift nil nil nil - init-bol) - '((safe-charsets ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2) - (mime-charset . iso-2022-cn))) + :coding-type 'iso-2022 + :mnemonic ?C + :charset-list '(ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2) + :designation [ascii + (nil chinese-gb2312 chinese-cns11643-1) + (nil chinese-cns11643-2) + nil] + :flags '(ascii-at-eol ascii-at-cntl 7-bit + designation locking-shift single-shift init-at-bol) + :plist '(mime-charset . iso-2022-cn)) (define-coding-system-alias 'chinese-iso-7bit 'iso-2022-cn) -(make-coding-system - 'iso-2022-cn-ext 2 ?C - "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN-EXT)." - '(ascii - (nil chinese-gb2312 chinese-cns11643-1) - (nil chinese-cns11643-2) - (nil chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5 - chinese-cns11643-6 chinese-cns11643-7) - nil ascii-eol ascii-cntl seven locking-shift single-shift nil nil nil - init-bol) - '((safe-charsets ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2 - chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5 - chinese-cns11643-6 chinese-cns11643-7) - (mime-charset . iso-2022-cn-ext))) +(define-coding-system 'iso-2022-cn-ext + "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN-EXT)." + :coding-type 'iso-2022 + :mnemonic ?C + :charset-list '(ascii + chinese-gb2312 chinese-cns11643-1 + chinese-cns11643-2 chinese-cns11643-3 chinese-cns11643-4 + chinese-cns11643-5 chinese-cns11643-6 chinese-cns11643-7) + :designation '[ascii + (nil chinese-gb2312 chinese-cns11643-1) + (nil chinese-cns11643-2) + (nil chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5 + chinese-cns11643-6 chinese-cns11643-7)] + :flags '(ascii-at-eol ascii-at-cntl 7-bit + designation locking-shift single-shift init-at-bol) + :plist '(mime-charset iso-2022-cn-ext)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Chinese GB2312 (simplified) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(make-coding-system - 'chinese-iso-8bit 2 ?c - "ISO 2022 based EUC encoding for Chinese GB2312 (MIME:GB2312)." - '(ascii chinese-gb2312 nil nil - nil ascii-eol ascii-cntl nil nil nil nil) - '((safe-charsets ascii chinese-gb2312) - (mime-charset . gb2312))) +(define-coding-system 'chinese-iso-8bit + "ISO 2022 based EUC encoding for Chinese GB2312 (MIME:CN-GB)." + :coding-type 'iso-2022 + :mnemonic ?c + :charset-list '(ascii chinese-gb2312) + :designation [ascii chinese-gb2312 nil nil] + :plist '(mime-charset cn-gb)) (define-coding-system-alias 'cn-gb-2312 'chinese-iso-8bit) (define-coding-system-alias 'euc-china 'chinese-iso-8bit) @@ -81,14 +84,14 @@ (define-coding-system-alias 'cn-gb 'chinese-iso-8bit) (define-coding-system-alias 'gb2312 'chinese-iso-8bit) -(make-coding-system - 'chinese-hz 0 ?z +(define-coding-system 'chinese-hz "Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)." - nil - '((safe-charsets ascii chinese-gb2312) - (mime-charset . hz-gb-2312) - (post-read-conversion . post-read-decode-hz) - (pre-write-conversion . pre-write-encode-hz))) + :coding-type 'utf-8 + :mnemonic ?z + :charset-list '(ascii chinese-gb2312) + :plist '(mime-charset hz-gb-2312) + :post-read-conversion 'post-read-decode-hz + :pre-write-conversion 'pre-write-encode-hz) (define-coding-system-alias 'hz-gb-2312 'chinese-hz) (define-coding-system-alias 'hz 'chinese-hz) @@ -125,36 +128,16 @@ ;; Chinese BIG5 (traditional) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(make-coding-system - 'chinese-big5 3 ?B - "BIG5 8-bit encoding for Chinese (MIME:Big5)." - nil - '((safe-charsets ascii chinese-big5-1 chinese-big5-2) - (mime-charset . big5) - (charset-origin-alist (chinese-big5-1 "BIG5" encode-big5-char) - (chinese-big5-2 "BIG5" encode-big5-char)))) +(define-coding-system 'chinese-big5 + "BIG5 8-bit encoding for Chinese (MIME:Big5)" + :coding-type 'big5 + :mnemonic ?B + :charset-list '(ascii big5) + :plist '(mime-charset big5)) (define-coding-system-alias 'big5 'chinese-big5) (define-coding-system-alias 'cn-big5 'chinese-big5) -;; Big5 font requires special encoding. -(define-ccl-program ccl-encode-big5-font - `(0 - ;; In: R0:chinese-big5-1 or chinese-big5-2 - ;; R1:position code 1 - ;; R2:position code 2 - ;; Out: R1:font code point 1 - ;; R2:font code point 2 - ((r2 = ((((r1 - ?\x21) * 94) + r2) - ?\x21)) - (if (r0 == ,(charset-id 'chinese-big5-2)) (r2 += 6280)) - (r1 = ((r2 / 157) + ?\xA1)) - (r2 %= 157) - (if (r2 < ?\x3F) (r2 += ?\x40) (r2 += ?\x62)))) - "CCL program to encode a Big5 code to code point of Big5 font.") - -(setq font-ccl-encoder-alist - (cons (cons "big5" ccl-encode-big5-font) font-ccl-encoder-alist)) - (set-language-info-alist "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2) (coding-system chinese-big5 chinese-iso-7bit) @@ -169,144 +152,26 @@ ;; Chinese CNS11643 (traditional) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defvar big5-to-cns (make-translation-table) - "Translation table for encoding to `euc-tw'.") -;; Could have been done by china-util loaded before. -(unless (get 'big5-to-cns 'translation-table) - (define-translation-table 'big5-to-cns big5-to-cns)) - -(define-ccl-program ccl-decode-euc-tw - ;; CNS plane 1 needs either two or four bytes in EUC-TW encoding; - ;; CNS planes 2 to 7 always need four bytes. In internal encoding of - ;; Emacs, CNS planes 1 and 2 need three bytes, and planes 3 to 7 need - ;; four bytes. Thus a buffer magnification value of 2 (for both - ;; encoding and decoding) is sufficient. - `(2 - ;; we don't have enough registers to hold all charset-ids - ((r4 = ,(charset-id 'chinese-cns11643-1)) - (r5 = ,(charset-id 'chinese-cns11643-2)) - (r6 = ,(charset-id 'chinese-cns11643-3)) - (loop - (read-if (r0 < #x80) - ;; ASCII - (write-repeat r0) - ;; not ASCII - (if (r0 == #x8E) - ;; single shift - (read-if (r1 < #xA1) - ;; invalid byte - ((write r0) - (write-repeat r1)) - (if (r1 > #xA7) - ;; invalid plane - ((write r0) - (write-repeat r1)) - ;; OK, we have a plane - (read-if (r2 < #xA1) - ;; invalid first byte - ((write r0 r1) - (write-repeat r2)) - (read-if (r3 < #xA1) - ;; invalid second byte - ((write r0 r1 r2) - (write-repeat r3)) - ;; CNS 1-7, finally - ((branch (r1 - #xA1) - (r1 = r4) - (r1 = r5) - (r1 = r6) - (r1 = ,(charset-id 'chinese-cns11643-4)) - (r1 = ,(charset-id 'chinese-cns11643-5)) - (r1 = ,(charset-id 'chinese-cns11643-6)) - (r1 = ,(charset-id 'chinese-cns11643-7))) - (r2 = ((((r2 - #x80) << 7) + r3) - #x80)) - (write-multibyte-character r1 r2) - (repeat)))))) - ;; standard EUC - (if (r0 < #xA1) - ;; invalid first byte - (write-repeat r0) - (read-if (r1 < #xA1) - ;; invalid second byte - ((write r0) - (write-repeat r1)) - ;; CNS 1, finally - ((r1 = ((((r0 - #x80) << 7) + r1) - #x80)) - (write-multibyte-character r4 r1) - (repeat))))))))) - "CCL program to decode EUC-TW encoding." -) - -(define-ccl-program ccl-encode-euc-tw - `(2 - ;; we don't have enough registers to hold all charset-ids - ((r2 = ,(charset-id 'ascii)) - (r3 = ,(charset-id 'chinese-big5-1)) - (r4 = ,(charset-id 'chinese-big5-2)) - (r5 = ,(charset-id 'chinese-cns11643-1)) - (r6 = ,(charset-id 'chinese-cns11643-2)) - (loop - (read-multibyte-character r0 r1) - (if (r0 == r2) - (write-repeat r1) - (;; Big 5 encoded characters are first translated to CNS - (if (r0 == r3) - (translate-character big5-to-cns r0 r1) - (if (r0 == r4) - (translate-character big5-to-cns r0 r1))) - (if (r0 == r5) - (r0 = #xA1) - (if (r0 == r6) - (r0 = #xA2) - (if (r0 == ,(charset-id 'chinese-cns11643-3)) - (r0 = #xA3) - (if (r0 == ,(charset-id 'chinese-cns11643-4)) - (r0 = #xA4) - (if (r0 == ,(charset-id 'chinese-cns11643-5)) - (r0 = #xA5) - (if (r0 == ,(charset-id 'chinese-cns11643-6)) - (r0 = #xA6) - (if (r0 == ,(charset-id 'chinese-cns11643-7)) - (r0 = #xA7) - ;; not CNS. We use a dummy character which - ;; can't occur in EUC-TW encoding to indicate - ;; this. - (write-repeat #xFF)))))))))) - (if (r0 != #xA1) - ;; single shift and CNS plane - ((write #x8E) - (write r0))) - (write ((r1 >> 7) + #x80)) - (write ((r1 % #x80) + #x80)) - (repeat)))) - "CCL program to encode EUC-TW encoding." -) - -(defun euc-tw-pre-write-conversion (beg end) - "Semi-dummy pre-write function effectively to autoload china-util." - ;; Ensure translation table is loaded. - (require 'china-util) - ;; Don't do this again. - (coding-system-put 'euc-tw 'pre-write-conversion nil) - nil) - -(make-coding-system - 'euc-tw 4 ?Z - "ISO 2022 based EUC encoding for Chinese CNS11643. -Big5 encoding is accepted for input also (which is then converted to CNS)." - '(ccl-decode-euc-tw . ccl-encode-euc-tw) - '((safe-charsets ascii - chinese-big5-1 - chinese-big5-2 - chinese-cns11643-1 - chinese-cns11643-2 - chinese-cns11643-3 - chinese-cns11643-4 - chinese-cns11643-5 - chinese-cns11643-6 - chinese-cns11643-7) - (valid-codes (0 . 255)) - (pre-write-conversion . euc-tw-pre-write-conversion))) +(define-coding-system 'euc-tw + "ISO 2022 based EUC encoding for Chinese CNS11643." + :coding-type 'iso-2022 + :mnemonic ?Z + :charset-list '(ascii + chinese-cns11643-1 + chinese-cns11643-2 + chinese-cns11643-3 + chinese-cns11643-4 + chinese-cns11643-5 + chinese-cns11643-6 + chinese-cns11643-7) + :designation [ascii chinese-cns11643-1 (chinese-cns11643-1 + chinese-cns11643-2 + chinese-cns11643-3 + chinese-cns11643-4 + chinese-cns11643-5 + chinese-cns11643-6 + chinese-cns11643-7) nil] + :plist '(mime-charset euc-tw)) (define-coding-system-alias 'euc-taiwan 'euc-tw) diff -r 418777d5ccd4 -r fad0f879877f lisp/language/cyrillic.el --- a/lisp/language/cyrillic.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/cyrillic.el Fri Mar 01 02:28:29 2002 +0000 @@ -34,22 +34,21 @@ ;; ISO-8859-5 staff -(make-coding-system - 'cyrillic-iso-8bit 2 ?5 - "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)." - '(ascii cyrillic-iso8859-5 nil nil - nil nil nil nil nil nil nil) - '((safe-charsets ascii cyrillic-iso8859-5) - (mime-charset . iso-8859-5))) +(define-coding-system 'cyrillic-iso-8bit + "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)." + :coding-type 'charset + :mnemonic ?5 + :charset-list '(iso-8859-5) + :plist '(mime-charset iso-8859-5)) (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit) (set-language-info-alist - "Cyrillic-ISO" '((charset cyrillic-iso8859-5) + "Cyrillic-ISO" '((charset iso-8859-5) (coding-system cyrillic-iso-8bit) (coding-priority cyrillic-iso-8bit) + (nonascii-translation . iso-8859-5) (input-method . "cyrillic-yawerty") - (nonascii-translation . cyrillic-iso8859-5) (unibyte-display . cyrillic-iso-8bit) (features cyril-util) (sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!") @@ -58,91 +57,24 @@ ;; KOI-8 staff -(defvar cyrillic-koi8-r-decode-table - [ - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 - 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 - 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 - 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 - 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 - 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 - 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 - 160 161 162 ?,Lq(B 164 165 166 167 168 169 170 171 172 173 174 175 - 176 177 178 ?,L!(B 180 181 182 183 184 185 186 187 188 189 190 191 - ?,Ln(B ?,LP(B ?,LQ(B ?,Lf(B ?,LT(B ?,LU(B ?,Ld(B ?,LS(B ?,Le(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B - ?,L_(B ?,Lo(B ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,LV(B ?,LR(B ?,Ll(B ?,Lk(B ?,LW(B ?,Lh(B ?,Lm(B ?,Li(B ?,Lg(B ?,Lj(B - ?,LN(B ?,L0(B ?,L1(B ?,LF(B ?,L4(B ?,L5(B ?,LD(B ?,L3(B ?,LE(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B - ?,L?(B ?,LO(B ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,L6(B ?,L2(B ?,LL(B ?,LK(B ?,L7(B ?,LH(B ?,LM(B ?,LI(B ?,LG(B ?,LJ(B ] - "Cyrillic KOI8-R decoding table.") - -(let ((table (make-translation-table-from-vector - cyrillic-koi8-r-decode-table))) - (define-translation-table 'cyrillic-koi8-r-nonascii-translation-table table) - (define-translation-table 'cyrillic-koi8-r-encode-table - (char-table-extra-slot table 0))) - -(define-ccl-program ccl-decode-koi8 - `(3 - ((loop - (r0 = 0) - (read r1) - (if (r1 < 128) - (write-repeat r1) - ((translate-character cyrillic-koi8-r-nonascii-translation-table r0 r1) - (write-multibyte-character r0 r1) - (repeat)))))) - "CCL program to decode KOI8.") - -(define-ccl-program ccl-encode-koi8 - `(1 - ((loop - (read-multibyte-character r0 r1) - (if (r0 == ,(charset-id 'cyrillic-iso8859-5)) - (translate-character cyrillic-koi8-r-encode-table r0 r1)) - (write-repeat r1)))) - "CCL program to encode KOI8.") - -(make-coding-system - 'cyrillic-koi8 4 - ;; We used to use ?K. It is true that ?K is more strictly correct, - ;; but it is also used for Korean. - ;; So people who use koi8 for languages other than Russian - ;; will have to forgive us. - ?R - "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)." - '(ccl-decode-koi8 . ccl-encode-koi8) - `((safe-chars . ,(let ((table (make-char-table 'safe-chars)) - (i 0)) - (while (< i 256) - (aset table (aref cyrillic-koi8-r-decode-table i) t) - (setq i (1+ i))) - table)) - (mime-charset . koi8-r) - (valid-codes (0 . 127) 163 179 (192 . 255)) - (charset-origin-alist (cyrillic-iso8859-5 "KOI8-R" - cyrillic-encode-koi8-r-char)))) +(define-coding-system 'cyrillic-koi8 + "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)." + :coding-type 'charset + ;; We used to use ?K. It is true that ?K is more strictly correct, + ;; but it is also used for Korean. So people who use koi8 for + ;; languages other than Russian will have to forgive us. + :mnemonic ?R + :charset-list '(koi8) + :plist '(mime-charset koi8-r)) (define-coding-system-alias 'koi8-r 'cyrillic-koi8) (define-coding-system-alias 'koi8 'cyrillic-koi8) -(define-ccl-program ccl-encode-koi8-font - `(0 - ((translate-character cyrillic-koi8-r-encode-table r0 r1))) - "CCL program to encode Cyrillic chars to KOI font.") - -(setq font-ccl-encoder-alist - (cons '("koi8" . ccl-encode-koi8-font) font-ccl-encoder-alist)) - (set-language-info-alist - "Cyrillic-KOI8" `((charset cyrillic-iso8859-5) - (nonascii-translation - . ,(get 'cyrillic-koi8-r-nonascii-translation-table - 'translation-table)) + "Cyrillic-KOI8" `((charset koi8) (coding-system cyrillic-koi8) (coding-priority cyrillic-koi8) + (nonascii-translation . koi8) (input-method . "cyrillic-jcuken") (features cyril-util) (unibyte-display . cyrillic-koi8) @@ -152,89 +84,19 @@ ;;; ALTERNATIVNYJ staff -(defvar cyrillic-alternativnyj-decode-table - [ - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 - 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 - 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 - 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 - 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 - 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - ?,L0(B ?,L1(B ?,L2(B ?,L3(B ?,L4(B ?,L5(B ?,L6(B ?,L7(B ?,L8(B ?,L9(B ?,L:(B ?,L;(B ?,L<(B ?,L=(B ?,L>(B ?,L?(B - ?,L@(B ?,LA(B ?,LB(B ?,LC(B ?,LD(B ?,LE(B ?,LF(B ?,LG(B ?,LH(B ?,LI(B ?,LJ(B ?,LK(B ?,LL(B ?,LM(B ?,LN(B ?,LO(B - ?,LP(B ?,LQ(B ?,LR(B ?,LS(B ?,LT(B ?,LU(B ?,LV(B ?,LW(B ?,LX(B ?,LY(B ?,LZ(B ?,L[(B ?,L\(B ?,L](B ?,L^(B ?,L_(B - 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 - 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 - 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 - ?,L`(B ?,La(B ?,Lb(B ?,Lc(B ?,Ld(B ?,Le(B ?,Lf(B ?,Lg(B ?,Lh(B ?,Li(B ?,Lj(B ?,Lk(B ?,Ll(B ?,Lm(B ?,Ln(B ?,Lo(B - ?,L!(B ?,Lq(B 242 243 244 245 246 247 248 249 250 251 252 253 254 ?,Lp(B] - "Cyrillic ALTERNATIVNYJ decoding table.") - -(let ((table (make-translation-table-from-vector - cyrillic-alternativnyj-decode-table))) - (define-translation-table 'cyrillic-alternativnyj-nonascii-translation-table - table) - (define-translation-table 'cyrillic-alternativnyj-encode-table - (char-table-extra-slot table 0))) - - -(define-ccl-program ccl-decode-alternativnyj - `(3 - ((loop - (r0 = 0) - (read r1) - (if (r1 < 128) - (write-repeat r1) - ((translate-character cyrillic-alternativnyj-nonascii-translation-table - r0 r1) - (write-multibyte-character r0 r1) - (repeat)))))) - "CCL program to decode Alternativnyj.") - -(define-ccl-program ccl-encode-alternativnyj - `(1 - ((loop - (read-multibyte-character r0 r1) - (translate-character cyrillic-alternativnyj-encode-table r0 r1) - (write-repeat r1)))) - "CCL program to encode Alternativnyj.") - -(make-coding-system - 'cyrillic-alternativnyj 4 ?A - "ALTERNATIVNYJ 8-bit encoding for Cyrillic." - '(ccl-decode-alternativnyj . ccl-encode-alternativnyj) - `((safe-chars . ,(let ((table (make-char-table 'safe-chars)) - (i 0)) - (while (< i 256) - (aset table (aref cyrillic-alternativnyj-decode-table i) - t) - (setq i (1+ i))) - table)) - (valid-codes (0 . 175) (224 . 241) 255) - (charset-origin-alist (cyrillic-iso8859-5 "ALTERNATIVNYJ" - cyrillic-encode-koi8-r-char)))) - +(define-coding-system 'cyrillic-alternativnyj + "ALTERNATIVNYJ 8-bit encoding for Cyrillic." + :coding-type 'charset + :mnemonic ?A + :charset-list '(alternativnyj)) (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj) -(define-ccl-program ccl-encode-alternativnyj-font - '(0 - ((translate-character cyrillic-alternativnyj-encode-table r0 r1))) - "CCL program to encode Cyrillic chars to Alternativnyj font.") - -(setq font-ccl-encoder-alist - (cons '("alternativnyj" . ccl-encode-alternativnyj-font) - font-ccl-encoder-alist)) - (set-language-info-alist - "Cyrillic-ALT" `((charset cyrillic-iso8859-5) - (nonascii-translation - . ,(get 'cyrillic-alternativnyj-nonascii-translation-table - 'translation-table)) + "Cyrillic-ALT" `((charset alternativnyj) (coding-system cyrillic-alternativnyj) (coding-priority cyrillic-alternativnyj) + (nonascii-translation . alternativnyj) (input-method . "cyrillic-jcuken") (features cyril-util) (unibyte-display . cyrillic-alternativnyj) diff -r 418777d5ccd4 -r fad0f879877f lisp/language/european.el --- a/lisp/language/european.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/european.el Fri Mar 01 02:28:29 2002 +0000 @@ -32,22 +32,11 @@ ;; Latin-1 (ISO-8859-1) -(make-coding-system - 'iso-latin-1 2 ?1 - "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)." - '(ascii latin-iso8859-1 nil nil - nil nil nil nil nil nil nil nil nil nil nil nil t) - '((safe-charsets ascii latin-iso8859-1) - (mime-charset . iso-8859-1))) - -(define-coding-system-alias 'iso-8859-1 'iso-latin-1) -(define-coding-system-alias 'latin-1 'iso-latin-1) - (set-language-info-alist - "Latin-1" '((charset ascii latin-iso8859-1) + "Latin-1" '((charset iso-8859-1) (coding-system iso-latin-1) (coding-priority iso-latin-1) - (nonascii-translation . latin-iso8859-1) + (nonascii-translation . iso-8859-1) (unibyte-syntax . "latin-1") (unibyte-display . iso-latin-1) (input-method . "latin-1-prefix") @@ -74,22 +63,21 @@ ;; Latin-2 (ISO-8859-2) -(make-coding-system - 'iso-latin-2 2 ?2 - "ISO 2022 based 8-bit encoding for Latin-2 (MIME:ISO-8859-2)." - '(ascii latin-iso8859-2 nil nil - nil nil nil nil nil nil nil) - '((safe-charsets ascii latin-iso8859-2) - (mime-charset . iso-8859-2))) +(define-coding-system 'iso-latin-2 + "ISO 2022 based 8-bit encoding for Latin-2 (MIME:ISO-8859-2)." + :coding-type 'charset + :mnemonic ?2 + :charset-list '(iso-8859-2) + :plist '(mime-charset iso-8859-2)) (define-coding-system-alias 'iso-8859-2 'iso-latin-2) (define-coding-system-alias 'latin-2 'iso-latin-2) (set-language-info-alist - "Latin-2" '((charset ascii latin-iso8859-2) + "Latin-2" '((charset iso-8859-2) (coding-system iso-latin-2) (coding-priority iso-latin-2) - (nonascii-translation . latin-iso8859-2) + (nonascii-translation . iso-8859-2) (unibyte-syntax . "latin-2") (unibyte-display . iso-latin-2) (input-method . "latin-2-prefix") @@ -108,22 +96,21 @@ ;; Latin-3 (ISO-8859-3) -(make-coding-system - 'iso-latin-3 2 ?3 - "ISO 2022 based 8-bit encoding for Latin-3 (MIME:ISO-8859-3)." - '(ascii latin-iso8859-3 nil nil - nil nil nil nil nil nil nil) - '((safe-charsets ascii latin-iso8859-3) - (mime-charset . iso-8859-3))) +(define-coding-system 'iso-latin-3 + "ISO 2022 based 8-bit encoding for Latin-3 (MIME:ISO-8859-3)." + :coding-type 'charset + :mnemonic ?3 + :charset-list '(iso-8859-3) + :plist '(mime-charset iso-8859-3)) (define-coding-system-alias 'iso-8859-3 'iso-latin-3) (define-coding-system-alias 'latin-3 'iso-latin-3) (set-language-info-alist - "Latin-3" '((charset ascii latin-iso8859-3) + "Latin-3" '((charset iso-8859-3) (coding-system iso-latin-3) (coding-priority iso-latin-3) - (nonascii-translation . latin-iso8859-3) + (nonascii-translation . iso-8859-3) (unibyte-syntax . "latin-3") (unibyte-display . iso-latin-3) (input-method . "latin-3-prefix") @@ -136,22 +123,21 @@ ;; Latin-4 (ISO-8859-4) -(make-coding-system - 'iso-latin-4 2 ?4 - "ISO 2022 based 8-bit encoding for Latin-4 (MIME:ISO-8859-4)." - '(ascii latin-iso8859-4 nil nil - nil nil nil nil nil nil nil) - '((safe-charsets ascii latin-iso8859-4) - (mime-charset . iso-8859-4))) +(define-coding-system 'iso-latin-4 + "ISO 2022 based 8-bit encoding for Latin-4 (MIME:ISO-8859-4)." + :coding-type 'charset + :mnemonic ?4 + :charset-list '(iso-8859-4) + :plist '(mime-charset iso-8859-4)) (define-coding-system-alias 'iso-8859-4 'iso-latin-4) (define-coding-system-alias 'latin-4 'iso-latin-4) (set-language-info-alist - "Latin-4" '((charset ascii latin-iso8859-4) + "Latin-4" '((charset iso-8859-4) (coding-system iso-8859-4) (coding-priority iso-8859-4) - (nonascii-translation . latin-iso8859-4) + (nonascii-translation . iso-8859-4) (unibyte-syntax . "latin-4") (unibyte-display . iso-8859-4) (input-method . "latin-4-postfix") @@ -164,22 +150,21 @@ ;; Latin-5 (ISO-8859-9) -(make-coding-system - 'iso-latin-5 2 ?9 - "ISO 2022 based 8-bit encoding for Latin-5 (MIME:ISO-8859-9)." - '(ascii latin-iso8859-9 nil nil - nil nil nil nil nil nil nil) - '((safe-charsets ascii latin-iso8859-9) - (mime-charset . iso-8859-9))) +(define-coding-system 'iso-latin-5 + "ISO 2022 based 8-bit encoding for Latin-5 (MIME:ISO-8859-9)." + :coding-type 'charset + :mnemonic ?9 + :charset-list '(iso-8859-9) + :plist '(mime-charset iso-8859-9)) (define-coding-system-alias 'iso-8859-9 'iso-latin-5) (define-coding-system-alias 'latin-5 'iso-latin-5) (set-language-info-alist - "Latin-5" '((charset ascii latin-iso8859-9) + "Latin-5" '((charset iso-8859-9) (coding-system iso-latin-5) (coding-priority iso-latin-5) - (nonascii-translation . latin-iso8859-9) + (nonascii-translation . iso-8859-9) (unibyte-syntax . "latin-5") (unibyte-display . iso-latin-5) (input-method . "latin-5-postfix") @@ -189,23 +174,22 @@ ;; Latin-8 (ISO-8859-14) -(make-coding-system - 'iso-latin-8 2 ?W ; `W' for `Welsh', since `C' - ; for `Celtic' is taken. - "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)." - '(ascii latin-iso8859-14 nil nil - nil nil nil nil nil nil nil nil nil nil nil nil t) - '((safe-charsets ascii latin-iso8859-14) - (mime-charset . iso-8859-14))) +(define-coding-system 'iso-latin-8 + "ISO 2022 based 8-bit encoding for Latin-8 (MIME:ISO-8859-14)." + :coding-type 'charset + ;; `W' for `Welsh', since `C' for `Celtic' is taken. + :mnemonic ?W + :charset-list '(iso-8859-14) + :plist '(mime-charset iso-8859-14)) (define-coding-system-alias 'iso-8859-14 'iso-latin-8) (define-coding-system-alias 'latin-8 'iso-latin-8) (set-language-info-alist - "Latin-8" '((charset ascii latin-iso8859-14) + "Latin-8" '((charset iso-8859-14) (coding-system iso-latin-8) (coding-priority iso-latin-8) - (nonascii-translation . latin-iso8859-14) + (nonascii-translation . iso-8859-14) (unibyte-syntax . "latin-8") (unibyte-display . iso-latin-8) (input-method . "latin-8-prefix") @@ -220,23 +204,23 @@ ;; Latin-9 (ISO-8859-15) -(make-coding-system - 'iso-latin-9 2 ?0 ; `0' for `Latin-0' - "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)." - '(ascii latin-iso8859-15 nil nil - nil nil nil nil nil nil nil nil nil nil nil nil t) - '((safe-charsets ascii latin-iso8859-15) - (mime-charset . iso-8859-15))) +(define-coding-system 'iso-latin-9 + "ISO 2022 based 8-bit encoding for Latin-9 (MIME:ISO-8859-15)." + :coding-type 'charset + ;; `0' for `Latin-0' + :mnemonic ?0 + :charset-list '(iso-8859-15) + :plist '(mime-charset iso-8859-15)) (define-coding-system-alias 'iso-8859-15 'iso-latin-9) (define-coding-system-alias 'latin-9 'iso-latin-9) (define-coding-system-alias 'latin-0 'iso-latin-9) (set-language-info-alist - "Latin-9" '((charset ascii latin-iso8859-15) + "Latin-9" '((charset iso-8859-15) (coding-system iso-latin-9) (coding-priority iso-latin-9) - (nonascii-translation . latin-iso8859-15) + (nonascii-translation . iso-8859-15) (unibyte-syntax . "latin-9") (unibyte-display . iso-latin-9) (input-method . "latin-9-prefix") @@ -251,11 +235,11 @@ (set-language-info-alist "German" '((tutorial . "TUTORIAL.de") - (charset ascii latin-iso8859-1) + (charset iso-8859-1) (coding-system iso-latin-1) (coding-priority iso-latin-1) + (nonascii-translation . iso-8859-1) (input-method . "german-postfix") - (nonascii-translation . iso-latin-1) (unibyte-syntax . "latin-1") (unibyte-display . iso-latin-1) (sample-text . "\ @@ -269,10 +253,10 @@ (set-language-info-alist "French" '((tutorial . "TUTORIAL.fr") - (charset ascii latin-iso8859-1) + (charset iso-8859-1) (coding-system iso-latin-1) (coding-priority iso-latin-1) - (nonascii-translation . latin-iso8859-1) + (nonascii-translation . iso-8859-1) (unibyte-syntax . "latin-1") (unibyte-display . iso-latin-1) (input-method . "latin-1-prefix") @@ -283,10 +267,10 @@ '("European")) (set-language-info-alist - "Slovenian" '((charset . (ascii latin-iso8859-2)) + "Slovenian" '((charset iso-8859-2) (coding-system . (iso-8859-2)) (coding-priority . (iso-8859-2)) - (nonascii-translation . latin-iso8859-2) + (nonascii-translation . iso-8859-2) (input-method . "latin-2-postfix") (unibyte-syntax . "latin-2") (unibyte-display . iso-8859-2) @@ -297,11 +281,11 @@ (set-language-info-alist "Spanish" '((tutorial . "TUTORIAL.es") - (charset ascii latin-iso8859-1) + (charset iso-8859-1) (coding-system iso-latin-1) (coding-priority iso-latin-1) + (nonascii-translation . iso-8859-1) (input-method . "spanish-postfix") - (nonascii-translation . iso-latin-1) (unibyte-syntax . "latin-1") (unibyte-display . iso-latin-1) (sample-text . "Spanish (Espa,Aq(Bol) ,A!(BHola!") @@ -313,10 +297,10 @@ (set-language-info-alist "Dutch" '((tutorial . "TUTORIAL.nl") - (charset ascii latin-iso8859-1) + (charset iso-8859-1) (coding-system iso-latin-1) (coding-priority iso-latin-1) - (nonascii-translation . iso-latin-1) + (nonascii-translation . iso-8859-1) (unibyte-syntax . "latin-1") (unibyte-display . iso-latin-1) (sample-text . "Er is een aantal manieren waarop je dit kan doen") @@ -331,10 +315,10 @@ ;; "Latin-3" language environment. (set-language-info-alist - "Turkish" '((charset ascii latin-iso8859-9) + "Turkish" '((charset iso-8859-9) (coding-system iso-latin-5) (coding-priority iso-latin-5) - (nonascii-translation . latin-iso8859-9) + (nonascii-translation . iso-8859-9) (unibyte-syntax . "latin-5") (unibyte-display . iso-latin-5) (input-method . "turkish-postfix") @@ -346,11 +330,11 @@ ;; Keywords: multilingual, Polish (set-language-info-alist - "Polish" '((charset . (ascii latin-iso8859-2)) + "Polish" '((charset . (iso-8859-2)) (coding-system . (iso-8859-2)) (coding-priority . (iso-8859-2)) + (nonascii-translation . iso-8859-2) (input-method . "polish-slash") - (nonascii-translation . latin-iso8859-2) (unibyte-syntax . "latin-2") (unibyte-display . iso-8859-2) (tutorial . "TUTORIAL.pl") @@ -361,6 +345,7 @@ (set-language-info-alist "Welsh" `((coding-system utf-8 latin-8) ; the input method is Unicode-based (coding-priority utf-8 latin-8) + (nonascii-translation . iso-8859-14) (input-method . "welsh") (documentation . "Support for Welsh, using Unicode.")) '("European")) @@ -368,6 +353,7 @@ (set-language-info-alist "Latin-7" `((coding-system latin-7) (coding-priority latin-7) + (nonascii-translation . iso-8859-13) ;; Fixme: input-method (features code-pages) (documentation . "Support for Latin-7, e.g. Latvian, Lithuanian.")) @@ -376,6 +362,7 @@ (set-language-info-alist "Lithuanian" `((coding-system latin-7) (coding-priority latin-7) + (nonascii-translation . iso-8859-13) (input-method . "lithuanian-keyboard") (features code-pages) (documentation . "Support for Lithuanian.")) @@ -384,194 +371,20 @@ (set-language-info-alist "Latvian" `((coding-system latin-7) (coding-priority latin-7) + (nonascii-translation . iso-8859-13) (input-method . "latvian-keyboard") (features code-pages) (documentation . "Support for Latvian.")) '("European")) + -;; Definitions for the Mac Roman character sets and coding system. -;; The Mac Roman encoding uses all 128 code points in the range 128 to -;; 255 for actual characters. Emacs decodes them to one of the -;; following character sets. -;; ascii, latin-iso8859-1, mule-unicode-0100-24ff, -;; mule-unicode-2500-33ff, mule-unicode-e000-ffff - -(let - ((encoding-vector (make-vector 256 nil)) - (i 0) - (vec ;; mac-roman (128..255) -> UCS mapping - [ #x00C4 ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS - #x00C5 ;; 129:LATIN CAPITAL LETTER A WITH RING ABOVE - #x00C7 ;; 130:LATIN CAPITAL LETTER C WITH CEDILLA - #x00C9 ;; 131:LATIN CAPITAL LETTER E WITH ACUTE - #x00D1 ;; 132:LATIN CAPITAL LETTER N WITH TILDE - #x00D6 ;; 133:LATIN CAPITAL LETTER O WITH DIAERESIS - #x00DC ;; 134:LATIN CAPITAL LETTER U WITH DIAERESIS - #x00E1 ;; 135:LATIN SMALL LETTER A WITH ACUTE - #x00E0 ;; 136:LATIN SMALL LETTER A WITH GRAVE - #x00E2 ;; 137:LATIN SMALL LETTER A WITH CIRCUMFLEX - #x00E4 ;; 138:LATIN SMALL LETTER A WITH DIAERESIS - #x00E3 ;; 139:LATIN SMALL LETTER A WITH TILDE - #x00E5 ;; 140:LATIN SMALL LETTER A WITH RING ABOVE - #x00E7 ;; 141:LATIN SMALL LETTER C WITH CEDILLA - #x00E9 ;; 142:LATIN SMALL LETTER E WITH ACUTE - #x00E8 ;; 143:LATIN SMALL LETTER E WITH GRAVE - #x00EA ;; 144:LATIN SMALL LETTER E WITH CIRCUMFLEX - #x00EB ;; 145:LATIN SMALL LETTER E WITH DIAERESIS - #x00ED ;; 146:LATIN SMALL LETTER I WITH ACUTE - #x00EC ;; 147:LATIN SMALL LETTER I WITH GRAVE - #x00EE ;; 148:LATIN SMALL LETTER I WITH CIRCUMFLEX - #x00EF ;; 149:LATIN SMALL LETTER I WITH DIAERESIS - #x00F1 ;; 150:LATIN SMALL LETTER N WITH TILDE - #x00F3 ;; 151:LATIN SMALL LETTER O WITH ACUTE - #x00F2 ;; 152:LATIN SMALL LETTER O WITH GRAVE - #x00F4 ;; 153:LATIN SMALL LETTER O WITH CIRCUMFLEX - #x00F6 ;; 154:LATIN SMALL LETTER O WITH DIAERESIS - #x00F5 ;; 155:LATIN SMALL LETTER O WITH TILDE - #x00FA ;; 156:LATIN SMALL LETTER U WITH ACUTE - #x00F9 ;; 157:LATIN SMALL LETTER U WITH GRAVE - #x00FB ;; 158:LATIN SMALL LETTER U WITH CIRCUMFLEX - #x00FC ;; 159:LATIN SMALL LETTER U WITH DIAERESIS - #x2020 ;; 160:DAGGER - #x00B0 ;; 161:DEGREE SIGN - #x00A2 ;; 162:CENT SIGN - #x00A3 ;; 163:POUND SIGN - #x00A7 ;; 164:SECTION SIGN - #x2022 ;; 165:BULLET - #x00B6 ;; 166:PILCROW SIGN - #x00DF ;; 167:LATIN SMALL LETTER SHARP S - #x00AE ;; 168:REGISTERED SIGN - #x00A9 ;; 169:COPYRIGHT SIGN - #x2122 ;; 170:TRADE MARK SIGN - #x00B4 ;; 171:ACUTE ACCENT - #x00A8 ;; 172:DIAERESIS - #x2260 ;; 173:NOT EQUAL TO - #x00C6 ;; 174:LATIN CAPITAL LETTER AE - #x00D8 ;; 175:LATIN CAPITAL LETTER O WITH STROKE - #x221E ;; 176:INFINITY - #x00B1 ;; 177:PLUS-MINUS SIGN - #x2264 ;; 178:LESS-THAN OR EQUAL TO - #x2265 ;; 179:GREATER-THAN OR EQUAL TO - #x00A5 ;; 180:YEN SIGN - #x00B5 ;; 181:MICRO SIGN - #x2202 ;; 182:PARTIAL DIFFERENTIAL - #x2211 ;; 183:N-ARY SUMMATION - #x220F ;; 184:N-ARY PRODUCT - #x03C0 ;; 185:GREEK SMALL LETTER PI - #x222B ;; 186:INTEGRAL - #x00AA ;; 187:FEMININE ORDINAL INDICATOR - #x00BA ;; 188:MASCULINE ORDINAL INDICATOR - #x03A9 ;; 189:GREEK CAPITAL LETTER OMEGA - #x00E6 ;; 190:LATIN SMALL LETTER AE - #x00F8 ;; 191:LATIN SMALL LETTER O WITH STROKE - #x00BF ;; 192:INVERTED QUESTION MARK - #x00A1 ;; 193:INVERTED EXCLAMATION MARK - #x00AC ;; 194:NOT SIGN - #x221A ;; 195:SQUARE ROOT - #x0192 ;; 196:LATIN SMALL LETTER F WITH HOOK - #x2248 ;; 197:ALMOST EQUAL TO - #x2206 ;; 198:INCREMENT - #x00AB ;; 199:LEFT-POINTING DOUBLE ANGLE QUOTATION MARK - #x00BB ;; 200:RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK - #x2026 ;; 201:HORIZONTAL ELLIPSIS - #x00A0 ;; 202:NO-BREAK SPACE - #x00C0 ;; 203:LATIN CAPITAL LETTER A WITH GRAVE - #x00C3 ;; 204:LATIN CAPITAL LETTER A WITH TILDE - #x00D5 ;; 205:LATIN CAPITAL LETTER O WITH TILDE - #x0152 ;; 206:LATIN CAPITAL LIGATURE OE - #x0153 ;; 207:LATIN SMALL LIGATURE OE - #x2013 ;; 208:EN DASH - #x2014 ;; 209:EM DASH - #x201C ;; 210:LEFT DOUBLE QUOTATION MARK - #x201D ;; 211:RIGHT DOUBLE QUOTATION MARK - #x2018 ;; 212:LEFT SINGLE QUOTATION MARK - #x2019 ;; 213:RIGHT SINGLE QUOTATION MARK - #x00F7 ;; 214:DIVISION SIGN - #x25CA ;; 215:LOZENGE - #x00FF ;; 216:LATIN SMALL LETTER Y WITH DIAERESIS - #x0178 ;; 217:LATIN CAPITAL LETTER Y WITH DIAERESIS - #x2044 ;; 218:FRACTION SLASH - #x20AC ;; 219:EURO SIGN - #x2039 ;; 220:SINGLE LEFT-POINTING ANGLE QUOTATION MARK - #x203A ;; 221:SINGLE RIGHT-POINTING ANGLE QUOTATION MARK - #xFB01 ;; 222:LATIN SMALL LIGATURE FI - #xFB02 ;; 223:LATIN SMALL LIGATURE FL - #x2021 ;; 224:DOUBLE DAGGER - #x00B7 ;; 225:MIDDLE DOT - #x201A ;; 226:SINGLE LOW-9 QUOTATION MARK - #x201E ;; 227:DOUBLE LOW-9 QUOTATION MARK - #x2030 ;; 228:PER MILLE SIGN - #x00C2 ;; 229:LATIN CAPITAL LETTER A WITH CIRCUMFLEX - #x00CA ;; 230:LATIN CAPITAL LETTER E WITH CIRCUMFLEX - #x00C1 ;; 231:LATIN CAPITAL LETTER A WITH ACUTE - #x00CB ;; 232:LATIN CAPITAL LETTER E WITH DIAERESIS - #x00C8 ;; 233:LATIN CAPITAL LETTER E WITH GRAVE - #x00CD ;; 234:LATIN CAPITAL LETTER I WITH ACUTE - #x00CE ;; 235:LATIN CAPITAL LETTER I WITH CIRCUMFLEX - #x00CF ;; 236:LATIN CAPITAL LETTER I WITH DIAERESIS - #x00CC ;; 237:LATIN CAPITAL LETTER I WITH GRAVE - #x00D3 ;; 238:LATIN CAPITAL LETTER O WITH ACUTE - #x00D4 ;; 239:LATIN CAPITAL LETTER O WITH CIRCUMFLEX - #xF8FF ;; 240:Apple logo - #x00D2 ;; 241:LATIN CAPITAL LETTER O WITH GRAVE - #x00DA ;; 242:LATIN CAPITAL LETTER U WITH ACUTE - #x00DB ;; 243:LATIN CAPITAL LETTER U WITH CIRCUMFLEX - #x00D9 ;; 244:LATIN CAPITAL LETTER U WITH GRAVE - #x0131 ;; 245:LATIN SMALL LETTER DOTLESS I - #x02C6 ;; 246:MODIFIER LETTER CIRCUMFLEX ACCENT - #x02DC ;; 247:SMALL TILDE - #x00AF ;; 248:MACRON - #x02D8 ;; 249:BREVE - #x02D9 ;; 250:DOT ABOVE - #x02DA ;; 251:RING ABOVE - #x00B8 ;; 252:CEDILLA - #x02DD ;; 253:DOUBLE ACUTE ACCENT - #x02DB ;; 254:OGONEK - #x02C7 ;; 255:CARON - ]) - translation-table) - (while (< i 128) - (aset encoding-vector i i) - (setq i (1+ i))) - (while (< i 256) - (aset encoding-vector i - (decode-char 'ucs (aref vec (- i 128)))) - (setq i (1+ i))) - (setq translation-table - (make-translation-table-from-vector encoding-vector)) - (define-translation-table 'mac-roman-decoder translation-table) - (define-translation-table 'mac-roman-encoder - (char-table-extra-slot translation-table 0))) - -(define-ccl-program decode-mac-roman - `(4 - ((loop - (read r1) - (if (r1 < 128) ;; ASCII - (r0 = ,(charset-id 'ascii)) - (if (r1 < 160) - (r0 = ,(charset-id 'eight-bit-control)) - (r0 = ,(charset-id 'eight-bit-graphic)))) - (translate-character mac-roman-decoder r0 r1) - (write-multibyte-character r0 r1) - (repeat)))) - "CCL program to decode Mac Roman") - -(define-ccl-program encode-mac-roman - `(1 - ((loop - (read-multibyte-character r0 r1) - (translate-character mac-roman-encoder r0 r1) - (write-repeat r1)))) - "CCL program to encode Mac Roman") - -(make-coding-system - 'mac-roman 4 ?M - "Mac Roman Encoding (MIME:MACINTOSH)." - '(decode-mac-roman . encode-mac-roman) - '((safe-chars . mac-roman-encoder) - (valid-codes (0 . 255)) - (mime-charset . macintosh))) ; per IANA, rfc1345 +(define-coding-system 'mac-roman + "Mac Roman Encoding (MIME:MACINTOSH)." + :coding-type 'charset + :mnemonic ?M + :charset-list '(mac-roman) + ;; per IANA, rfc1345 + :mime-charset 'macintosh) (defconst diacritic-composition-pattern "\\C^\\c^+") @@ -621,11 +434,11 @@ (let ((patterns '(("\\C^\\c^+" . diacritic-composition-function)))) (let ((c #x300)) (while (<= c #x362) - (aset composition-function-table (decode-char 'ucs c) patterns) + (aset composition-function-table (decode-char 'unicode c) patterns) (setq c (1+ c))) (setq c #x20d0) (while (<= c #x20e3) - (aset composition-function-table (decode-char 'ucs c) patterns) + (aset composition-function-table (decode-char 'unicode c) patterns) (setq c (1+ c))))) (provide 'european) diff -r 418777d5ccd4 -r fad0f879877f lisp/language/greek.el --- a/lisp/language/greek.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/greek.el Fri Mar 01 02:28:29 2002 +0000 @@ -28,21 +28,20 @@ ;;; Code: -(make-coding-system - 'greek-iso-8bit 2 ?7 - "ISO 2022 based 8-bit encoding for Greek (MIME:ISO-8859-7)." - '(ascii greek-iso8859-7 nil nil - nil nil nil nil nil nil nil) - '((safe-charsets ascii greek-iso8859-7) - (mime-charset . iso-8859-7))) +(define-coding-system 'greek-iso-8bit + "ISO 2022 based 8-bit encoding for Greek (MIME:ISO-8859-7)." + :coding-type 'charset + :mnemonic ?7 + :charset-list'(iso-8859-7) + :plist '(mime-charset iso-8859-7)) (define-coding-system-alias 'iso-8859-7 'greek-iso-8bit) (set-language-info-alist - "Greek" '((charset . (greek-iso8859-7)) + "Greek" '((charset iso-8859-7) (coding-system . (greek-iso-8bit)) (coding-priority greek-iso-8bit) - (nonascii-translation . greek-iso8859-7) + (nonascii-translation . iso-8859-7) (input-method . "greek") (unibyte-display . greek-iso-8bit) (documentation . t))) diff -r 418777d5ccd4 -r fad0f879877f lisp/language/hebrew.el --- a/lisp/language/hebrew.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/hebrew.el Fri Mar 01 02:28:29 2002 +0000 @@ -31,13 +31,12 @@ ;;; Code: -(make-coding-system - 'hebrew-iso-8bit 2 ?8 - "ISO 2022 based 8-bit encoding for Hebrew (MIME:ISO-8859-8)." - '(ascii hebrew-iso8859-8 nil nil - nil ascii-eol ascii-cntl nil nil nil nil nil t) - '((safe-charsets ascii hebrew-iso8859-8) - (mime-charset . iso-8859-8))) +(define-coding-system 'hebrew-iso-8bit + "ISO 2022 based 8-bit encoding for Hebrew (MIME:ISO-8859-8)." + :coding-type 'charset + :mnemonic ?8 + :charset-list '(iso-8859-8) + :plist '(mime-charset iso-8859-8)) (define-coding-system-alias 'iso-8859-8 'hebrew-iso-8bit) @@ -49,10 +48,10 @@ (define-coding-system-alias 'iso-8859-8-i 'hebrew-iso-8bit) (set-language-info-alist - "Hebrew" '((charset . (hebrew-iso8859-8)) + "Hebrew" '((charset . iso-8859-8) (coding-priority hebrew-iso-8bit) - (coding-system . (hebrew-iso-8bit)) - (nonascii-translation . hebrew-iso8859-8) + (coding-system hebrew-iso-8bit) + (nonascii-translation . iso-8859-8) (input-method . "hebrew") (unibyte-display . hebrew-iso-8bit) (sample-text . "Hebrew ,Hylem(B") diff -r 418777d5ccd4 -r fad0f879877f lisp/language/indian.el --- a/lisp/language/indian.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/indian.el Fri Mar 01 02:28:29 2002 +0000 @@ -29,14 +29,16 @@ ;;; Code: -(make-coding-system - 'in-is13194 2 ?D - "8-bit encoding for ASCII (MSB=0) and IS13194-Devanagari (MSB=1)." - '(ascii indian-is13194 nil nil - nil ascii-eol) - '((safe-charsets ascii indian-is13194) - (post-read-conversion . in-is13194-post-read-conversion) - (pre-write-conversion . in-is13194-pre-write-conversion))) +(define-coding-system 'in-is13194-devanagari + "8-bit encoding for ASCII (MSB=0) and IS13194-Devanagari (MSB=1)." + :coding-type 'iso-2022 + :mnemonic ?D + :designation [ascii indian-is13194 nil nil] + :charset-list '(ascii indian-is13194) + :post-read-conversion 'in-is13194-devanagari-post-read-conversion + :pre-write-conversion 'in-is13194-devanagari-pre-write-conversion) + +(define-coding-system-alias 'devanagari 'in-is13194-devanagari) (defvar indian-script-table '[ diff -r 418777d5ccd4 -r fad0f879877f lisp/language/japanese.el --- a/lisp/language/japanese.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/japanese.el Fri Mar 01 02:28:29 2002 +0000 @@ -29,64 +29,72 @@ ;;; Code: -(make-coding-system - 'iso-2022-jp 2 ?J - "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)." - '((ascii japanese-jisx0208-1978 japanese-jisx0208 - latin-jisx0201 japanese-jisx0212) nil nil nil - short ascii-eol ascii-cntl seven) - '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208 - latin-jisx0201 japanese-jisx0212) - (mime-charset . iso-2022-jp))) +(define-coding-system 'iso-2022-jp + "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)." + :coding-type 'iso-2022 + :mnemonic ?J + :designation [(ascii japanese-jisx0208-1978 japanese-jisx0208 + latin-jisx0201 japanese-jisx0212) + nil nil nil] + :flags '(short ascii-at-eol ascii-at-cntl 7-bit designation) + :charset-list '(ascii japanese-jisx0208-1978 japanese-jisx0208 + latin-jisx0201 japanese-jisx0212) + :plist '(mime-charset iso-2022-jp)) (define-coding-system-alias 'junet 'iso-2022-jp) -(make-coding-system - 'iso-2022-jp-2 2 ?J - "ISO 2022 based 7bit encoding for CJK, Latin-1, and Greek (MIME:ISO-2022-JP-2)." - '((ascii japanese-jisx0208-1978 japanese-jisx0208 - latin-jisx0201 japanese-jisx0212 - chinese-gb2312 korean-ksc5601) nil - (nil latin-iso8859-1 greek-iso8859-7) nil - short ascii-eol ascii-cntl seven nil single-shift nil nil nil init-bol) - '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208 - latin-jisx0201 japanese-jisx0212 - chinese-gb2312 korean-ksc5601 - latin-iso8859-1 greek-iso8859-7) - (mime-charset . iso-2022-jp-2))) +(define-coding-system 'iso-2022-jp-2 + "ISO 2022 based 7bit encoding for CJK, Latin-1, Greek (MIME:ISO-2022-JP-2)." + :coding-type 'iso-2022 + :mnemonic ?J + :designation [(ascii japanese-jisx0208-1978 japanese-jisx0208 + latin-jisx0201 japanese-jisx0212 + chinese-gb2312 korean-ksc5601) + nil + (nil latin-iso8859-1 greek-iso8859-7) + nil] + :flags '(short ascii-at-eol ascii-at-cntl 7-bit designation single-shift + init-at-bol) + :charset-list '(ascii japanese-jisx0208-1978 japanese-jisx0208 + latin-jisx0201 japanese-jisx0212 + chinese-gb2312 korean-ksc5601 + latin-iso8859-1 greek-iso8859-7) + :plist '(mime-charset iso-2022-jp-2)) -(make-coding-system - 'japanese-shift-jis 1 ?S - "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)." - nil - '((safe-charsets ascii japanese-jisx0208 japanese-jisx0208-1978 - latin-jisx0201 katakana-jisx0201) - (mime-charset . shift_jis) - (charset-origin-alist (japanese-jisx0208 "SJIS" encode-sjis-char) - (katakana-jisx0201 "SJIS" encode-sjis-char)))) +(define-coding-system 'japanese-shift-jis + "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)" + :coding-type 'shift-jis + :mnemonic ?S + :charset-list '(ascii katakana-jisx0201 japanese-jisx0208) + :plist '(mime-charset shift_jis)) (define-coding-system-alias 'shift_jis 'japanese-shift-jis) (define-coding-system-alias 'sjis 'japanese-shift-jis) -(make-coding-system - 'japanese-iso-7bit-1978-irv 2 ?j - "ISO 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman." - '((ascii japanese-jisx0208-1978 japanese-jisx0208 - latin-jisx0201 japanese-jisx0212 katakana-jisx0201 t) nil nil nil - short ascii-eol ascii-cntl seven nil nil use-roman use-oldjis) - '(ascii japanese-jisx0208-1978 japanese-jisx0208 latin-jisx0201)) +(define-coding-system 'japanese-iso-7bit-1978-irv + "ISO 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman." + :coding-type 'iso-2022 + :mnemonic ?j + :designation [(latin-jisx0201 japanese-jisx0208-1978 japanese-jisx0208 + japanese-jisx0212 katakana-jisx0201) + nil nil nil] + :flags '(short ascii-at-eol ascii-at-cntl 7-bit use-roman use-oldjis) + :charset-list '(latin-jisx0201 japanese-jisx0208-1978 japanese-jisx0208 + japanese-jisx0212)) (define-coding-system-alias 'iso-2022-jp-1978-irv 'japanese-iso-7bit-1978-irv) (define-coding-system-alias 'old-jis 'japanese-iso-7bit-1978-irv) -(make-coding-system - 'japanese-iso-8bit 2 ?E - "ISO 2022 based EUC encoding for Japanese (MIME:EUC-JP)." - '(ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212 - short ascii-eol ascii-cntl nil nil single-shift) - '((safe-charsets ascii latin-jisx0201 japanese-jisx0208 japanese-jisx0208-1978 - katakana-jisx0201 japanese-jisx0212) - (mime-charset . euc-jp))) +(define-coding-system 'japanese-iso-8bit + "ISO 2022 based EUC encoding for Japanese (MIME:EUC-JP)." + :coding-type 'iso-2022 + :mnemonic ?E + :designation [ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212] + :flags '(short ascii-at-eol ascii-at-cntl single-shift) + :charset-list '(ascii latin-jisx0201 japanese-jisx0208 + japanese-jisx0208-1978 + katakana-jisx0201 japanese-jisx0212) + :plist '(mime-charset euc-jp)) (define-coding-system-alias 'euc-japan-1990 'japanese-iso-8bit) (define-coding-system-alias 'euc-japan 'japanese-iso-8bit) diff -r 418777d5ccd4 -r fad0f879877f lisp/language/korean.el --- a/lisp/language/korean.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/korean.el Fri Mar 01 02:28:29 2002 +0000 @@ -28,25 +28,26 @@ ;;; Code: -(make-coding-system - 'korean-iso-8bit 2 ?K - "ISO 2022 based EUC encoding for Korean KSC5601 (MIME:EUC-KR)." - '(ascii korean-ksc5601 nil nil - nil ascii-eol ascii-cntl) - '((safe-charsets ascii korean-ksc5601) - (mime-charset . euc-kr))) +(define-coding-system 'korean-iso-8bit + "ISO 2022 based EUC encoding for Korean KSC5601 (MIME:EUC-KR)." + :coding-type 'iso-2022 + :mnemonic ?K + :designation [ascii korean-ksc5601 nil nil] + :charset-list '(ascii korean-ksc5601) + :plist '(mime-charset euc-kr)) (define-coding-system-alias 'euc-kr 'korean-iso-8bit) (define-coding-system-alias 'euc-korea 'korean-iso-8bit) -(make-coding-system - 'iso-2022-kr 2 ?k - "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)." - '(ascii (nil korean-ksc5601) nil nil - nil ascii-eol ascii-cntl seven locking-shift nil nil nil nil nil - designation-bol) - '((safe-charsets ascii korean-ksc5601) - (mime-charset . iso-2022-kr))) +(define-coding-system 'iso-2022-kr + "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)." + :coding-type 'iso-2022 + :mnemonic ?k + :designation [ascii (nil korean-ksc5601) nil nil] + :flags '(ascii-at-eol ascii-at-cntl 7-bit designation locking-shift + designation-bol) + :charset-list '(ascii korean-ksc5601) + :plist '(mime-charset iso-2022-kr)) (define-coding-system-alias 'korean-iso-7bit-lock 'iso-2022-kr) diff -r 418777d5ccd4 -r fad0f879877f lisp/language/lao.el --- a/lisp/language/lao.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/lao.el Fri Mar 01 02:28:29 2002 +0000 @@ -27,41 +27,26 @@ ;;; Code: -(make-coding-system - 'lao 2 ?L - "8-bit encoding for ASCII (MSB=0) and LAO (MSB=1)." - '(ascii lao nil nil - nil nil) - '((safe-charsets ascii lao) - (post-read-conversion . lao-post-read-conversion))) +(define-coding-system 'lao + "8-bit encoding for ASCII (MSB=0) and LAO (MSB=1)." + :coding-type 'charset + :mnemonic ?L + :charset-list '(lao)) (set-language-info-alist "Lao" '((charset lao) (coding-system lao) (coding-priority lao) (input-method . "lao") - (nonascii-translation . lao) (unibyte-display . lao) (features lao-util) (documentation . t))) -(aset use-default-ascent ?(1;(B t) -(aset use-default-ascent ?$,1D;(B t) -(aset use-default-ascent ?(1=(B t) -(aset use-default-ascent ?$,1D=(B t) -(aset use-default-ascent ?(1?(B t) -(aset use-default-ascent ?$,1D?(B t) -(aset use-default-ascent ?(1B(B t) -(aset use-default-ascent ?$,1DB(B t) -(aset ignore-relative-composition ?(1\(B t) -(aset ignore-relative-composition ?$,1D\(B t) - ;; Register a function to compose Lao characters. -(let ((patterns '(("\\c0\\c9?\\(\\(\\c2\\|\\c3\\)\\c4?\\|\\c4\\)?" - . lao-composition-function)))) - (aset composition-function-table (make-char 'lao) patterns) - (dotimes (i (1+ (- #xeff #xe80))) - (aset composition-function-table (decode-char 'ucs (+ i #xe80)) patterns))) +(set-char-table-range composition-function-table + '(#x0F00 . #x0F7F) + '(("\\c0\\c9?\\(\\(\\c2\\|\\c3\\)\\c4?\\|\\c4\\)?" + . lao-composition-function))) (provide 'lao) diff -r 418777d5ccd4 -r fad0f879877f lisp/language/thai.el --- a/lisp/language/thai.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/thai.el Fri Mar 01 02:28:29 2002 +0000 @@ -28,13 +28,11 @@ ;;; Code: -(make-coding-system - 'thai-tis620 2 ?T - "8-bit encoding for ASCII (MSB=0) and Thai TIS620 (MSB=1)." - '(ascii thai-tis620 nil nil - nil ascii-eol) - '((safe-charsets ascii thai-tis620) - (post-read-conversion . thai-post-read-conversion))) +(define-coding-system 'thai-tis620 + "8-bit encoding for ASCII (MSB=0) and Thai TIS620 (MSB=1)." + :coding-type 'charset + :mnemonic ?T + :charset-list '(tis620-2533)) (define-coding-system-alias 'th-tis620 'thai-tis620) (define-coding-system-alias 'tis620 'thai-tis620) @@ -45,7 +43,7 @@ (charset thai-tis620) (coding-system thai-tis620) (coding-priority thai-tis620) - (nonascii-translation . thai-tis620) + (nonascii-translation . tis620-2533) (input-method . "thai-kesmanee") (unibyte-display . thai-tis620) (features thai-util) @@ -56,11 +54,10 @@ ;; Register a function to compose Thai characters. -(let ((patterns '(("\\c0\\c4\\|\\c0\\(\\c2\\|\\c3\\)\\c4?" - . thai-composition-function)))) - (aset composition-function-table (make-char 'thai-tis620) patterns) - (dotimes (i (1+ (- #xe7f #xe00))) - (aset composition-function-table (decode-char 'ucs (+ i #xe00)) patterns))) +(set-char-table-range composition-function-table + '(#x0E00 . #x0E7F) + '(("\\c0\\c4\\|\\c0\\(\\c2\\|\\c3\\)\\c4?" + . thai-composition-function))) (provide 'thai) diff -r 418777d5ccd4 -r fad0f879877f lisp/language/tibetan.el --- a/lisp/language/tibetan.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/tibetan.el Fri Mar 01 02:28:29 2002 +0000 @@ -82,14 +82,12 @@ ;;; -(make-coding-system - 'tibetan-iso-8bit 2 ?Q - "8-bit encoding for ASCII (MSB=0) and TIBETAN (MSB=1)." - '(ascii tibetan nil nil - nil nil) - '((safe-charsets ascii tibetan) - (post-read-conversion . tibetan-post-read-conversion) - (pre-write-conversion . tibetan-pre-write-conversion))) +(define-coding-system 'tibetan-iso-8bit + "8-bit encoding for ASCII (MSB=0) and TIBETAN (MSB=1)." + :coding-type 'iso-2022 + :mnemonic ?Q + :designation [ascii tibetan nil nil] + :charset-list '(ascii tibetan)) (define-coding-system-alias 'tibetan 'tibetan-iso-8bit) @@ -119,8 +117,11 @@ "Regexp matching a composable sequence of Tibetan characters.") ;; Register a function to compose Tibetan characters. -(aset composition-function-table (make-char 'tibetan) - (list (cons tibetan-composable-pattern 'tibetan-composition-function))) +(set-char-table-range composition-function-table + (cons (decode-char 'tibetan #x2121) + (decode-char 'tibetan #x7E7E)) + (list (cons tibetan-composable-pattern + 'tibetan-composition-function))) ;;; ;;; Definitions of conversion data. diff -r 418777d5ccd4 -r fad0f879877f lisp/language/vietnamese.el --- a/lisp/language/vietnamese.el Fri Mar 01 02:22:38 2002 +0000 +++ b/lisp/language/vietnamese.el Fri Mar 01 02:28:29 2002 +0000 @@ -28,139 +28,30 @@ ;;; Code: -(defvar viet-viscii-decode-table - [;; VISCII is a full 8-bit code. - 0 1 ?,2F(B 3 4 ?,2G(B ?,2g(B 7 8 9 10 11 12 13 14 15 - 16 17 18 19 ?,2V(B 21 22 23 24 ?,2[(B 26 27 28 29 ?,2\(B 31 - 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 - 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 - 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 - 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 - 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - ?,2U(B ?,2!(B ?,2"(B ?,2#(B ?,2$(B ?,2%(B ?,2&(B ?,2'(B ?,2((B ?,2)(B ?,2*(B ?,2+(B ?,2,(B ?,2-(B ?,2.(B ?,2/(B - ?,20(B ?,21(B ?,22(B ?,25(B ?,2~(B ?,2>(B ?,26(B ?,27(B ?,28(B ?,2v(B ?,2w(B ?,2o(B ?,2|(B ?,2{(B ?,2x(B ?,2O(B - ?,2u(B ?,1!(B ?,1"(B ?,1#(B ?,1$(B ?,1%(B ?,1&(B ?,1'(B ?,1((B ?,1)(B ?,1*(B ?,1+(B ?,1,(B ?,1-(B ?,1.(B ?,1/(B - ?,10(B ?,11(B ?,12(B ?,2^(B ?,2=(B ?,15(B ?,16(B ?,17(B ?,18(B ?,2q(B ?,2Q(B ?,2W(B ?,2X(B ?,1=(B ?,1>(B ?,2_(B - ?,2`(B ?,2a(B ?,2b(B ?,2c(B ?,2d(B ?,2e(B ?,1F(B ?,1G(B ?,2h(B ?,2i(B ?,2j(B ?,2k(B ?,2l(B ?,2m(B ?,2n(B ?,1O(B - ?,2p(B ?,1Q(B ?,2r(B ?,2s(B ?,2t(B ?,1U(B ?,1V(B ?,1W(B ?,1X(B ?,2y(B ?,2z(B ?,1[(B ?,1\(B ?,2}(B ?,1^(B ?,1_(B - ?,1`(B ?,1a(B ?,1b(B ?,1c(B ?,1d(B ?,1e(B ?,1f(B ?,1g(B ?,1h(B ?,1i(B ?,1j(B ?,1k(B ?,1l(B ?,1m(B ?,1n(B ?,1o(B - ?,1p(B ?,1q(B ?,1r(B ?,1s(B ?,1t(B ?,1u(B ?,1v(B ?,1w(B ?,1x(B ?,1y(B ?,1z(B ?,1{(B ?,1|(B ?,1}(B ?,1~(B ?,2f(B ] - "Vietnamese VISCII decoding table.") - -(let ((table (make-translation-table-from-vector viet-viscii-decode-table))) - (define-translation-table 'viet-viscii-nonascii-translation-table table) - (define-translation-table 'viet-viscii-encode-table - (char-table-extra-slot table 0))) - -(defvar viet-vscii-decode-table - [;; VSCII is a full 8-bit code. - 0 ?,2z(B ?,2x(B 3 ?,2W(B ?,2X(B ?,2f(B 7 8 9 10 11 12 13 14 15 - 16 ?,2Q(B ?,2_(B ?,2O(B ?,2V(B ?,2[(B ?,2}(B ?,2\(B 24 25 26 27 28 29 30 31 - 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 - 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 - 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 - 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 - 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 - ?,2`(B ?,2d(B ?,2c(B ?,2a(B ?,2U(B ?,2#(B ?,2'(B ?,2h(B ?,2k(B ?,2((B ?,2i(B ?,2)(B ?,2.(B ?,2l(B ?,2o(B ?,2n(B - ?,2m(B ?,28(B ?,2r(B ?,2v(B ?,2u(B ?,2s(B ?,2w(B ?,25(B ?,26(B ?,27(B ?,2^(B ?,2>(B ?,2~(B ?,2y(B ?,2|(B ?,2{(B - 160 ?,2e(B ?,2b(B ?,2j(B ?,2t(B ?,2=(B ?,2_(B ?,2p(B ?,1e(B ?,1b(B ?,1j(B ?,1t(B ?,1=(B ?,1y(B ?,1p(B ?,2"(B - 192 193 194 195 196 ?,1`(B ?,1d(B ?,1c(B ?,1a(B ?,1U(B ?,2F(B ?,1"(B ?,1F(B ?,1G(B ?,1!(B ?,2G(B - ?,2!(B ?,2%(B ?,2&(B ?,2g(B ?,2%(B ?,2+(B ?,1#(B ?,1%(B ?,1&(B ?,1g(B ?,1$(B ?,1'(B ?,1h(B ?,2,(B ?,1k(B ?,1((B - ?,1i(B ?,1)(B ?,1+(B ?,1,(B ?,1-(B ?,1*(B ?,1.(B ?,1l(B ?,1o(B ?,2-(B ?,2*(B ?,20(B ?,1n(B ?,1m(B ?,18(B ?,1r(B - ?,21(B ?,1v(B ?,1u(B ?,1s(B ?,1w(B ?,10(B ?,11(B ?,12(B ?,1/(B ?,15(B ?,16(B ?,17(B ?,1^(B ?,1>(B ?,1~(B ?,1y(B - ?,22(B ?,1|(B ?,1{(B ?,1z(B ?,1x(B ?,1W(B ?,1X(B ?,1f(B ?,1Q(B ?,1q(B ?,1O(B ?,1V(B ?,1[(B ?,1}(B ?,1\(B ?,2/(B] - "Vietnamese VSCII decoding table.") - -(let ((table (make-translation-table-from-vector viet-vscii-decode-table))) - (define-translation-table 'viet-vscii-nonascii-translation-table table) - (define-translation-table 'viet-vscii-encode-table - (char-table-extra-slot table 0))) - -(define-ccl-program ccl-decode-viscii - `(3 - ((loop - (r0 = 0) - (read r1) - (translate-character viet-viscii-nonascii-translation-table r0 r1) - (write-multibyte-character r0 r1) - (repeat)))) - "CCL program to decode VISCII 1.1") - -(define-ccl-program ccl-encode-viscii - `(1 - ((loop - (read-multibyte-character r0 r1) - (translate-character viet-viscii-encode-table r0 r1) - (write-repeat r1)))) - "CCL program to encode VISCII 1.1") - -(define-ccl-program ccl-encode-viscii-font - `(0 - ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper - ;; R1:position code - ;; Out: R1:font code point - (translate-character viet-viscii-encode-table r0 r1)) - "CCL program to encode Vietnamese chars to VISCII 1.1 font") - -(define-ccl-program ccl-decode-vscii - `(3 - ((loop - (r0 = 0) - (read r1) - (translate-character viet-vscii-nonascii-translation-table r0 r1) - (write-multibyte-character r0 r1) - (repeat)))) - "CCL program to decode VSCII-1.") - -(define-ccl-program ccl-encode-vscii - `(1 - ((loop - (read-multibyte-character r0 r1) - (translate-character viet-vscii-encode-table r0 r1) - (write-repeat r1)))) - "CCL program to encode VSCII-1.") - -(define-ccl-program ccl-encode-vscii-font - `(0 - ;; In: R0:vietnamese-viscii-lower/vietnamese-viscii-upper - ;; R1:position code - ;; Out: R1:font code point - (translate-character viet-vscii-encode-table r0 r1)) - "CCL program to encode Vietnamese chars to VSCII-1 font.") - - -(make-coding-system - 'vietnamese-viscii 4 ?V - "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)." - '(ccl-decode-viscii . ccl-encode-viscii) - '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper) - (mime-charset . viscii) - (valid-codes (0 . 255)))) +(define-coding-system 'vietnamese-viscii + "8-bit encoding for Vietnamese VISCII 1.1 (MIME:VISCII)." + :coding-type 'charset + :mnemonic ?V + :charset-list '(viscii) + :plist '(mime-charset viscii)) (define-coding-system-alias 'viscii 'vietnamese-viscii) -(make-coding-system - 'vietnamese-vscii 4 ?v - "8-bit encoding for Vietnamese VSCII-1." - '(ccl-decode-vscii . ccl-encode-vscii) - '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper) - (valid-codes (0 . 255)))) +(define-coding-system 'vietnamese-vscii + "8-bit encoding for Vietnamese VSCII-1." + :coding-type 'charset + :mnemonic ?v + :charset-list '(vscii)) (define-coding-system-alias 'vscii 'vietnamese-vscii) -(make-coding-system - 'vietnamese-viqr 0 ?q - "Encoding for Vietnamese latin transcription (VIQR)." - nil - '((safe-charsets ascii vietnamese-viscii-lower vietnamese-viscii-upper) - (post-read-conversion . viqr-post-read-conversion) - (pre-write-conversion . viqr-pre-write-conversion) - (charset-origin-alist - (vietnamese-viscii-lower "VISCII" viet-encode-viscii-char) - (vietnamese-viscii-upper "VISCII" viet-encode-viscii-char)))) - +(define-coding-system 'vietnamese-viqr + "Vietnamese latin transcription (VIQR)." + :coding-type 'utf-8 + :mnemonic ?q + :charset-list '(ascii viscii) + :post-read-conversion 'viqr-post-read-conversion + :pre-write-conversion 'viqr-pre-write-conversion) (define-coding-system-alias 'viqr 'vietnamese-viqr) @@ -171,13 +62,11 @@ (cons '("vscii" . ccl-encode-vscii-font) font-ccl-encoder-alist)) (set-language-info-alist - "Vietnamese" `((charset vietnamese-viscii-lower vietnamese-viscii-upper) - (nonascii-translation - . ,(get 'viet-viscii-nonascii-translation-table - 'translation-table)) + "Vietnamese" `((charset viscii) (coding-system vietnamese-viscii vietnamese-vscii vietnamese-viqr) (coding-priority vietnamese-viscii) + (nonascii-translation . viscii) (input-method . "vietnamese-viqr") (unibyte-display . vietnamese-viscii) (features viet-util)