Initial git import
[sxemacs] / lisp / mule / korean.el
1 ;;; korean.el --- Support for Korean -*- coding: iso-2022-7bit; -*-
2
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
6
7 ;; Keywords: multilingual, Korean
8
9 ;; This file is part of SXEmacs.
10
11 ;; SXEmacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
15
16 ;; SXEmacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
24 ;;; Commentary:
25
26 ;; For Korean, the character set KSC5601 is supported.
27
28 ;;; Code:
29
30 ;; Syntax of Korean characters.
31 (loop for row from 33 to  34 do
32       (modify-syntax-entry `[korean-ksc5601 ,row] "."))
33 (loop for row from 35 to  37 do
34       (modify-syntax-entry `[korean-ksc5601 ,row] "w"))
35 (loop for row from 38 to  41 do
36       (modify-syntax-entry `[korean-ksc5601 ,row] "."))
37 (loop for row from 42 to 126 do
38       (modify-syntax-entry `[korean-ksc5601 ,row] "w"))
39
40 ;; Setting for coding-system and quail were moved to
41 ;; language/korean.el.
42
43 (make-coding-system
44  'iso-2022-int-1 'iso2022
45  "ISO-2022-INT-1"
46  '(charset-g0 ascii
47    charset-g1 korean-ksc5601
48    short t
49    seven t
50    lock-shift t
51    mnemonic "INT-1"))
52
53 ;; EGG specific setup
54 (define-egg-environment 'korean
55   "Korean settings for egg"
56   (lambda ()
57     (with-boundp '(its:*standard-modes* its:*current-map* wnn-server-type
58                                         egg-default-startup-file)
59       (with-fboundp 'its:get-mode-map
60         (when (not (featurep 'egg-kor))
61           (load "its-hangul")
62           (setq its:*standard-modes*
63                 (cons (its:get-mode-map "hangul") its:*standard-modes*))
64           (provide 'egg-kor))
65         (setq wnn-server-type 'kserver)
66         (setq egg-default-startup-file "eggrc-wnn")
67         (setq-default its:*current-map* (its:get-mode-map "hangul"))))))
68 \f
69 ;; (make-coding-system
70 ;;  'korean-iso-8bit 2 ?K
71 ;;  "ISO 2022 based EUC encoding for Korean KSC5601 (MIME:EUC-KR)"
72 ;;  '(ascii korean-ksc5601 nil nil
73 ;;    nil ascii-eol ascii-cntl)
74 ;;  '((safe-charsets ascii korean-ksc5601)
75 ;;    (mime-charset . euc-kr)))
76
77 (make-coding-system
78  'euc-kr 'iso2022
79  "Coding-system of Korean EUC (Extended Unix Code)."
80  '(charset-g0 ascii
81    charset-g1 korean-ksc5601
82    mnemonic "ko/EUC"
83    eol-type nil))
84
85 ;;(define-coding-system-alias 'euc-kr 'euc-korea)
86
87 (define-coding-system-alias 'korean-euc 'euc-kr)
88
89 ;; (make-coding-system
90 ;;  'iso-2022-kr 2 ?k
91 ;;  "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)."
92 ;;  '(ascii (nil korean-ksc5601) nil nil
93 ;;          nil ascii-eol ascii-cntl seven locking-shift nil nil nil nil nil
94 ;;          designation-bol)
95 ;;  '((safe-charsets ascii korean-ksc5601)
96 ;;    (mime-charset . iso-2022-kr)))
97
98 (make-coding-system
99  'iso-2022-kr 'iso2022
100  "Coding-System used for communication with mail in Korea."
101  '(charset-g0 ascii
102    charset-g1 korean-ksc5601
103    force-g1-on-output t
104    seven t
105    lock-shift t
106    mnemonic "Ko/7bit"
107    eol-type lf))
108
109 ;; (define-coding-system-alias 'korean-iso-7bit-lock 'iso-2022-kr)
110
111 (set-language-info-alist
112  "Korean" '((setup-function . setup-korean-environment-internal)
113             (exit-function . exit-korean-environment)
114             (tutorial . "TUTORIAL.ko")
115             (charset korean-ksc5601)
116             (coding-system euc-kr iso-2022-kr)
117             (coding-priority euc-kr iso-2022-kr)
118             (input-method . "korean-hangul")
119             (features korea-util)
120             (sample-text . "Hangul (\e$(CGQ1[\e(B)        \e$(C>H3gGO<<?d\e(B, \e$(C>H3gGO=J4O1n\e(B")
121             (documentation . "The following key bindings are available while using Korean input methods:
122   Shift-SPC:    toggle-korean-input-mthod
123   Control-F9:   quail-hangul-switch-symbol-ksc
124   F9:           quail-hangul-switch-hanja")
125             ))
126
127 ;;; korean.el ends here