/[emacs]/emacs/lisp/international/characters.el
ViewVC logotype

Diff of /emacs/lisp/international/characters.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.35 by rms, Wed Dec 12 22:47:58 2001 UTC revision 1.35.4.1 by miles, Fri Apr 4 06:20:21 2003 UTC
# Line 2  Line 2 
2    
3  ;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.  ;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
4  ;; Licensed to the Free Software Foundation.  ;; Licensed to the Free Software Foundation.
5  ;; Copyright (C) 2001 Free Software Foundation, Inc.  ;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
6    
7  ;; Keywords: multibyte character, character set, syntax, category  ;; Keywords: multibyte character, character set, syntax, category
8    
# Line 83  Line 83 
83  (define-category ?| "While filling, we can break a line at this character.")  (define-category ?| "While filling, we can break a line at this character.")
84    
85  ;; For indentation calculation.  ;; For indentation calculation.
86  (define-category ?  (define-category ?\s
87    "This character counts as a space for indentation purposes.")    "This character counts as a space for indentation purposes.")
88    
89  ;; Keep the following for `kinsoku' processing.  See comments in  ;; Keep the following for `kinsoku' processing.  See comments in
# Line 140  Line 140 
140  (modify-syntax-entry ?\$A!:(B "($A!;(B")  (modify-syntax-entry ?\$A!:(B "($A!;(B")
141  (modify-syntax-entry ?\$A!<(B "($A!=(B")  (modify-syntax-entry ?\$A!<(B "($A!=(B")
142  (modify-syntax-entry ?\$A!>(B "($A!?(B")  (modify-syntax-entry ?\$A!>(B "($A!?(B")
143    (modify-syntax-entry ?\$A#((B "($A#)(B")
144    (modify-syntax-entry ?\$A#{(B "($A#}(B")
145    (modify-syntax-entry ?\$A#[(B "($A#](B")
146  (modify-syntax-entry ?\$A!3(B ")$A!2(B")  (modify-syntax-entry ?\$A!3(B ")$A!2(B")
147  (modify-syntax-entry ?\$A!5(B ")$A!4(B")  (modify-syntax-entry ?\$A!5(B ")$A!4(B")
148  (modify-syntax-entry ?\$A!7(B ")$A!6(B")  (modify-syntax-entry ?\$A!7(B ")$A!6(B")
# Line 147  Line 150 
150  (modify-syntax-entry ?\$A!;(B ")$A!:(B")  (modify-syntax-entry ?\$A!;(B ")$A!:(B")
151  (modify-syntax-entry ?\$A!=(B ")$A!<(B")  (modify-syntax-entry ?\$A!=(B ")$A!<(B")
152  (modify-syntax-entry ?\$A!?(B ")$A!>(B")  (modify-syntax-entry ?\$A!?(B ")$A!>(B")
153    (modify-syntax-entry ?\$A#)(B ")$A#((B")
154    (modify-syntax-entry ?\$A#}(B ")$A#{(B")
155    (modify-syntax-entry ?\$A#](B ")$A#[(B")
156  ;; Unicode equivalents of above  ;; Unicode equivalents of above
157  (modify-syntax-entry ?\$,2=T(B "($,2=U(B")  (modify-syntax-entry ?\$,2=T(B "($,2=U(B")
158  (modify-syntax-entry ?\$,2=H(B "($,2=I(B")  (modify-syntax-entry ?\$,2=H(B "($,2=I(B")
# Line 163  Line 169 
169  (modify-syntax-entry ?\$,2=W(B ")$,2=V(B")  (modify-syntax-entry ?\$,2=W(B ")$,2=V(B")
170  (modify-syntax-entry ?\$,2=Q(B ")$,2=P(B")  (modify-syntax-entry ?\$,2=Q(B ")$,2=P(B")
171    
172    (let ((chars "$A#,!"!##.!$#;#:#?#!!C!-!'#|#_!.!/!0!1#"!e#`!d(B"))
173      (dotimes (i (length chars))
174        (modify-syntax-entry (aref chars i) ".")))
175    
176  (modify-category-entry (make-char 'chinese-gb2312) ?c)  (modify-category-entry (make-char 'chinese-gb2312) ?c)
177  (modify-category-entry (make-char 'chinese-gb2312) ?\|)  (modify-category-entry (make-char 'chinese-gb2312) ?\|)
178  (modify-category-entry (make-char 'chinese-gb2312 35) ?A)  (modify-category-entry (make-char 'chinese-gb2312 35) ?A)
# Line 177  Line 187 
187    
188  ;; Chinese character set (BIG5)  ;; Chinese character set (BIG5)
189    
190    
191    
192    (let ((from (decode-big5-char #xA141))
193          (to (decode-big5-char #xA15D)))
194      (while (< from to)
195        (modify-syntax-entry from ".")
196        (setq from (1+ from))))
197    (let ((from (decode-big5-char #xA1A5))
198          (to (decode-big5-char #xA1AD)))
199      (while (< from to)
200        (modify-syntax-entry from ".")
201        (setq from (1+ from))))
202    (let ((from (decode-big5-char #xA1AD))
203          (to (decode-big5-char #xA2AF)))
204      (while (< from to)
205        (modify-syntax-entry from "_")
206        (setq from (1+ from))))
207    
208    (let ((parens "$(0!>!?!@!A!B!C!D!E!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!W!X!Y!Z![!\!]!^!_!`!a!b!c(B")
209          open close)
210      (dotimes (i (/ (length parens) 2))
211        (setq open (aref parens (* i 2))
212              close (aref parens (1+ (* i 2))))
213        (modify-syntax-entry open (format "(%c" close))
214        (modify-syntax-entry close (format ")%c" open))))
215    
216  (let ((generic-big5-1-char (make-char 'chinese-big5-1))  (let ((generic-big5-1-char (make-char 'chinese-big5-1))
217        (generic-big5-2-char (make-char 'chinese-big5-2)))        (generic-big5-2-char (make-char 'chinese-big5-2)))
218  ;;   (modify-syntax-entry generic-big5-1-char "w")  ;;   (modify-syntax-entry generic-big5-1-char "w")
# Line 499  Line 535 
535      (modify-category-entry (decode-char 'ucs c) ?i)      (modify-category-entry (decode-char 'ucs c) ?i)
536      (setq c (1+ c))))      (setq c (1+ c))))
537    
538  ;;; Commented out since the categories appear not to be used anywhere  (let ((l '(;; RANGE   CATEGORY          MEANINGS
539  ;;; and word syntax is the default.             (#x01 #x03 ?7)               ; vowel modifier
540  ;; (let ((deflist                               ;             (#x05 #x14 ?1)               ; base vowel
541  ;;      '(;; chars      syntax  category             (#x15 #x39 ?0)               ; consonants
542  ;;        ("(5!"#(B"  "w"     ?7) ; vowel-modifying diacritical mark             (#x3e #x4d ?8)               ; vowel modifier
543  ;;                                  ; chandrabindu, anuswar, visarga             (#x51 #x54 ?4)               ; stress/tone mark
544  ;;        ("(5$(B-(52(B"    "w"     ?1) ; base (independent) vowel             (#x58 #x5f ?0)               ; consonants
545  ;;        ("(53(B-(5X(B"    "w"     ?0) ; consonant             (#x60 #x61 ?1)               ; base vowel
546  ;;        ("(5Z(B-(5g(B"    "w"     ?8) ; matra             (#x62 #x63 ?8)               ; vowel modifier
547  ;;        ("(5q(B-(5z(B"    "w"     ?6) ; digit             (#x66 #x6f ?6)               ; digits
548  ;;        ))             )))
549  ;;       elm chars len syntax category to ch i)    (dolist (elt1 '(#x900 #x980 #xa00 #xa80 #xb00 #xb80 #xc00 #xc80 #xd00))
550  ;;   (while deflist      (dolist (elt2 l)
551  ;;     (setq elm (car deflist))        (let* ((from (car elt2))
552  ;;     (setq chars (car elm)               (counts (1+ (- (nth 1 elt2) from)))
553  ;;        len (length chars)               (category (nth 2 elt2)))
554  ;;        syntax (nth 1 elm)          (dotimes (i counts)
555  ;;        category (nth 2 elm)            (modify-category-entry (decode-char 'ucs (+ elt1 from i))
556  ;;        i 0)                                   category))))))
 ;;     (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))))  
   
557    
558  ;; Japanese character set (JISX0201-kana, JISX0201-roman, JISX0208, JISX0212)  ;; Japanese character set (JISX0201-kana, JISX0201-roman, JISX0208, JISX0212)
559    
# Line 557  Line 580 
580      ;; ?K is double width, ?k isn't specified      ;; ?K is double width, ?k isn't specified
581      (modify-category-entry (decode-char 'ucs c) ?k)      (modify-category-entry (decode-char 'ucs c) ?k)
582      (modify-category-entry (decode-char 'ucs c) ?j)      (modify-category-entry (decode-char 'ucs c) ?j)
583      (modify-category-entry (decode-char 'ucs c) ?\|)      (modify-category-entry (decode-char 'ucs c) ?\|)
584      (setq c (1+ c))))      (setq c (1+ c))))
585    
586  ;; Hiragana block  ;; Hiragana block
# Line 566  Line 589 
589      ;; ?H is actually defined to be double width      ;; ?H is actually defined to be double width
590      (modify-category-entry (decode-char 'ucs c) ?H)      (modify-category-entry (decode-char 'ucs c) ?H)
591      ;;(modify-category-entry (decode-char 'ucs c) ?j)      ;;(modify-category-entry (decode-char 'ucs c) ?j)
592      (modify-category-entry (decode-char 'ucs c) ?\|)      (modify-category-entry (decode-char 'ucs c) ?\|)
593      (setq c (1+ c))))      (setq c (1+ c))))
594    
595  ;; JISX0208  ;; JISX0208
# Line 574  Line 597 
597  (modify-syntax-entry (make-char 'japanese-jisx0208 33) "_")  (modify-syntax-entry (make-char 'japanese-jisx0208 33) "_")
598  (modify-syntax-entry (make-char 'japanese-jisx0208 34) "_")  (modify-syntax-entry (make-char 'japanese-jisx0208 34) "_")
599  (modify-syntax-entry (make-char 'japanese-jisx0208 40) "_")  (modify-syntax-entry (make-char 'japanese-jisx0208 40) "_")
600  ;; (let ((chars '(?$B!<(B ?$B!+(B ?$B!,(B ?$B!3(B ?$B!4(B ?$B!5(B ?$B!6(B ?$B!7(B ?$B!8(B ?$B!9(B ?$B!:(B ?$B!;(B)))  (let ((chars '(?$B!<(B ?$B!+(B ?$B!,(B ?$B!3(B ?$B!4(B ?$B!5(B ?$B!6(B ?$B!7(B ?$B!8(B ?$B!9(B ?$B!:(B ?$B!;(B)))
601  ;;   (while chars    (while chars
602  ;;     (modify-syntax-entry (car chars) "w")      (modify-syntax-entry (car chars) "w")
603  ;;     (setq chars (cdr chars))))      (setq chars (cdr chars))))
604  (modify-syntax-entry ?\$B!J(B "($B!K(B")  (modify-syntax-entry ?\$B!J(B "($B!K(B")
605  (modify-syntax-entry ?\$B!N(B "($B!O(B")  (modify-syntax-entry ?\$B!N(B "($B!O(B")
606  (modify-syntax-entry ?\$B!P(B "($B!Q(B")  (modify-syntax-entry ?\$B!P(B "($B!Q(B")
# Line 675  Line 698 
698                    ("(1PRS]`(B-(1d(B"        "w"     ?1) ; vowel base                    ("(1PRS]`(B-(1d(B"        "w"     ?1) ; vowel base
699                    ("(1QT(B-(1W[m(B" "w"     ?2) ; vowel upper                    ("(1QT(B-(1W[m(B" "w"     ?2) ; vowel upper
700                    ("(1XY(B"           "w"     ?3) ; vowel lower                    ("(1XY(B"           "w"     ?3) ; vowel lower
701                    ("(1h(B-(1l(B"    "w"     ?4) ; tone mark                    ("(1h(B-(1l(B"    "w"     ?4) ; tone mark
702                    ("(1\(B"            "w"     ?9) ; semivowel lower                    ("(1\(B"            "w"     ?9) ; semivowel lower
703                    ("(1p(B-(1y(B"    "w"     ?6) ; digit                    ("(1p(B-(1y(B"    "w"     ?6) ; digit
704                    ("(1Of(B"           "_"     ?5) ; symbol                    ("(1Of(B"           "_"     ?5) ; symbol
# Line 684  Line 707 
707                    ("$,1DPDRDSD]D`(B-$,1Dd(B"        "w"     ?1) ; vowel base                    ("$,1DPDRDSD]D`(B-$,1Dd(B"        "w"     ?1) ; vowel base
708                    ("$,1DQDT(B-$,1DWD[Dm(B"  "w"     ?2) ; vowel upper                    ("$,1DQDT(B-$,1DWD[Dm(B"  "w"     ?2) ; vowel upper
709                    ("$,1DXDY(B"        "w"     ?3) ; vowel lower                    ("$,1DXDY(B"        "w"     ?3) ; vowel lower
710                    ("$,1Dh(B-$,1Dk(B"        "w"     ?4) ; tone mark                    ("$,1Dh(B-$,1Dk(B"        "w"     ?4) ; tone mark
711                    ("$,1D\D](B"        "w"     ?9) ; semivowel lower                    ("$,1D\D](B"        "w"     ?9) ; semivowel lower
712                    ("$,1Dp(B-$,1Dy(B"        "w"     ?6) ; digit                    ("$,1Dp(B-$,1Dy(B"        "w"     ?6) ; digit
713                    ("$,1DODf(B"        "_"     ?5) ; symbol                    ("$,1DODf(B"        "_"     ?5) ; symbol
# Line 722  Line 745 
745                    (",TDFPRS`(B-,Te(B"       "w"     ?1) ; vowel base                    (",TDFPRS`(B-,Te(B"       "w"     ?1) ; vowel base
746                    (",TQT(B-,TWgn(B" "w"     ?2) ; vowel upper                    (",TQT(B-,TWgn(B" "w"     ?2) ; vowel upper
747                    (",TX(B-,TZ(B"    "w"     ?3) ; vowel lower                    (",TX(B-,TZ(B"    "w"     ?3) ; vowel lower
748                    (",Th(B-,Tm(B"    "w"     ?4) ; tone mark                    (",Th(B-,Tm(B"    "w"     ?4) ; tone mark
749                    (",Tp(B-,Ty(B"    "w"     ?6) ; digit                    (",Tp(B-,Ty(B"    "w"     ?6) ; digit
750                    (",TOf_oz{(B"       "_"     ?5) ; symbol                    (",TOf_oz{(B"       "_"     ?5) ; symbol
751                    ;; Unicode equivalents                    ;; Unicode equivalents
# Line 730  Line 753 
753                    ("$,1C$C&C0C2C3C@(B-$,1CE(B"      "w"     ?1) ; vowel base                    ("$,1C$C&C0C2C3C@(B-$,1CE(B"      "w"     ?1) ; vowel base
754                    ("$,1C1C4(B-$,1C7CGCN(B"  "w"     ?2) ; vowel upper                    ("$,1C1C4(B-$,1C7CGCN(B"  "w"     ?2) ; vowel upper
755                    ("$,1C8(B-$,1C:(B"        "w"     ?3) ; vowel lower                    ("$,1C8(B-$,1C:(B"        "w"     ?3) ; vowel lower
756                    ("$,1CH(B-$,1CM(B"        "w"     ?4) ; tone mark                    ("$,1CH(B-$,1CM(B"        "w"     ?4) ; tone mark
757                    ("$,1CP(B-$,1CY(B"        "w"     ?6) ; digit                    ("$,1CP(B-$,1CY(B"        "w"     ?6) ; digit
758                    ("$,1C/CFC?COCZC[(B"        "_"     ?5) ; symbol                    ("$,1C/CFC?COCZC[(B"        "_"     ?5) ; symbol
759                    ))                    ))
# Line 1054  Line 1077 
1077               (and (>= c #x048c) (<= c #x04be))               (and (>= c #x048c) (<= c #x04be))
1078               (and (>= c #x04d0) (<= c #x04f4)))               (and (>= c #x04d0) (<= c #x04f4)))
1079           (set-case-syntax-pair           (set-case-syntax-pair
1080            (decode-char 'ucs c) (decode-char 'ucs (1+ c)) tbl))              (decode-char 'ucs c) (decode-char 'ucs (1+ c)) tbl))
1081      (setq c (1+ c)))      (setq c (1+ c)))
1082    (set-case-syntax-pair ?$,1*!(B ?$,1*"(B tbl)    (set-case-syntax-pair ?$,1*!(B ?$,1*"(B tbl)
1083    (set-case-syntax-pair ?$,1*#(B ?$,1*$(B tbl)    (set-case-syntax-pair ?$,1*#(B ?$,1*$(B tbl)
# Line 1065  Line 1088 
1088    ;; general punctuation    ;; general punctuation
1089    (setq c #x2000)    (setq c #x2000)
1090    (while (<= c #x200b)    (while (<= c #x200b)
1091      (set-case-syntax c " " tbl)      (set-case-syntax (decode-char 'ucs c) " " tbl)
1092      (setq c (1+ c)))      (setq c (decode-char 'ucs (1+ c))))
1093    (setq c #x2010)    (setq c #x2010)
1094    (while (<= c #x2027)    (while (<= c #x2027)
1095      (set-case-syntax c "_" tbl)      (set-case-syntax (decode-char 'ucs c) "_" tbl)
1096      (setq c (1+ c)))      (setq c (decode-char 'ucs (1+ c))))
1097    
1098    ;; Roman numerals    ;; Roman numerals
1099    (setq c #x2160)    (setq c #x2160)
# Line 1097  Line 1120 
1120      (modify-category-entry (decode-char 'ucs (+ c #x20)) ?l)      (modify-category-entry (decode-char 'ucs (+ c #x20)) ?l)
1121      (setq c (1+ c)))      (setq c (1+ c)))
1122    
   ;; Ohm, Kelvin, Angstrom  
   (set-case-syntax-pair ?$,1uf(B ?$,1'I(B tbl)  
 ;;;  These mess up the case conversion of k and ,Ae(B.  
 ;;;  (set-case-syntax-pair ?$,1uj(B ?k tbl)  
 ;;;  (set-case-syntax-pair ?$,1uk(B ?,Ae(B tbl)  
   
1123    ;; Combining diacritics    ;; Combining diacritics
1124    (setq c #x300)    (setq c #x300)
1125    (while (<= c #x362)    (while (<= c #x362)

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.35.4.1

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