changeset 88752:1aeb58b4f1e1

Fix the last change.
author Kenichi Handa <handa@m17n.org>
date Wed, 12 Jun 2002 00:16:54 +0000
parents 809b6bfe4dfa
children 444ef6485085
files lisp/international/characters.el
diffstat 1 files changed, 66 insertions(+), 158 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/characters.el	Wed Jun 12 00:16:33 2002 +0000
+++ b/lisp/international/characters.el	Wed Jun 12 00:16:54 2002 +0000
@@ -118,32 +118,19 @@
 (modify-category-entry '(#xfb50 . #xfdff) ?b)
 (modify-category-entry '(#xfe70 . #xfefe) ?b)
 
+;; Chinese characters (Unicode)
+(modify-category-entry '(#x3400 . #x9FAF) ?C)
+(modify-category-entry '(#x3400 . #x9FAF) ?c)
+(modify-category-entry '(#x3400 . #x9FAF) ?|)
+(modify-category-entry '(#xF900 . #xFAFF) ?C)
+(modify-category-entry '(#xF900 . #xFAFF) ?c)
+(modify-category-entry '(#xF900 . #xFAFF) ?|)
+
 ;; Chinese character set (GB2312)
 
-(modify-syntax-entry (cons (make-char 'chinese-gb2312 33 33)
-			   (make-char 'chinese-gb2312 33 126))
-		     "_")
-(modify-syntax-entry (cons (make-char 'chinese-gb2312 34 33)
-			   (make-char 'chinese-gb2312 34 126))
-		     "_")
-(modify-syntax-entry (cons (make-char 'chinese-gb2312 41 33)
-			   (make-char 'chinese-gb2312 41 126))
-		     "_")
-(modify-category-entry (cons (make-char 'chinese-gb2312 35 33)
-			     (make-char 'chinese-gb2312 35 126))
-		       ?A)
-(modify-category-entry (cons (make-char 'chinese-gb2312 36 33)
-			     (make-char 'chinese-gb2312 36 126))
-		       ?H)
-(modify-category-entry (cons (make-char 'chinese-gb2312 37 33)
-			     (make-char 'chinese-gb2312 37 126))
-		       ?K)
-(modify-category-entry (cons (make-char 'chinese-gb2312 38 33)
-			     (make-char 'chinese-gb2312 38 126))
-		       ?G)
-(modify-category-entry (cons (make-char 'chinese-gb2312 39 33)
-			     (make-char 'chinese-gb2312 39 126))
-		       ?Y)
+(map-charset-chars #'modify-syntax-entry 'chinese-gb2312 "_" #x2121 #x217E)
+(map-charset-chars #'modify-syntax-entry 'chinese-gb2312 "_" #x2221 #x227E)
+(map-charset-chars #'modify-syntax-entry 'chinese-gb2312 "_" #x2921 #x297E)
 (modify-syntax-entry ?\〔 "(〕")
 (modify-syntax-entry ?\〈 "(〉")
 (modify-syntax-entry ?\《 "(》")
@@ -161,12 +148,12 @@
 
 (map-charset-chars #'modify-category-entry 'chinese-gb2312 ?c)
 (map-charset-chars #'modify-category-entry 'chinese-gb2312 ?|)
-(let ((row 48))
-  (while (< row 127)
-    (modify-category-entry (cons (make-char 'chinese-gb2312 row 33)
-				 (make-char 'chinese-gb2312 row 126))
-			   ?C)
-    (setq row (1+ row))))
+(map-charset-chars #'modify-category-entry 'chinese-gb2312 ?A #x2321 #x237E)
+(map-charset-chars #'modify-category-entry 'chinese-gb2312 ?H #x2421 #x247E)
+(map-charset-chars #'modify-category-entry 'chinese-gb2312 ?K #x2521 #x257E)
+(map-charset-chars #'modify-category-entry 'chinese-gb2312 ?G #x2621 #x267E)
+(map-charset-chars #'modify-category-entry 'chinese-gb2312 ?Y #x2721 #x277E)
+(map-charset-chars #'modify-category-entry 'chinese-gb2312 ?C #x3021 #x7E7E)
 
 ;; Chinese character set (BIG5)
 
@@ -302,122 +289,70 @@
 
 ;; Japanese character set (JISX0201-kana, JISX0201-roman, JISX0208, JISX0212)
 
-(map-charset-chars
- #'(lambda (char ignore)
-     (if (consp char)
-	 (let ((from (car char))
-	       (to (car char)))
-	   (while (<= from to)
-	     (modify-category-entry from ?k)
-	     (setq from (1+ from))))
-       (modify-category-entry char ?k)))
- 'katakana-jisx0201)
+(map-charset-chars #'modify-category-entry 'katakana-jisx0201 ?k)
+
+(map-charset-chars #'modify-category-entry 'latin-jisx0201 ?r)
 
-(map-charset-chars
- #'(lambda (char ignore)
-     (if (consp char)
-	 (let ((from (car char))
-	       (to (cdr char)))
-	   (while (<= from to)
-	     (modify-category-entry from ?r)
-	     (setq from (1+ from))))
-       (modify-category-entry char ?r)))
- 'latin-jisx0201)
 (dolist (l '(katakana-jisx0201 japanese-jisx0208 japanese-jisx0212))
-  (map-charset-chars
-   #'(lambda (char ignore)
-       (if (consp char)
-	   (let ((from (car char))
-		 (to (cdr char)))
-	     (while (<= from to)
-	       (modify-category-entry from ?j)
-	       (modify-category-entry from ?\|)
-	       (setq from (1+ from))))
-	 (modify-category-entry char ?j)
-	 (modify-category-entry char ?\|)))
-   l))
+  (map-charset-chars #'modify-category-entry l ?j)
+  (map-charset-chars #'modify-category-entry l ?\|))
 
 ;; Unicode equivalents of JISX0201-kana
-(let ((c #xff61))
-  (while (<= c #xff9f)
-    (modify-category-entry c ?k)
-    (modify-category-entry c ?j)
-    (modify-category-entry c ?\|)
-    (setq c (1+ c))))
+(let ((range '(#xff61 . #xff9f)))
+  (modify-category-entry range  ?k)
+  (modify-category-entry range ?j)
+  (modify-category-entry range ?\|))
 
 ;; Katakana block
-(let ((c #x30a0))
-  (while (<= c #x30ff)
-    ;; ?K is double width, ?k isn't specified
-    (modify-category-entry c ?K)
-    (modify-category-entry c ?\|) 
-    (setq c (1+ c))))
+(let ((range '(#x30a0 . #x30ff)))
+  ;; ?K is double width, ?k isn't specified
+  (modify-category-entry range ?K)
+  (modify-category-entry range ?\|))
 
 ;; Hiragana block
-(let ((c #x3040))
-  (while (<= c #x309f)
-    ;; ?H is actually defined to be double width
-    (modify-category-entry c ?H)
-    (modify-category-entry c ?\|) 
-    (setq c (1+ c))))
+(let ((range '(#x3040 . #x309f)))
+  ;; ?H is actually defined to be double width
+  ;;(modify-category-entry range ?H)
+  ;;(modify-category-entry range ?\|)
+  )
 
 ;; JISX0208
-(modify-syntax-entry (cons (decode-char 'japanese-jisx0208 #x2121)
-			   (decode-char 'japanese-jisx0208 #x227E)) "_")
-(modify-syntax-entry (cons (decode-char 'japanese-jisx0208 #x2821)
-			   (decode-char 'japanese-jisx0208 #x287E)) "_")
-(let ((chars '(? ? ? ? ? ? ? ? ? ? ? ?)))
+(map-charset-chars #'modify-syntax-entry 'japanese-jisx0208 "_" #x2121 #x227E)
+(map-charset-chars #'modify-syntax-entry 'japanese-jisx0208 "_" #x2821 #x287E)
+(let ((chars '(?ー ?゛ ?゜ ?ヽ ?ヾ ?ゝ ?ゞ ?〃 ?仝 ?々 ?〆 ?〇)))
   (dolist (elt chars)
     (modify-syntax-entry (car chars) "w")))
-(modify-syntax-entry ?\ "(")
-(modify-syntax-entry ?\ "(")
-(modify-syntax-entry ?\ "(")
-(modify-syntax-entry ?\ "(")
-(modify-syntax-entry ?\ "(")
-(modify-syntax-entry ?\ ")")
-(modify-syntax-entry ?\ ")")
-(modify-syntax-entry ?\ ")")
-(modify-syntax-entry ?\ ")")
-(modify-syntax-entry ?\ ")")
+(modify-syntax-entry ?\( "()")
+(modify-syntax-entry ?\[ "(]")
+(modify-syntax-entry ?\{ "(}")
+(modify-syntax-entry ?\「 "(」")
+(modify-syntax-entry ?\『 "(』")
+(modify-syntax-entry ?\) ")(")
+(modify-syntax-entry ?\] ")[")
+(modify-syntax-entry ?\} "){")
+(modify-syntax-entry ?\」 ")「")
+(modify-syntax-entry ?\』 ")『")
 
-(modify-category-entry (cons (decode-char 'japanese-jisx0208 #x2321)
-			     (decode-char 'japanese-jisx0208 #x237E)) ?A)
-(modify-category-entry (cons (decode-char 'japanese-jisx0208 #x2421)
-			     (decode-char 'japanese-jisx0208 #x247E)) ?H)
-(modify-category-entry (cons (decode-char 'japanese-jisx0208 #x2521)
-			     (decode-char 'japanese-jisx0208 #x257E)) ?K)
-(modify-category-entry (cons (decode-char 'japanese-jisx0208 #x2621)
-			     (decode-char 'japanese-jisx0208 #x267E)) ?G)
-(modify-category-entry (cons (decode-char 'japanese-jisx0208 #x2721)
-			     (decode-char 'japanese-jisx0208 #x277E)) ?Y)
-(modify-category-entry (cons (decode-char 'japanese-jisx0208 #x3021)
-			     (decode-char 'japanese-jisx0208 #x7E7E)) ?C)
-(modify-category-entry ? ?K)
-(let ((chars '(? ?)))
+(map-charset-chars #'modify-category-entry 'japanese-jisx0208 ?A #x2321 #x237E)
+(map-charset-chars #'modify-category-entry 'japanese-jisx0208 ?H #x2421 #x247E)
+(map-charset-chars #'modify-category-entry 'japanese-jisx0208 ?K #x2521 #x257E)
+(map-charset-chars #'modify-category-entry 'japanese-jisx0208 ?G #x2621 #x267E)
+(map-charset-chars #'modify-category-entry 'japanese-jisx0208 ?Y #x2721 #x277E)
+(map-charset-chars #'modify-category-entry 'japanese-jisx0208 ?C #x3021 #x7E7E)
+(modify-category-entry ?ー ?K)
+(let ((chars '(?゛ ?゜)))
   (while chars
     (modify-category-entry (car chars) ?K)
     (modify-category-entry (car chars) ?H)
     (setq chars (cdr chars))))
-(let ((chars '(? ? ? ? ? ? ? ? ?)))
+(let ((chars '(?ヽ ?ヾ ?ゝ ?ゞ ?〃 ?仝 ?々 ?〆 ?〇)))
   (while chars
     (modify-category-entry (car chars) ?C)
     (setq chars (cdr chars))))
 
 ;; JISX0212
 
-(modify-syntax-entry (cons (make-char 'japanese-jisx0212 33 33)
-			   (make-char 'japanese-jisx0212 33 126))
-		     "_")
-(modify-syntax-entry (cons (make-char 'japanese-jisx0212 34 33)
-			   (make-char 'japanese-jisx0212 34 126))
-		     "_")
-(modify-syntax-entry (cons (make-char 'japanese-jisx0212 35 33)
-			   (make-char 'japanese-jisx0212 35 126))
-		     "_")
- 
-(modify-syntax-entry (cons (decode-char 'japanese-jisx0212 #x2121)
-			   (decode-char 'japanese-jisx0212 #x237E))
-		     "_")
+(map-charset-chars #'modify-syntax-entry 'japanese-jisx0212 "_" #x2121 #x237E)
 
 ;; JISX0201-Kana
 
@@ -432,41 +367,14 @@
 ;; Korean character set (KSC5601)
 
 (map-charset-chars #'modify-category-entry 'korean-ksc5601 ?h)
-(modify-syntax-entry (cons (make-char 'korean-ksc5601 33 33)
-			   (make-char 'korean-ksc5601 33 126))
-		     "_")
-;; Fixme: Giving `invalid code' because the charset has holes --
-;; presumably map should be used just for unification.
-;; (modify-syntax-entry (cons (make-char 'korean-ksc5601 34 33)
-;; 			   (make-char 'korean-ksc5601 34 126))
-;; 		     "_")
-;; (modify-syntax-entry (cons (make-char 'korean-ksc5601 38 33)
-;; 			   (make-char 'korean-ksc5601 38 126))
-;; 		     "_")
-;; (modify-syntax-entry (cons (make-char 'korean-ksc5601 39 33)
-;; 			   (make-char 'korean-ksc5601 39 126))
-;; 		     "_")
-(modify-syntax-entry (cons (make-char 'korean-ksc5601 40 33)
-			   (make-char 'korean-ksc5601 40 126))
-		     "_")
-(modify-syntax-entry (cons (make-char 'korean-ksc5601 41 33)
-			   (make-char 'korean-ksc5601 41 126))
-		     "_")
-(modify-category-entry (cons (make-char 'korean-ksc5601 35 33)
-			     (make-char 'korean-ksc5601 35 126))
-		       ?A)
-;; (modify-category-entry (cons (make-char 'korean-ksc5601 37 33)
-;; 			     (make-char 'korean-ksc5601 37 126))
-;; 		       ?G)
-;; (modify-category-entry (cons (make-char 'korean-ksc5601 42 33)
-;; 			     (make-char 'korean-ksc5601 42 126))
-;; 		       ?H)
-;; (modify-category-entry (cons (make-char 'korean-ksc5601 43 33)
-;; 			     (make-char 'korean-ksc5601 43 126))
-;; 		       ?K)
-;; (modify-category-entry (cons (make-char 'korean-ksc5601 44 33)
-;; 			     (make-char 'korean-ksc5601 44 126))
-;; 		       ?Y)
+
+(map-charset-chars #'modify-syntax-entry 'korean-ksc5601 "_" #x2121 #x227E)
+(map-charset-chars #'modify-syntax-entry 'korean-ksc5601 "_" #x2621 #x297E)
+(map-charset-chars #'modify-category-entry 'korean-ksc5601 ?A #x2321 #x237E)
+(map-charset-chars #'modify-category-entry 'korean-ksc5601 ?G #x2521 #x257E)
+(map-charset-chars #'modify-category-entry 'korean-ksc5601 ?H #x2A21 #x2A7E)
+(map-charset-chars #'modify-category-entry 'korean-ksc5601 ?K #x2B21 #x2B7E)
+(map-charset-chars #'modify-category-entry 'korean-ksc5601 ?Y #x2C21 #x2C7E)
 
 ;; Latin