mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Make functions setup-LANGUAGE-environment
interactive and add new functions describe-LANGUAGE-support for all LANGUAGEs supported. Remove resisterations of input methods which use the function encoded-kbd-select-terminal. (pre-write-encode-hz): Make it work for the case the arg FROM is a string. (setup-chinese-cns-environemnt): Set default-input-method to quail-quich-cns.
This commit is contained in:
parent
7e22bdd8f9
commit
fab8252e84
1 changed files with 50 additions and 19 deletions
|
|
@ -46,11 +46,22 @@
|
|||
|
||||
(define-coding-system-alias 'iso-2022-cn 'iso-2022-cn-ext)
|
||||
|
||||
(set-language-info
|
||||
"Chinese" 'documentation
|
||||
"Emacs provides three kinds of Chinese support: Chinese-GB,
|
||||
Chinese-BIG5, and Chinese-CNS. Please specify one of them to get more
|
||||
information.")
|
||||
(defun describe-chinese-support ()
|
||||
"Describe how Emacs supports Chinese."
|
||||
(interactive)
|
||||
(with-output-to-temp-buffer "*Help*"
|
||||
(princ (get-language-info "Chinese" 'documentation))
|
||||
(princ "\n")))
|
||||
|
||||
(set-language-info-alist
|
||||
"Chinese" '((describe-function . describe-chinese-support)
|
||||
(documentation . "\
|
||||
Emacs provides the following three kinds of Chinese support:
|
||||
Chinese-GB: for users of the charset GB2312
|
||||
Chinese-BIG5: for users of the charset Big5
|
||||
Chinese-CNS: for users of the charset CNS11643 family
|
||||
Please specify one of them to get more information.")
|
||||
))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; Chinese GB2312 (simplified)
|
||||
|
|
@ -81,14 +92,13 @@ information.")
|
|||
(let ((buf (current-buffer))
|
||||
(work (get-buffer-create " *pre-write-encoding-work*")))
|
||||
(set-buffer work)
|
||||
(widen)
|
||||
(erase-buffer)
|
||||
(insert-buffer-substring buf from to)
|
||||
(if (stringp from)
|
||||
(insert from)
|
||||
(insert-buffer-substring buf from to))
|
||||
(encode-hz-region 1 (point-max))
|
||||
nil))
|
||||
|
||||
(register-input-method
|
||||
"Chinese-GB" '("cxterm-gb" encoded-kbd-select-terminal cn-gb-2312))
|
||||
(register-input-method
|
||||
"Chinese-GB" '("quail-ccdospy" quail-use-package "quail/ccdospy"))
|
||||
(register-input-method
|
||||
|
|
@ -107,6 +117,8 @@ information.")
|
|||
"Chinese-GB" '("quail-py" quail-use-package "quail/py"))
|
||||
|
||||
(defun setup-chinese-gb-environment ()
|
||||
"Setup multilingual environment (MULE) for Chinese GB2312 users."
|
||||
(interactive)
|
||||
(setq primary-language "Chinese-GB")
|
||||
|
||||
(setq coding-category-iso-8-2 'cn-gb-2312)
|
||||
|
|
@ -129,13 +141,18 @@ information.")
|
|||
(setq default-input-method '("Chinese-GB" . "quail-py"))
|
||||
)
|
||||
|
||||
(defun describe-chinese-gb-support ()
|
||||
"Describe how Emacs supports Chinese for GB2312 users."
|
||||
(interactive)
|
||||
(describe-language-support-internal "Chinese-GB"))
|
||||
|
||||
(set-language-info-alist
|
||||
"Chinese-GB" '((documentation . t)
|
||||
(setup-function . setup-chinese-gb-environment)
|
||||
"Chinese-GB" '((setup-function . setup-chinese-gb-environment)
|
||||
(describe-function . describe-chinese-gb-support)
|
||||
(charset . (chinese-gb2312 chinese-sisheng))
|
||||
(coding-system . (cn-gb-2312 hz-gb-2312 iso-2022-cn))
|
||||
(documentation . t)
|
||||
(sample-text . "Chinese ($AVPND(B,$AFUM(;0(B,$A::So(B) $ADc:C(B")))
|
||||
(sample-text . "Chinese ($AVPND(B,$AFUM(;0(B,$A::So(B) $ADc:C(B")
|
||||
(documentation . nil)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Chinese BIG5 (traditional)
|
||||
|
|
@ -165,8 +182,6 @@ information.")
|
|||
(setq font-ccl-encoder-alist
|
||||
(cons (cons "big5" ccl-encode-big5-font) font-ccl-encoder-alist))
|
||||
|
||||
(register-input-method
|
||||
"Chinese-BIG5" '("cxterm-big5" encoded-kbd-select-terminal big5))
|
||||
(register-input-method
|
||||
"Chinese-BIG5" '("quail-qj-b5" quail-use-package "quail/qj-b5"))
|
||||
(register-input-method
|
||||
|
|
@ -189,6 +204,8 @@ information.")
|
|||
"Chinese-BIG5" '("quail-4corner" quail-use-package "quail/4corner"))
|
||||
|
||||
(defun setup-chinese-big5-environment ()
|
||||
"Setup multilingual environment (MULE) for Chinese Big5 users."
|
||||
(interactive)
|
||||
(setq primary-language "Chinese-BIG5")
|
||||
|
||||
(setq coding-category-big5 'cn-big5)
|
||||
|
|
@ -208,12 +225,18 @@ information.")
|
|||
(setq default-input-method '("Chinese-BIG5" . "quail-py-b5"))
|
||||
)
|
||||
|
||||
(defun describe-chinese-big5-support ()
|
||||
"Describe how Emacs supports Chinese for Big5 users."
|
||||
(interactive)
|
||||
(describe-language-support-internal "Chinese-BIG5"))
|
||||
|
||||
(set-language-info-alist
|
||||
"Chinese-BIG5" '((setup-function . setup-chinese-big5-environment)
|
||||
(describe-function . describe-chinese-big5-support)
|
||||
(charset . (chinese-big5-1 chinese-big5-2))
|
||||
(coding-system . (cn-big5 iso-2022-cn))
|
||||
(documentation . t)
|
||||
(sample-text . "Cantonese ($(0GnM$(B,$(0N]0*Hd(B) $(0*/=((B, $(0+$)p(B")))
|
||||
(sample-text . "Cantonese ($(0GnM$(B,$(0N]0*Hd(B) $(0*/=((B, $(0+$)p(B")
|
||||
(documentation . nil)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Chinese CNS11643 (traditional)
|
||||
|
|
@ -225,6 +248,8 @@ information.")
|
|||
"Chinese-CNS" '("quail-tsangchi-cns" quail-use-package "quail/tsangchi-cns"))
|
||||
|
||||
(defun setup-chinese-cns-environment ()
|
||||
"Setup multilingual environment (MULE) for Chinese CNS11643 family users."
|
||||
(interactive)
|
||||
(setq primary-language "Chinese-CNS")
|
||||
|
||||
(setq coding-category-iso-else 'iso-2022-cn)
|
||||
|
|
@ -241,16 +266,22 @@ information.")
|
|||
(set-terminal-coding-system 'iso-2022-cn)
|
||||
(set-keyboard-coding-system 'iso-2022-cn)
|
||||
|
||||
(setq default-input-method '("Chinese-CNS" . "quail-py-cns"))
|
||||
(setq default-input-method '("Chinese-CNS" . "quail-quick-cns"))
|
||||
)
|
||||
|
||||
(defun describe-chinese-cns-support ()
|
||||
"Describe how Emacs supports Chinese for CNS11643 family users."
|
||||
(interactive)
|
||||
(describe-language-support-internal "Chinese-CNS"))
|
||||
|
||||
(set-language-info-alist
|
||||
"Chinese-CNS" '((setup-function . setup-chinese-cns-environment)
|
||||
(describe-function . describe-chinese-cns-support)
|
||||
(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))
|
||||
(documentation . t)))
|
||||
(documentation . nil)))
|
||||
|
||||
;;; chinese.el ends here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue