]> code.delx.au - gnu-emacs/commitdiff
Use aref instead of sref.
authorKenichi Handa <handa@m17n.org>
Wed, 4 Feb 1998 11:25:47 +0000 (11:25 +0000)
committerKenichi Handa <handa@m17n.org>
Wed, 4 Feb 1998 11:25:47 +0000 (11:25 +0000)
lisp/international/characters.el
lisp/international/kinsoku.el

index 5f30a79c87e9962ac4815cad235b79b77084d4be..4eec1209a8a72cc15150c05225489f8a3503cbf3 100644 (file)
     (while (< i len)
       (if (= (aref chars i) ?-)
          (setq i (1+ i)
-               to (sref chars i))
-       (setq ch (sref chars i)
+               to (aref chars i))
+       (setq ch (aref chars i)
              to ch))
       (while (<= ch to)
        (modify-syntax-entry ch syntax)
        (modify-category-entry ch category)
        (setq ch (1+ ch)))
-      (setq i (+ i (char-bytes to))))
+      (setq i (1+ i)))
     (setq deflist (cdr deflist))))
 
 ;; Ethiopic character set
 (modify-category-entry (make-char 'indian-2-column) ?I)
 (modify-category-entry (make-char 'indian-1-column) ?I)
 
+(let ((deflist 
+       '(;; chars      syntax  category
+         ("\e(5!"#\e(B"  "w"     ?7) ; vowel-modifying diacritical mark
+                                   ; chandrabindu, anuswar, visarga
+         ("\e(5$\e(B-\e(52\e(B"    "w"     ?1) ; base (independent) vowel
+         ("\e(53\e(B-\e(5X\e(B"    "w"     ?0) ; consonant
+         ("\e(5Z\e(B-\e(5g\e(B"    "w"     ?8) ; matra
+         ("\e(5q\e(B-\e(5z\e(B"    "w"     ?6) ; digit
+         ))
+      elm chars len syntax category to ch i)
+  (while deflist
+    (setq elm (car deflist))
+    (setq chars (car elm)
+         len (length chars)
+         syntax (nth 1 elm)
+         category (nth 2 elm)
+         i 0)
+    (while (< i len)
+      (if (= (aref chars i) ?-)
+         (setq i (1+ i)
+               to (aref chars i))
+       (setq ch (aref chars i)
+             to ch))
+      (while (<= ch to)
+       (modify-syntax-entry ch syntax)
+       (modify-category-entry ch category)
+       (setq ch (1+ ch)))
+      (setq i (1+ i)))
+    (setq deflist (cdr deflist))))
+
+
 ;; Japanese character set (JISX0201-kana, JISX0201-roman, JISX0208, JISX0212)
 
 (modify-category-entry (make-char 'katakana-jisx0201) ?k)
     (while (< i len)
       (if (= (aref chars i) ?-)
          (setq i (1+ i)
-               to (sref chars i))
-       (setq ch (sref chars i)
+               to (aref chars i))
+       (setq ch (aref chars i)
              to ch))
       (while (<= ch to)
        (modify-syntax-entry ch syntax)
        (modify-category-entry ch category)
        (setq ch (1+ ch)))
-      (setq i (+ i (char-bytes to))))
+      (setq i (1+ i)))
     (setq deflist (cdr deflist))))
 
 ;; Thai character set (TIS620)
     (while (< i len)
       (if (= (aref chars i) ?-)
          (setq i (1+ i)
-               to (sref chars i))
-       (setq ch (sref chars i)
+               to (aref chars i))
+       (setq ch (aref chars i)
              to ch))
       (while (<= ch to)
        (modify-syntax-entry ch syntax)
        (modify-category-entry ch category)
        (setq ch (1+ ch)))
-      (setq i (+ i (char-bytes to))))
+      (setq i (1+ i)))
     (setq deflist (cdr deflist))))
 
 ;; Tibetan character set
     (while (< i len)
       (if (= (aref chars i) ?-)
          (setq i (1+ i)
-               to (sref chars i))
-       (setq ch (sref chars i)
+               to (aref chars i))
+       (setq ch (aref chars i)
              to ch))
       (while (<= ch to)
        (modify-syntax-entry ch syntax)
        (modify-category-entry ch category)
        (setq ch (1+ ch)))
-      (setq i (+ i (char-bytes to))))
+      (setq i (1+ i)))
     (setq deflist (cdr deflist))))
 
 ;; Vietnamese character set
index 764d181c5b354014ceb627029d30149af069dd7c..53c26f7d593127cd0e4f48d30e7f9a3251cb295b 100644 (file)
@@ -78,8 +78,8 @@ The value 0 means there's no limitation.")
        (idx 0)
        ch)
   (while (< idx len)
-    (setq ch (sref kinsoku-bol idx)
-         idx (+ idx (char-bytes ch)))
+    (setq ch (aref kinsoku-bol idx)
+         idx (1+ idx))
     (modify-category-entry ch ?>)))
 
 ;; Setting character category `<' for characters which should not be
@@ -115,8 +115,8 @@ The value 0 means there's no limitation.")
        (idx 0)
        ch)
   (while (< idx len)
-    (setq ch (sref kinsoku-eol idx)
-         idx (+ idx (char-bytes ch)))
+    (setq ch (aref kinsoku-eol idx)
+         idx (1+ idx))
     (modify-category-entry ch ?<)))
 
 ;; Try to resolve `kinsoku' restriction by making the current line longer.