/[emacs]/emacs/lisp/language/cyrillic.el
ViewVC logotype

Diff of /emacs/lisp/language/cyrillic.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30 by wl, Tue Dec 18 17:50:12 2001 UTC revision 1.30.2.1 by handa, Fri Mar 1 02:28:29 2002 UTC
# Line 34  Line 34 
34    
35  ;; ISO-8859-5 staff  ;; ISO-8859-5 staff
36    
37  (make-coding-system  (define-coding-system 'cyrillic-iso-8bit
38   'cyrillic-iso-8bit 2 ?5    "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)."
39   "ISO 2022 based 8-bit encoding for Cyrillic script (MIME:ISO-8859-5)."    :coding-type 'charset
40   '(ascii cyrillic-iso8859-5  nil nil    :mnemonic ?5
41     nil nil nil nil nil nil nil)    :charset-list '(iso-8859-5)
42   '((safe-charsets ascii cyrillic-iso8859-5)    :plist '(mime-charset iso-8859-5))
    (mime-charset . iso-8859-5)))  
43    
44  (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit)  (define-coding-system-alias 'iso-8859-5 'cyrillic-iso-8bit)
45    
46  (set-language-info-alist  (set-language-info-alist
47   "Cyrillic-ISO" '((charset cyrillic-iso8859-5)   "Cyrillic-ISO" '((charset iso-8859-5)
48                    (coding-system cyrillic-iso-8bit)                    (coding-system cyrillic-iso-8bit)
49                    (coding-priority cyrillic-iso-8bit)                    (coding-priority cyrillic-iso-8bit)
50                      (nonascii-translation . iso-8859-5)
51                    (input-method . "cyrillic-yawerty")                    (input-method . "cyrillic-yawerty")
                   (nonascii-translation . cyrillic-iso8859-5)  
52                    (unibyte-display . cyrillic-iso-8bit)                    (unibyte-display . cyrillic-iso-8bit)
53                    (features cyril-util)                    (features cyril-util)
54                    (sample-text . "Russian (,L@caaZXY(B)       ,L7T`PRabRcYbU(B!")                    (sample-text . "Russian (,L@caaZXY(B)       ,L7T`PRabRcYbU(B!")
# Line 58  Line 57 
57    
58  ;; KOI-8 staff  ;; KOI-8 staff
59    
60  (defvar cyrillic-koi8-r-decode-table  (define-coding-system 'cyrillic-koi8
61    [    "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)."
62     0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15    :coding-type 'charset
63     16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31    ;; We used to use ?K.  It is true that ?K is more strictly correct,
64     32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47    ;; but it is also used for Korean.  So people who use koi8 for
65     48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63    ;; languages other than Russian will have to forgive us.
66     64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79    :mnemonic ?R
67     80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95    :charset-list '(koi8)
68     96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111    :plist '(mime-charset koi8-r))
    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))))  
69    
70  (define-coding-system-alias 'koi8-r 'cyrillic-koi8)  (define-coding-system-alias 'koi8-r 'cyrillic-koi8)
71  (define-coding-system-alias 'koi8 'cyrillic-koi8)  (define-coding-system-alias 'koi8 'cyrillic-koi8)
72    
 (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))  
   
73  (set-language-info-alist  (set-language-info-alist
74   "Cyrillic-KOI8" `((charset cyrillic-iso8859-5)   "Cyrillic-KOI8" `((charset koi8)
                    (nonascii-translation  
                     . ,(get 'cyrillic-koi8-r-nonascii-translation-table  
                             'translation-table))  
75                     (coding-system cyrillic-koi8)                     (coding-system cyrillic-koi8)
76                     (coding-priority cyrillic-koi8)                     (coding-priority cyrillic-koi8)
77                       (nonascii-translation . koi8)
78                     (input-method . "cyrillic-jcuken")                     (input-method . "cyrillic-jcuken")
79                     (features cyril-util)                     (features cyril-util)
80                     (unibyte-display . cyrillic-koi8)                     (unibyte-display . cyrillic-koi8)
# Line 152  Line 84 
84    
85  ;;; ALTERNATIVNYJ staff  ;;; ALTERNATIVNYJ staff
86    
87  (defvar cyrillic-alternativnyj-decode-table  (define-coding-system 'cyrillic-alternativnyj
88    [    "ALTERNATIVNYJ 8-bit encoding for Cyrillic."
89     0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15    :coding-type 'charset
90     16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31    :mnemonic ?A
91     32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47    :charset-list '(alternativnyj))
    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))))  
   
92    
93  (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj)  (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj)
94    
 (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))  
   
95  (set-language-info-alist  (set-language-info-alist
96   "Cyrillic-ALT" `((charset cyrillic-iso8859-5)   "Cyrillic-ALT" `((charset alternativnyj)
                   (nonascii-translation  
                    . ,(get 'cyrillic-alternativnyj-nonascii-translation-table  
                            'translation-table))  
97                    (coding-system cyrillic-alternativnyj)                    (coding-system cyrillic-alternativnyj)
98                    (coding-priority cyrillic-alternativnyj)                    (coding-priority cyrillic-alternativnyj)
99                      (nonascii-translation . alternativnyj)
100                    (input-method . "cyrillic-jcuken")                    (input-method . "cyrillic-jcuken")
101                    (features cyril-util)                    (features cyril-util)
102                    (unibyte-display . cyrillic-alternativnyj)                    (unibyte-display . cyrillic-alternativnyj)

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.30.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26