This commit was generated by cvs2svn to compensate for changes in r5670,
[chise/xemacs-chise.git.1] / lisp / mule / chinese.el
index aff138f..a4fd892 100644 (file)
@@ -1,4 +1,4 @@
-;;; chinese.el --- Support for Chinese -*- coding: iso-2022-7bit; -*-
+;;; chinese.el --- Support for Chinese
 
 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;; (make-coding-system
-;;  'iso-2022-cn 2 ?C
+;;  'chinese-iso-7bit 2 ?C
 ;;  "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN)"
 ;;  '(ascii
 ;;    (nil chinese-gb2312 chinese-cns11643-1)
 ;;    (nil chinese-cns11643-2)
-;;    nil
-;;    nil ascii-eol ascii-cntl seven locking-shift single-shift nil nil nil
-;;    init-bol)
-;;  '((safe-charsets ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2)
-;;    (mime-charset . iso-2022-cn)))
-
-;; (define-coding-system-alias 'chinese-iso-7bit 'iso-2022-cn)
-
-;; (make-coding-system
-;;  'iso-2022-cn-ext 2 ?C
-;;  "ISO 2022 based 7bit encoding for Chinese GB and CNS (MIME:ISO-2022-CN-EXT)"
-;;  '(ascii
-;;    (nil chinese-gb2312 chinese-cns11643-1)
-;;    (nil chinese-cns11643-2)
 ;;    (nil chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5
 ;;         chinese-cns11643-6 chinese-cns11643-7)
 ;;    nil ascii-eol ascii-cntl seven locking-shift single-shift nil nil nil
-;;    init-bol)
-;;  '((safe-charsets ascii chinese-gb2312 chinese-cns11643-1 chinese-cns11643-2
-;;                   chinese-cns11643-3 chinese-cns11643-4 chinese-cns11643-5
-;;                   chinese-cns11643-6 chinese-cns11643-7)
-;;    (mime-charset . iso-2022-cn-ext)))
+;;    init-bol))
+
+;; (define-coding-system-alias 'iso-2022-cn 'chinese-iso-7bit)
+;; (define-coding-system-alias 'iso-2022-cn-ext 'chinese-iso-7bit)
 
