changeset 30495:491e0864dd18

(cyrillic-koi8): Use `safe-chars' property instead of `safe-charsets'. (cyrillic-alternativnyj): Likewise. (ccl-encode-alternativnyj): Don't check the charset cyrillic-iso8859-5.
author Kenichi Handa <handa@m17n.org>
date Thu, 27 Jul 2000 06:22:42 +0000
parents 0cb71f4faae1
children 25d798a40775
files lisp/language/cyrillic.el
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/language/cyrillic.el	Thu Jul 27 06:22:00 2000 +0000
+++ b/lisp/language/cyrillic.el	Thu Jul 27 06:22:42 2000 +0000
@@ -112,7 +112,12 @@
  ;; will have to forgive us.
  ?R "KOI8 8-bit encoding for Cyrillic (MIME: KOI8-R)"
  '(ccl-decode-koi8 . ccl-encode-koi8)
- '((safe-charsets ascii cyrillic-iso8859-5)
+ `((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"
@@ -190,8 +195,7 @@
   `(1
     ((loop
       (read-multibyte-character r0 r1)
-      (if (r0 == ,(charset-id 'cyrillic-iso8859-5))
-	  (translate-character cyrillic-alternativnyj-encode-table r0 r1))
+      (translate-character cyrillic-alternativnyj-encode-table r0 r1)
       (write-repeat r1))))
   "CCL program to encode Alternativnyj.")
 	     
@@ -199,7 +203,13 @@
  'cyrillic-alternativnyj 4 ?A
  "ALTERNATIVNYJ 8-bit encoding for Cyrillic"
  '(ccl-decode-alternativnyj . ccl-encode-alternativnyj)
- '((safe-charsets ascii cyrillic-iso8859-5)
+ `((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))))