]> code.delx.au - gnu-emacs/commitdiff
Optimize calls of modify-category-entry.
authorKenichi Handa <handa@m17n.org>
Tue, 5 Mar 2002 00:06:48 +0000 (00:06 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 5 Mar 2002 00:06:48 +0000 (00:06 +0000)
lisp/international/characters.el

index 64b6e6abd34a586b4e6c580ec1783819a52a1082..8e4559c728f0ac530d178186ba7250290c768f94 100644 (file)
 
 ;; ASCII
 
-(let ((ch 32))
-  (while (< ch 127)                    ; All ASCII characters have
-    (modify-category-entry ch ?a)      ; the category `a' (ASCII)
-    (modify-category-entry ch ?l)      ; and `l' (Latin).
-    (setq ch (1+ ch))))
+;; All ASCII characters have the category `a' (ASCII) and `l' (Latin).
+(modify-category-entry '(32 . 127) ?a)
+(modify-category-entry '(32 . 127) ?l)
 
 ;; Arabic character set
 
   (while charsets
 ;;     (modify-syntax-entry (make-char (car charsets)) "w")
     (map-charset-chars
-     #'(lambda (char ignore)
-        (if (consp char)
-            (let ((from (car char))
-                  (to (cdr char)))
-              (while (<= from to)
-                (modify-category-entry from ?b)
-                (setq from (1+ from))))
-          (modify-category-entry char ?b)))
+     #'(lambda (char ignore) (modify-category-entry char ?b))
      (car charsets))
     (setq charsets (cdr charsets))))
-(let ((ch #x600))
-  (while (<= ch #x6ff)
-    (modify-category-entry (decode-char 'ucs ch) ?b)
-    (setq ch (1+ ch)))
-  (setq ch #xfb50)
-  (while (<= ch #xfdff)
-    (modify-category-entry (decode-char 'ucs ch) ?b)
-    (setq ch (1+ ch)))
-  (setq ch #xfe70)
-  (while (<= ch #xfefe)
-    (modify-category-entry (decode-char 'ucs ch) ?b)
-    (setq ch (1+ ch))))
+(modify-category-entry '(#x600 . #x6ff) ?b)
+(modify-category-entry '(#xfb50 . #xfdff) ?b)
+(modify-category-entry '(#xfe70 . #xfefe) ?b)
 
 ;; Chinese character set (GB2312)
 
 
 ;; (modify-category-entry (make-char 'ethiopic) ?e)
 ;; (modify-syntax-entry (make-char 'ethiopic) "w")
-(dotimes (i (1+ (- #x137c #x1200)))
-  (modify-category-entry (decode-char 'ucs (+ #x1200 i)) ?e))
+(modify-category-entry '(#x1200 . #x137b) ?e)
 (let ((chars '(?\e$(3$h\e(B ?\e$(3$i\e(B ?\e$(3$j\e(B ?\e$(3$k\e(B ?\e$(3$l\e(B ?\e$(3$m\e(B ?\e$(3$n\e(B ?\e$(3$o\e(B ?\e$(3%i\e(B ?\e$(3%t\e(B ?\e$(3%u\e(B ?\e$(3%v\e(B ?\e$(3%w\e(B ?\e$(3%x\e(B
               ;; Unicode equivalents of the above:
               ?\e$,1Q!\e(B ?\e$,1Q"\e(B ?\e$,1Q#\e(B ?\e$,1Q$\e(B ?\e$,1Q%\e(B ?\e$,1Q&\e(B ?\e$,1Q'\e(B ?\e$,1Q(\e(B ?\e$,3op\e(B ?\e$,3o{\e(B ?\e$,3o|\e(B ?\e$,3o}\e(B ?\e$,3o~\e(B ?\e$,3o\7f\e(B)))