+;; (define-prefix-command 'describe-chinese-environment-map)
+;; (define-key-after describe-language-environment-map [Chinese]
+;;   '("Chinese" . describe-chinese-environment-map)
+;;   t)
+
+;; (define-prefix-command 'setup-chinese-environment-map)
+;; (define-key-after setup-language-environment-map [Chinese]
+;;   '("Chinese" . setup-chinese-environment-map)
+;;   t)
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Chinese GB2312 (simplified) 
 ;; (make-coding-system
 ;;  'chinese-iso-8bit 2 ?c
 ;;  "ISO 2022 based EUC encoding for Chinese GB2312 (MIME:CN-GB-2312)"
-;;  '(ascii chinese-gb2312 nil nil
-;;    nil ascii-eol ascii-cntl nil nil nil nil)
-;;  '((safe-charsets ascii chinese-gb2312)
-;;    (mime-charset . cn-gb-2312)))
+;;  '((ascii t) chinese-gb2312 chinese-sisheng nil
+;;    nil ascii-eol ascii-cntl nil nil single-shift nil))
 
 (make-coding-system
  'cn-gb-2312 'iso2022
 
 ;; (define-coding-system-alias 'cn-gb-2312 'chinese-iso-8bit)
 ;; (define-coding-system-alias 'euc-china 'chinese-iso-8bit)
-;; (define-coding-system-alias 'euc-cn 'chinese-iso-8bit)
 
-(define-coding-system-alias 'gb2312 'cn-gb-2312)
-(define-coding-system-alias 'chinese-euc 'cn-gb-2312)
+(copy-coding-system 'cn-gb-2312 'gb2312)
+(copy-coding-system 'cn-gb-2312 'chinese-euc)
 
 ;; (make-coding-system
 ;;  'chinese-hz 0 ?z
 ;;  "Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)"
-;;  nil
-;;  '((safe-charsets ascii chinese-gb2312)
-;;    (mime-charset . hz-gb-2312)
-;;    (post-read-conversion . post-read-decode-hz)
-;;    (pre-write-conversion . pre-write-encode-hz)))
+;;  nil)
 ;; (put 'chinese-hz 'post-read-conversion 'post-read-decode-hz)
 ;; (put 'chinese-hz 'pre-write-conversion 'pre-write-encode-hz)
 
 ;; (define-coding-system-alias 'hz-gb-2312 'chinese-hz)
 ;; (define-coding-system-alias 'hz 'chinese-hz)
 
-(define-coding-system-alias 'hz 'hz-gb-2312)
+(copy-coding-system 'hz-gb-2312 'hz)
+(copy-coding-system 'hz-gb-2312 'chinese-hz)
 
 (defun post-read-decode-hz (len)
-  (let ((pos (point))
-       (buffer-modified-p (buffer-modified-p))
-       last-coding-system-used)
-    (prog1
-       (decode-hz-region pos (+ pos len))
-      (set-buffer-modified-p buffer-modified-p))))
+  (let ((pos (point)))
+    (decode-hz-region pos (+ pos len))))
 
 (defun pre-write-encode-hz (from to)
-  (let ((buf (current-buffer)))
-    (set-buffer (generate-new-buffer " *temp*"))
+  (let ((buf (current-buffer))
+       (work (get-buffer-create " *pre-write-encoding-work*")))
+    (set-buffer work)
+    (erase-buffer)
     (if (stringp from)
        (insert from)
       (insert-buffer-substring buf from to))
-    (let (last-coding-system-used)
-      (encode-hz-region 1 (point-max)))
+    (encode-hz-region 1 (point-max))
     nil))
           
 (set-language-info-alist
- "Chinese-GB" '((setup-function . setup-chinese-gb-environment-internal)
-               (charset chinese-gb2312 sisheng)
-               (coding-system cn-gb-2312 iso-2022-7bit hz-gb-2312)
-               (coding-priority cn-gb-2312 big5 iso-2022-7bit)
-               (input-method . "chinese-py-punct")
-               (features china-util)
+ "Chinese-GB" '((setup-function . (setup-chinese-gb-environment
+                                  . setup-chinese-environment-map))
+               (charset . (chinese-gb2312 sisheng))
+               (coding-system
+                . (cn-gb-2312 iso-2022-7bit hz-gb-2312))
                (sample-text . "Chinese (\e$AVPND\e(B,\e$AFUM(;0\e(B,\e$A::So\e(B)    \e$ADc:C\e(B")
-               (documentation . "Support for Chinese GB2312 character set."))
- '("Chinese"))
+               (documentation . ("Support for Chinese GB2312 character set."
+                                 . describe-chinese-environment-map))
+               ))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Chinese BIG5 (traditional)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;; (make-coding-system
-;;  'chinese-big5 3 ?B "BIG5 8-bit encoding for Chinese (MIME:CN-BIG5)"
-;;  nil
-;;  '((safe-charsets ascii chinese-big5-1 chinese-big5-2)
-;;    (mime-charset . cn-big5)
-;;    (charset-origin-alist (chinese-big5-1  "BIG5" encode-big5-char)
-;;                          (chinese-big5-2  "BIG5" encode-big5-char))))
+;;  'chinese-big5 3 ?B "BIG5 8-bit encoding for Chinese (MIME:CN-BIG5)")
 
 (make-coding-system
  'big5 'big5
 ;; (define-coding-system-alias 'big5 'chinese-big5)
 ;; (define-coding-system-alias 'cn-big5 'chinese-big5)
 
-(define-coding-system-alias 'cn-big5 'big5)
+(copy-coding-system 'big5 'cn-big5)
+(copy-coding-system 'big5 'chinese-big5)
 
 ;; Big5 font requires special encoding.
 (define-ccl-program ccl-encode-big5-font
 (set-charset-ccl-program 'chinese-big5-2 ccl-encode-big5-font)
 
 (set-language-info-alist
- "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2)
-                 (coding-system big5 iso-2022-7bit)
-                 (coding-priority big5 cn-gb-2312 iso-2022-7bit)
-                 (input-method . "chinese-py-punct-b5")
-                 (features china-util)
+ "Chinese-BIG5" '((setup-function . (setup-chinese-big5-environment
+                                    . setup-chinese-environment-map))
+                 (charset . (chinese-big5-1 chinese-big5-2))
+                 (coding-system . (big5 iso-2022-7bit))
                  (sample-text . "Cantonese (\e$(0GnM$\e(B,\e$(0N]0*Hd\e(B) \e$(0*/=(\e(B, \e$(0+$)p\e(B")
-                 (documentation . "Support for Chinese Big5 character set."))
- '("Chinese"))
+                 (documentation . ("Support for Chinese Big5 character set."
+                                   . describe-chinese-environment-map))
+                 ))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Chinese CNS11643 (traditional)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;; (set-language-info-alist
-;;  "Chinese-CNS" '((charset chinese-cns11643-1 chinese-cns11643-2
-;;                           chinese-cns11643-3 chinese-cns11643-4
-;;                           chinese-cns11643-5 chinese-cns11643-6
-;;                           chinese-cns11643-7)
-;;                  (coding-system iso-2022-cn)
-;;                  (coding-priority iso-2022-cn chinese-big5 chinese-iso-8bit)
-;;                  (features china-util)
-;;                  (input-method . "chinese-cns-quick")
-;;                  (documentation . "Support for Chinese CNS character sets."))
-;;  '("Chinese"))
+;;  "Chinese-CNS" '((setup-function . (setup-chinese-cns-environment
+;;                                     . setup-chinese-environment-map))
+;;                  (charset . (chinese-cns11643-1 chinese-cns11643-2
+;;                              chinese-cns11643-3 chinese-cns11643-4
+;;                              chinese-cns11643-5 chinese-cns11643-6
+;;                              chinese-cns11643-7))
+;;                  (coding-system . (chinese-iso-7bit))
+;;                  (documentation . ("Support for Chinese CNS character sets."
+;;                                    . describe-chinese-environment-map))
+;;                  ))
 
 ;;; chinese.el ends here