/[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.33 by fx, Wed Sep 11 21:07:00 2002 UTC revision 1.34 by handa, Mon Sep 30 06:34:40 2002 UTC
# Line 42  Line 42 
42  ;; Alternativnyj coding systems encode both 8859-5 and Unicode.  ;; Alternativnyj coding systems encode both 8859-5 and Unicode.
43  ;; ucs-tables.el provides unification for cyrillic-iso-8bit.  ;; ucs-tables.el provides unification for cyrillic-iso-8bit.
44    
45  ;; Customizing `utf-8-fragment-on-decoding' allows decoding characters  ;; Customizing `utf-fragment-on-decoding' allows decoding characters
46  ;; from KOI and Alternativnyj into 8859-5 where that's possible.  ;; from KOI and Alternativnyj into 8859-5 where that's possible.
47  ;; cyrillic-iso8859-5 characters take half as much space in the buffer  ;; cyrillic-iso8859-5 characters take half as much space in the buffer
48  ;; as the mule-unicode-0100-24ff equivalents, though that's probably  ;; as the mule-unicode-0100-24ff equivalents, though that's probably
# Line 130  Line 130 
130        (if (r1 < 128)        (if (r1 < 128)
131            (write-repeat r1)            (write-repeat r1)
132          ((translate-character cyrillic-koi8-r-nonascii-translation-table r0 r1)          ((translate-character cyrillic-koi8-r-nonascii-translation-table r0 r1)
133           (translate-character utf-8-translation-table-for-decode r0 r1)           (translate-character ucs-translation-table-for-decode r0 r1)
134           (write-multibyte-character r0 r1)           (write-multibyte-character r0 r1)
135           (repeat))))))           (repeat))))))
136    "CCL program to decode KOI8-R.")    "CCL program to decode KOI8-R.")
# Line 145  Line 145 
145    
146  (defun cyrillic-unify-encoding (table)  (defun cyrillic-unify-encoding (table)
147    "Set up equivalent characters in the encoding TABLE.    "Set up equivalent characters in the encoding TABLE.
148  This works wheher or not the table is is Unicode-based or  This works whether or not the table is Unicode-based or
149  8859-5-based.  (Only appropriate for Cyrillic.)"  8859-5-based.  (Only appropriate for Cyrillic.)"
150    (let ((table (get table 'translation-table)))    (let ((table (get table 'translation-table)))
151      (dotimes (i 96)      (dotimes (i 96)
# Line 175  This works wheher or not the table is is Line 175  This works wheher or not the table is is
175   '(ccl-decode-koi8 . ccl-encode-koi8)   '(ccl-decode-koi8 . ccl-encode-koi8)
176   `((safe-chars . cyrillic-koi8-r-encode-table)   `((safe-chars . cyrillic-koi8-r-encode-table)
177     (mime-charset . koi8-r)     (mime-charset . koi8-r)
178     (valid-codes (0 . 255))))     (valid-codes (0 . 255))
179       (dependency unify-8859-on-encoding-mode unify-8859-on-decoding-mode)))
180    
181  (define-coding-system-alias 'koi8-r 'cyrillic-koi8)  (define-coding-system-alias 'koi8-r 'cyrillic-koi8)
182  (define-coding-system-alias 'koi8 'cyrillic-koi8)  (define-coding-system-alias 'koi8 'cyrillic-koi8)
# Line 266  This works wheher or not the table is is Line 267  This works wheher or not the table is is
267        (if (r1 < 128)        (if (r1 < 128)
268            (write-repeat r1)            (write-repeat r1)
269          ((translate-character cyrillic-koi8-u-nonascii-translation-table r0 r1)          ((translate-character cyrillic-koi8-u-nonascii-translation-table r0 r1)
270           (translate-character utf-8-translation-table-for-decode r0 r1)           (translate-character ucs-translation-table-for-decode r0 r1)
271           (write-multibyte-character r0 r1)           (write-multibyte-character r0 r1)
272           (repeat))))))           (repeat))))))
273    "CCL program to decode KOI8-U.")    "CCL program to decode KOI8-U.")
# Line 287  This works wheher or not the table is is Line 288  This works wheher or not the table is is
288   '(ccl-decode-koi8-u . ccl-encode-koi8-u)   '(ccl-decode-koi8-u . ccl-encode-koi8-u)
289   `((safe-chars . cyrillic-koi8-u-encode-table)   `((safe-chars . cyrillic-koi8-u-encode-table)
290     (mime-charset . koi8-u)     (mime-charset . koi8-u)
291     (valid-codes (0 . 255))))     (valid-codes (0 . 255))
292       (dependency unify-8859-on-encoding-mode unify-8859-on-decoding-mode)))
293    
294  (define-ccl-program ccl-encode-koi8-u-font  (define-ccl-program ccl-encode-koi8-u-font
295    `(0    `(0
# Line 298  This works wheher or not the table is is Line 300  This works wheher or not the table is is
300    
301  (set-language-info-alist  (set-language-info-alist
302   "Ukrainian" `((coding-system koi8-u)   "Ukrainian" `((coding-system koi8-u)
303                (coding-priority koi8-u)                 (coding-priority koi8-u)
304                 (nonascii-translation                 (nonascii-translation
305                  . ,(get 'cyrillic-koi8-u-nonascii-translation-table                  . ,(get 'cyrillic-koi8-u-nonascii-translation-table
306                          'translation-table))                          'translation-table))
307                 (input-method . "ukrainian-computer")                 (input-method . "ukrainian-computer")
308                (features code-pages)                 (features code-pages)
309                (documentation                 (documentation
310                 . "Support for Ukrainian with KOI8-U character set."))                  . "Support for Ukrainian with KOI8-U character set."))
311   '("Cyrillic"))   '("Cyrillic"))
312    
313  ;;; ALTERNATIVNYJ stuff  ;;; ALTERNATIVNYJ stuff
# Line 360  This works wheher or not the table is is Line 362  This works wheher or not the table is is
362            (write-repeat r1)            (write-repeat r1)
363          ((translate-character cyrillic-alternativnyj-nonascii-translation-table          ((translate-character cyrillic-alternativnyj-nonascii-translation-table
364                                r0 r1)                                r0 r1)
365           (translate-character utf-8-translation-table-for-decode r0 r1)           (translate-character ucs-translation-table-for-decode r0 r1)
366           (write-multibyte-character r0 r1)           (write-multibyte-character r0 r1)
367           (repeat))))))           (repeat))))))
368    "CCL program to decode Alternativnyj.")    "CCL program to decode Alternativnyj.")
# Line 383  This works wheher or not the table is is Line 385  This works wheher or not the table is is
385   '(ccl-decode-alternativnyj . ccl-encode-alternativnyj)   '(ccl-decode-alternativnyj . ccl-encode-alternativnyj)
386   `((safe-chars . cyrillic-alternativnyj-encode-table)   `((safe-chars . cyrillic-alternativnyj-encode-table)
387     (valid-codes (0 . 255))     (valid-codes (0 . 255))
388     (mime-charset . cp866)))     (mime-charset . cp866)
389       (dependency unify-8859-on-encoding-mode unify-8859-on-decoding-mode)))
390    
391  (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj)  (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj)
392  (define-coding-system-alias 'cp866 'cyrillic-alternativnyj)  (define-coding-system-alias 'cp866 'cyrillic-alternativnyj)

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

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