159
|
1 ;;; korean.el --- Support for Korean
|
|
2
|
|
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
|
197
|
4 ;; Licensed to the Free Software Foundation.
|
159
|
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
|
|
6
|
|
7 ;; Keywords: multilingual, Korean
|
|
8
|
|
9 ;; This file is part of XEmacs.
|
|
10
|
|
11 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
12 ;; under the terms of the GNU General Public License as published by
|
|
13 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
14 ;; any later version.
|
|
15
|
|
16 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
19 ;; General Public License for more details.
|
|
20
|
|
21 ;; You should have received a copy of the GNU General Public License
|
|
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
24 ;; 02111-1307, USA.
|
|
25
|
|
26 ;;; Commentary:
|
|
27
|
|
28 ;; For Korean, the character set KSC5601 is supported.
|
|
29
|
|
30 ;;; Code:
|
|
31
|
|
32 ;; Syntax of Korean characters.
|
|
33 (loop for row from 33 to 34 do
|
|
34 (modify-syntax-entry `[korean-ksc5601 ,row] "."))
|
|
35 (loop for row from 35 to 37 do
|
|
36 (modify-syntax-entry `[korean-ksc5601 ,row] "w"))
|
|
37 (loop for row from 38 to 41 do
|
|
38 (modify-syntax-entry `[korean-ksc5601 ,row] "."))
|
|
39 (loop for row from 42 to 126 do
|
|
40 (modify-syntax-entry `[korean-ksc5601 ,row] "w"))
|
|
41
|
|
42 ;; Setting for coding-system and quail were moved to
|
|
43 ;; language/korean.el.
|
|
44
|
|
45 (make-coding-system
|
|
46 'iso-2022-int-1 'iso2022
|
|
47 "ISO-2022-INT-1"
|
|
48 '(charset-g0 ascii
|
|
49 charset-g1 korean-ksc5601
|
|
50 short t
|
|
51 seven t
|
|
52 lock-shift t
|
|
53 mnemonic "INT-1"))
|
|
54
|
|
55 ;; EGG specific setup
|
|
56 (define-egg-environment 'korean
|
|
57 "Korean settings for egg"
|
|
58 (lambda ()
|
|
59 (when (not (featurep 'egg-kor))
|
|
60 (load "its-hangul")
|
|
61 (setq its:*standard-modes*
|
|
62 (cons (its:get-mode-map "hangul") its:*standard-modes*))
|
|
63 (provide 'egg-kor))
|
|
64 (setq wnn-server-type 'kserver)
|
|
65 (setq egg-default-startup-file "eggrc-wnn")
|
|
66 (setq-default its:*current-map* (its:get-mode-map "hangul"))))
|
|
67
|
|
68 ;; (make-coding-system
|
|
69 ;; 'euc-kr 2 ?K
|
|
70 ;; "Coding-system of Korean EUC (Extended Unix Code)."
|
|
71 ;; '((ascii t) korean-ksc5601 nil nil
|
|
72 ;; nil ascii-eol ascii-cntl))
|
|
73
|
|
74 (make-coding-system
|
|
75 'euc-kr 'iso2022
|
|
76 "Coding-system of Korean EUC (Extended Unix Code)."
|
|
77 '(charset-g0 ascii
|
|
78 charset-g1 korean-ksc5601
|
|
79 mnemonic "ko/EUC"
|
|
80 eol-type lf))
|
|
81
|
|
82 ;;(define-coding-system-alias 'euc-kr 'euc-korea)
|
|
83
|
|
84 (copy-coding-system 'euc-kr 'korean-euc)
|
|
85
|
|
86 ;; (make-coding-system
|
|
87 ;; 'iso-2022-kr 2 ?k
|
|
88 ;; "MIME ISO-2022-KR"
|
|
89 ;; '(ascii (nil korean-ksc5601) nil nil
|
|
90 ;; nil ascii-eol ascii-cntl seven locking-shift nil nil nil nil nil
|
|
91 ;; designation-bol))
|
|
92
|
|
93 (make-coding-system
|
|
94 'iso-2022-kr 'iso2022
|
|
95 "Coding-System used for communication with mail in Korea."
|
|
96 '(charset-g0 ascii
|
|
97 charset-g1 korean-ksc5601
|
|
98 force-g1-on-output t
|
|
99 seven t
|
|
100 lock-shift t
|
|
101 mnemonic "Ko/7bit"
|
|
102 eol-type lf))
|
|
103
|
|
104 (defun setup-korean-environment ()
|
|
105 "Setup multilingual environment (MULE) for Korean."
|
|
106 (interactive)
|
|
107 (setup-english-environment)
|
|
108 (setq coding-category-iso-8-2 'euc-kr)
|
197
|
109
|
159
|
110 (set-coding-priority
|
|
111 '(coding-category-iso-7
|
|
112 coding-category-iso-8-2
|
|
113 coding-category-iso-8-1))
|
|
114
|
197
|
115 (set-default-coding-systems 'euc-kr)
|
|
116
|
|
117 (setq default-input-method "korean-hangul"))
|
159
|
118
|
|
119 (set-language-info-alist
|
|
120 "Korean" '((setup-function . setup-korean-environment)
|
|
121 (tutorial . "TUTORIAL.kr")
|
|
122 (charset . (korean-ksc5601))
|
197
|
123 (coding-system . (iso-2022-kr euc-kr))
|
|
124 (sample-text . "Hangul ($(CGQ1[(B) $(C>H3gGO<<?d(B, $(C>H3gGO=J4O1n(B")
|
|
125 (documentation . t)))
|
159
|
126
|
|
127 ;;; for XEmacs (will be obsoleted)
|
|
128
|
|
129 (define-language-environment 'korean
|
|
130 "Korean"
|
|
131 (lambda ()
|
|
132 (set-coding-category-system 'iso-8-2 'euc-kr)
|
|
133 (set-coding-priority-list '(iso-8-2 iso-7 iso-8-designate))
|
|
134 (set-pathname-coding-system 'euc-kr)
|
|
135 (add-hook 'comint-exec-hook
|
|
136 (lambda ()
|
|
137 (let ((proc (get-buffer-process (current-buffer))))
|
|
138 (set-process-input-coding-system proc 'euc-kr)
|
|
139 (set-process-output-coding-system proc 'euc-kr))))
|
|
140 (set-buffer-file-coding-system-for-read 'automatic-conversion)
|
|
141 (set-default-buffer-file-coding-system 'euc-kr)
|
|
142 (setq keyboard-coding-system 'euc-kr)
|
|
143 (setq terminal-coding-system 'euc-kr)
|
|
144 (when (eq 'x (device-type (selected-device)))
|
|
145 (x-use-halfwidth-roman-font 'korean-ksc5601 "ksc5636"))
|
|
146
|
|
147 ;; EGG specific setup 97.02.05 jhod
|
|
148 (when (featurep 'egg)
|
|
149 (when (not (featurep 'egg-kor))
|
|
150 (provide 'egg-kor)
|
|
151 (load "its/its-hangul")
|
|
152 (setq its:*standard-modes*
|
|
153 (cons (its:get-mode-map "hangul") its:*standard-modes*)))
|
|
154 (setq-default its:*current-map* (its:get-mode-map "hangul")))
|
|
155
|
|
156 ;; ;; (setq-default quail-current-package
|
|
157 ;; ;; (assoc "hangul" quail-package-alist))
|
|
158 ))
|
|
159
|
|
160 ;;; korean.el ends here
|