Commit 335a7ad7 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

Most of setup-LANGUAGE-environment functions are

moved form LANGUAGE.el to LANG-util.el.  These functions now at
first call setup-english-environment to reset various values to
the defaults.
parent e4e6cfa0
......@@ -24,6 +24,87 @@
;;; Code:
;;;###autoload
(defun setup-chinese-gb-environment ()
"Setup multilingual environment (MULE) for Chinese GB2312 users."
(interactive)
(setup-english-environment)
(setq primary-language "Chinese-GB")
(setq coding-category-iso-8-2 'cn-gb-2312)
(setq coding-category-iso-else 'iso-2022-cn)
(setq coding-category-big5 'cn-big5)
(set-coding-priority
'(coding-category-iso-7
coding-category-iso-else
coding-category-iso-8-2
coding-category-big5
coding-category-iso-8-1
coding-category-emacs-mule))
(setq-default buffer-file-coding-system 'cn-gb-2312)
(set-terminal-coding-system-internal 'cn-gb-2312)
(set-keyboard-coding-system-internal 'cn-gb-2312)
(setq sendmail-coding-system nil
rmail-file-coding-system 'iso-2022-cn)
(setq default-input-method '("Chinese-GB" . "quail-py")))
;;;###autoload
(defun setup-chinese-big5-environment ()
"Setup multilingual environment (MULE) for Chinese Big5 users."
(interactive)
(setup-english-environment)
(setq primary-language "Chinese-BIG5")
(setq coding-category-iso-8-2 'cn-big5)
(setq coding-category-iso-else 'iso-2022-cn)
(setq coding-category-big5 'cn-big5)
(set-coding-priority
'(coding-category-iso-7
coding-category-iso-else
coding-category-big5
coding-category-iso-8-2
coding-category-emacs-mule))
(setq-default buffer-file-coding-system 'cn-big5)
(set-terminal-coding-system-internal 'cn-big5)
(set-keyboard-coding-system-internal 'cn-big5)
(setq sendmail-coding-system nil
rmail-file-coding-system 'iso-2022-cn)
(setq default-input-method '("Chinese-BIG5" . "quail-py-b5")))
;;;###autoload
(defun setup-chinese-cns-environment ()
"Setup multilingual environment (MULE) for Chinese CNS11643 family users."
(interactive)
(setup-english-environment)
(setq primary-language "Chinese-CNS")
(setq coding-category-iso-else 'iso-2022-cn)
(setq coding-category-big5 'cn-big5)
(setq coding-category-iso-8-2 'cn-big5)
(set-coding-priority
'(coding-category-iso-7
coding-category-iso-else
coding-category-iso-8-2
coding-category-big5))
(setq-default buffer-file-coding-system 'iso-2022-cn)
(set-terminal-coding-system-internal 'iso-2022-cn)
(set-keyboard-coding-system-internal 'iso-2022-cn)
(setq sendmail-coding-system nil
rmail-file-coding-system 'iso-2022-cn)
(setq default-input-method '("Chinese-CNS" . "quail-quick-cns")))
;; Hz/ZW encoding stuffs
;; HZ is an encoding method for Chinese character set GB2312 used
......
......@@ -46,15 +46,16 @@
(define-coding-system-alias 'iso-2022-cn 'iso-2022-cn-ext)
(set-language-info-alist
"Chinese" '((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/select one of them to get more information.")
))
(define-prefix-command 'describe-chinese-support-map)
(define-key-after describe-language-support-map [Chinese]
'("Chinese" . describe-chinese-support-map)
t)
(define-prefix-command 'setup-chinese-environment-map)
(define-key-after setup-language-environment-map [Chinese]
'("Chinese" . setup-chinese-environment-map)
t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Chinese GB2312 (simplified)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
......@@ -108,37 +109,15 @@ Please specify/select one of them to get more information.")
(register-input-method
"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)
(setq coding-category-iso-else 'iso-2022-cn)
(setq coding-category-big5 'cn-big5)
(set-coding-priority
'(coding-category-iso-7
coding-category-iso-else
coding-category-iso-8-2
coding-category-big5
coding-category-iso-8-1
coding-category-emacs-mule
))
(setq-default buffer-file-coding-system 'cn-gb-2312)
(set-terminal-coding-system 'cn-gb-2312)
(set-keyboard-coding-system 'cn-gb-2312)
(setq default-input-method '("Chinese-GB" . "quail-py"))
)
(set-language-info-alist
"Chinese-GB" '((setup-function . setup-chinese-gb-environment)
"Chinese-GB" '((setup-function . (setup-chinese-gb-environment
. setup-chinese-environment-map))
(charset . (chinese-gb2312 chinese-sisheng))
(coding-system . (cn-gb-2312 hz-gb-2312 iso-2022-cn))
(sample-text . "Chinese ($AVPND(B,$AFUM(;0(B,$A::So(B) $ADc:C(B")
(documentation . t)))
(documentation . ("Support for Chinese GB2312 character set."
. describe-chinese-support-map))
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Chinese BIG5 (traditional)
......@@ -189,34 +168,15 @@ Please specify/select one of them to get more information.")
(register-input-method
"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)
(setq coding-category-iso-else 'iso-2022-cn)
(setq coding-category-iso-8-2 'cn-gb-2312)
(set-coding-priority
'(coding-category-iso-7
coding-category-iso-else
coding-category-big5
coding-category-iso-8-2))
(setq-default buffer-file-coding-system 'cn-big5)
(set-terminal-coding-system 'cn-big5)
(set-keyboard-coding-system 'cn-big5)
(setq default-input-method '("Chinese-BIG5" . "quail-py-b5"))
)
(set-language-info-alist
"Chinese-BIG5" '((setup-function . setup-chinese-big5-environment)
"Chinese-BIG5" '((setup-function . (setup-chinese-big5-environment
. setup-chinese-environment-map))
(charset . (chinese-big5-1 chinese-big5-2))
(coding-system . (cn-big5 iso-2022-cn))
(sample-text . "Cantonese ($(0GnM$(B,$(0N]0*Hd(B) $(0*/=((B, $(0+$)p(B")
(documentation . t)))
(documentation . ("Support for Chinese Big5 character set."
. describe-chinese-support-map))
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Chinese CNS11643 (traditional)
......@@ -227,35 +187,16 @@ Please specify/select one of them to get more information.")
(register-input-method
"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)
(setq coding-category-big5 'cn-big5)
(setq coding-category-iso-8-2 'cn-gb-2312)
(set-coding-priority
'(coding-category-iso-7
coding-category-iso-else
coding-category-iso-8-2
coding-category-big5))
(setq-default buffer-file-coding-system 'iso-2022-cn)
(set-terminal-coding-system 'iso-2022-cn)
(set-keyboard-coding-system 'iso-2022-cn)
(setq default-input-method '("Chinese-CNS" . "quail-quick-cns"))
)
(set-language-info-alist
"Chinese-CNS" '((setup-function . setup-chinese-cns-environment)
"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 . (iso-2022-cn))
(documentation . t)))
(documentation . ("Support for Chinese CNS character sets."
. describe-chinese-support-map))
))
;;; chinese.el ends here
......@@ -29,6 +29,16 @@
;;; Code:
(define-prefix-command 'describe-cyrillic-support-map)
(define-key-after describe-language-support-map [Cyrillic]
'("Cyrillic" . describe-cyrillic-support-map)
t)
(define-prefix-command 'setup-cyrillic-environment-map)
(define-key-after setup-language-environment-map [Cyrillic]
'("Cyrillic" . setup-cyrillic-environment-map)
t)
;; ISO-8859-5 staff
(make-coding-system
......@@ -171,7 +181,7 @@
(cons (cons "alternativnyj" ccl-encode-alternativnyj-font)
font-ccl-encoder-alist))
;;; GENERAL
;;; For all Cyrillics.
(register-input-method
"Cyrillic" '("quail-jcuken" quail-use-package "quail/cyrillic"))
......@@ -186,29 +196,30 @@
(register-input-method
"Cyrillic" '("quail-yawerty" quail-use-package "quail/cyrillic"))
(defun setup-cyrillic-environment ()
"Setup multilingual environment for Cyrillic users."
(interactive)
(setq primary-language "Cyrillic")
(setq coding-category-iso-8-1 'iso-8859-5)
(set-coding-priority
'(coding-category-iso-7
coding-category-iso-8-1))
(setq-default buffer-file-coding-system 'iso-8859-5)
(set-terminal-coding-system 'iso-8859-5)
(set-keyboard-coding-system 'iso-8859-5)
(set-language-info-alist
"Cyrillic-ISO" '((setup-function . (setup-cyrillic-iso-environment
. setup-cyrillic-environment-map))
(charset . (cyrillic-iso8859-5))
(coding-system . (iso-8859-5))
(sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
(documentation . (t . describe-cyrillic-support-map))))
(setq default-input-method '("Cyrillic" . "quail-yawerty"))
)
(set-language-info-alist
"Cyrillic-KOI8" '((setup-function . (setup-cyrillic-iso-environment
. setup-cyrillic-environment-map))
(charset . (cyrillic-iso8859-5))
(coding-system . (koi8-4))
(sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
(documentation . (t . describe-cyrillic-support-map))))
(set-language-info-alist
"Cyrillic" '((setup-function . setup-cyrillic-environment)
(charset . (cyrillic-iso8859-5))
(coding-system . (iso-8859-5 koi8 alternativnyj))
(sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
(documentation . t)))
"Cyrillic-ALTERNATIVNYJ" '((setup-function
. (setup-cyrillic-iso-environment
. setup-cyrillic-environment-map))
(charset . (cyrillic-iso8859-5))
(coding-system . (alternativnyj))
(sample-text . "Russian (,L@caaZXY(B) ,L7T`PRabRcYbU(B!")
(documentation
. (t . describe-cyrillic-support-map))))
;;; cyrillic.el ends here
......@@ -44,6 +44,13 @@
;;; Intersection Function will be used.
(require 'cl)
;;;###autoload
(defun setup-devanagari-environment ()
"Setup multilingual environment (MULE) for languages using Devanagari."
(interactive)
(setup-8-bit-environment nil 'in-is13194-devanagari
'("Devanagari" . "quail-devanagari-itrans")))
;;; Basic functions.
;;;###autoload
......
......@@ -57,25 +57,15 @@ devanagari-compose-from-is13194-region
"Devanagari" '("quail-devanagari-hindi-transliteration" quail-use-package
"quail/devanagari"))
(defun setup-devanagari-environment ()
"Setup multilingual environment (MULE) for languages using Devanagari."
(interactive)
(setq coding-category-iso-8-1 'in-is13194-devanagari)
(set-coding-priority
'(coding-category-iso-7
coding-category-iso-8-1))
(setq-default buffer-file-coding-system 'in-is13194-devanagari)
(setq default-input-method '("Devanagari" . "quail-devanagari-itrans"))
)
(set-language-info-alist
"Devanagari" '((setup-function . setup-devanagari-environment)
"Devanagari" '((setup-function . (setup-devanagari-environment
. setup-indian-environment-map))
(charset . (indian-is13194 indian-2-column indian-1-column))
(coding-system . (in-is13194-devanagari))
(documentation . t)))
(documentation . ("\
Such languages using Devanagari script as Hindi and Marathi
are supported in this language environment."
. describe-indian-support-map))))
;;
;; Devanagari Glyph List
......
......@@ -26,6 +26,42 @@
;;; Code:
;;;###autoload
(defun setup-ethiopic-environment ()
"Setup multilingual environment for Ethiopic."
(interactive)
(setup-english-environment)
(setq primary-language "Ethiopic")
(setq default-input-method '("Ethiopic" . "quail-ethio"))
;;
;; key bindings
;;
(define-key global-map [f4] 'sera-to-fidel-buffer)
(define-key global-map [S-f4] 'sera-to-fidel-region)
(define-key global-map [C-f4] 'sera-to-fidel-marker)
(define-key global-map [f5] 'fidel-to-sera-buffer)
(define-key global-map [S-f5] 'fidel-to-sera-region)
(define-key global-map [C-f5] 'fidel-to-sera-marker)
(define-key global-map [f6] 'ethio-modify-vowel)
(define-key global-map [f7] 'ethio-replace-space)
(define-key global-map [f8] 'ethio-input-special-character)
(define-key global-map [S-f2] 'ethio-replace-space) ; as requested
(add-hook
'rmail-mode-hook
'(lambda ()
(define-key rmail-mode-map [C-f4] 'sera-to-fidel-mail)
(define-key rmail-mode-map [C-f5] 'fidel-to-sera-mail)))
(add-hook
'mail-mode-hook
'(lambda ()
(define-key mail-mode-map [C-f4] 'sera-to-fidel-mail)
(define-key mail-mode-map [C-f5] 'fidel-to-sera-mail)))
)
;;
;; ETHIOPIC UTILITY FUNCTIONS
;;
......
......@@ -51,40 +51,6 @@
(register-input-method
"Ethiopic" '("quail-ethio" quail-use-package "quail/ethiopic"))
(defun setup-ethiopic-environment ()
"Setup multilingual environment for Ethiopic."
(interactive)
(setq primary-language "Ethiopic")
(setq default-input-method '("Ethiopic" . "quail-ethio"))
;;
;; key bindings
;;
(define-key global-map [f4] 'sera-to-fidel-buffer)
(define-key global-map [S-f4] 'sera-to-fidel-region)
(define-key global-map [C-f4] 'sera-to-fidel-marker)
(define-key global-map [f5] 'fidel-to-sera-buffer)
(define-key global-map [S-f5] 'fidel-to-sera-region)
(define-key global-map [C-f5] 'fidel-to-sera-marker)
(define-key global-map [f6] 'ethio-modify-vowel)
(define-key global-map [f7] 'ethio-replace-space)
(define-key global-map [f8] 'ethio-input-special-character)
(define-key global-map [S-f2] 'ethio-replace-space) ; as requested
(add-hook
'rmail-mode-hook
'(lambda ()
(define-key rmail-mode-map [C-f4] 'sera-to-fidel-mail)
(define-key rmail-mode-map [C-f5] 'fidel-to-sera-mail)))
(add-hook
'mail-mode-hook
'(lambda ()
(define-key mail-mode-map [C-f4] 'sera-to-fidel-mail)
(define-key mail-mode-map [C-f5] 'fidel-to-sera-mail)))
)
(set-language-info-alist
"Ethiopic" '((setup-function . setup-ethiopic-environment)
(charset . (ethiopic))
......
......@@ -28,69 +28,172 @@
;;; Code:
(define-prefix-command 'describe-european-support-map)
(define-key-after describe-language-support-map [European]
'("European" . describe-european-support-map)
t)
(define-prefix-command 'setup-european-environment-map)
(define-key-after setup-language-environment-map [European]
'("European" . setup-european-environment-map)
t)
;; Setup for a langauge which uses one-byte 8-bit CHARSET, one-byte
;; 8-bit CODING-SYSTEM, and INPUT-METHOD.
(defun setup-8-bit-environment (charset coding-system input-method)
(setup-english-environment)
(setq-default buffer-file-coding-system coding-system)
(setq coding-category-iso-8-1 coding-system
coding-category-iso-8-2 coding-system)
(set-terminal-coding-system-internal coding-system)
(set-keyboard-coding-system-internal coding-system)
(setq sendmail-coding-system nil
rmail-file-coding-system coding-system)
(if charset
(let ((nonascii-offset (make-char charset)))
(setq nonascii-insert-offset nonascii-offset
set-case-syntax-offset nonascii-offset)))
(if input-method
(setq default-input-method input-method)))
;; Latin1 (ISO-8859-1)
(make-coding-system
'iso-8859-1 2 ?X
"Coding-system used in X as Compound Text Encoding."
"MIME ISO-8859-1 Compound Text Encoding."
'((ascii t) (latin-iso8859-1 t) nil nil
nil ascii-eol ascii-cntl))
;; CTEXT is an alias for ISO-8859-1
(define-coding-system-alias 'iso-8859-1 'ctext)
(register-input-method "Latin1"
'("quail-latin-1" quail-use-package "quail/latin"))
(defun setup-latin1-environment ()
"Setup multilingual environment (MULE) for European Latin1 users."
(interactive)
(setup-8-bit-environment 'latin-iso8859-1 'iso-8859-1
'("Latin1" . "quail-latin-1")))
(set-language-info-alist
"Latin1" '((setup-function . (setup-latin1-environment
. setup-european-environment-map))
(charset . (ascii latin-iso8859-1))
(coding-system . (iso-8859-1))
(sample-text
. "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!")
(documentation . ("\
The following languages is supported by Latin1 (ISO-8859-1) character set.
" . describe-european-support-map))
))
;; Latin2 (ISO-8859-2)
(make-coding-system
'iso-8859-2 2 ?2 "MIME ISO-8859-2"
'((ascii t) (latin-iso8859-2 t) nil nil
nil ascii-eol ascii-cntl nil nil nil nil))
(register-input-method "Latin2"
'("quail-latin-2" quail-use-package "quail/latin"))
(defun setup-latin2-environment ()
"Setup multilingual environment (MULE) for European Latin2 users."
(interactive)
(setup-8-bit-environment 'latin-iso8859-2 'iso-8859-2
'("Latin2" . "quail-latin-2")))
(set-language-info-alist
"Latin2" '((setup-function . (setup-latin2-environment
. setup-european-environment-map))
(charset . (ascii latin-iso8859-2))
(coding-system . (iso-8859-2))
(documentation . ("\
The following languages is supported by Latin2 (ISO-8859-2) character set.
" . describe-european-support-map))
))
;; Latin3 (ISO-8859-3)
(make-coding-system
'iso-8859-3 2 ?3 "MIME ISO-8859-3"
'((ascii t) (latin-iso8859-3 t) nil nil
nil ascii-eol ascii-cntl nil nil nil nil))
(register-input-method "Latin3"
'("quail-latin-3" quail-use-package "quail/latin"))
(defun setup-latin3-environment ()
"Setup multilingual environment (MULE) for European Latin3 users."
(interactive)
(setup-8-bit-environment 'latin-iso8859-3 'iso-8859-3
'("Latin3" . "quail-latin-3")))
(set-language-info-alist
"Latin3" '((setup-function . (setup-latin3-environment
. setup-european-environment-map))
(charset . (ascii latin-iso8859-3))
(coding-system . (iso-8859-3))
(documentation . ("\
The following languages is supported by Latin3 (ISO-8859-3) character set.
" . describe-european-support-map))
))
;; Latin4 (ISO-8859-4)
(make-coding-system
'iso-8859-4 2 ?4 "MIME ISO-8859-4"
'((ascii t) (latin-iso8859-4 t) nil nil
nil ascii-eol ascii-cntl nil nil nil nil))
(register-input-method "European"
'("quail-latin-4" quail-use-package "quail/latin"))
(defun setup-latin4-environment ()
"Setup multilingual environment (MULE) for European Latin4 users."
(interactive)
(setup-8-bit-environment 'latin-iso8859-4 'iso-8859-4
'("Latin4" . "quail-latin-4")))
(set-language-info-alist
"Latin4" '((setup-function . (setup-latin4-environment
. setup-european-environment-map))
(charset . (ascii latin-iso8859-1))
(coding-system . (iso-8859-4))
(documentation . ("\
The following languages is supported by Latin4 (ISO-8859-4) character set.
" . describe-european-support-map))
))
;; Latin4 (ISO-8859-9)
(make-coding-system
'iso-8859-9 2 ?9 "MIME ISO-8859-9"
'((ascii t) (latin-iso8859-9 t) nil nil
nil ascii-eol ascii-cntl nil nil nil nil))
(register-input-method "European"
'("quail-latin-1" quail-use-package "quail/latin"))
(register-input-method "European"
'("quail-latin-2" quail-use-package "quail/latin"))
(register-input-method "European"
'("quail-latin-3" quail-use-package "quail/latin"))
(register-input-method "European"
'("quail-latin-4" quail-use-package "quail/latin"))
(register-input-method "European"
'("quail-latin-5" quail-use-package "quail/latin"))
(defun setup-european-environment ()
"Setup multilingual environment (MULE) for European languages users.
It actually reset MULE to the default status, and
set quail-latin-1 as the default input method to be selected.
See also the documentation of setup-english-environment."
(setup-english-environment)
(setq default-input-method '("European" . "quail-latin-1")))
(defun setup-latin5-environment ()
"Setup multilingual environment (MULE) for European Latin5 users."
(interactive)