Mercurial > hg > xemacs-beta
comparison lisp/language/korean.el @ 159:3bb7ccffb0c0 r20-3b6
Import from CVS: tag r20-3b6
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:41:43 +0200 |
parents | |
children | acd284d43ca1 |
comparison
equal
deleted
inserted
replaced
158:558dfa75ffb3 | 159:3bb7ccffb0c0 |
---|---|
1 ;;; korean.el --- Support for Korean | |
2 | |
3 ;; Copyright (C) 1995 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | |
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 (register-input-method | |
105 "Korean" '("quail-hangul" quail-use-package "quail/hangul")) | |
106 (register-input-method | |
107 "Korean" '("quail-hangul3" quail-use-package "quail/hangul3")) | |
108 (register-input-method | |
109 "Korean" '("quail-hanja" quail-use-package "quail/hanja")) | |
110 (register-input-method | |
111 "Korean" '("quail-symbol-ksc" quail-use-package "quail/symbol-ksc")) | |
112 (register-input-method | |
113 "Korean" '("quail-hanja-jis" quail-use-package "quail/hanja-jis")) | |
114 | |
115 (defun setup-korean-environment () | |
116 "Setup multilingual environment (MULE) for Korean." | |
117 (interactive) | |
118 (setup-english-environment) | |
119 (setq coding-category-iso-8-2 'euc-kr) | |
120 | |
121 (set-coding-priority | |
122 '(coding-category-iso-7 | |
123 coding-category-iso-8-2 | |
124 coding-category-iso-8-1)) | |
125 | |
126 (setq-default buffer-file-coding-system 'euc-kr) | |
127 | |
128 (setq default-input-method '("Korean" . "quail-hangul")) | |
129 ) | |
130 | |
131 (defun describe-korean-support () | |
132 "Describe How Emacs supports Korean." | |
133 (interactive) | |
134 (describe-language-support-internal "Korean")) | |
135 | |
136 (set-language-info-alist | |
137 "Korean" '((setup-function . setup-korean-environment) | |
138 (describe-function . describe-korean-support) | |
139 (tutorial . "TUTORIAL.kr") | |
140 (charset . (korean-ksc5601)) | |
141 (coding-system . (euc-kr iso-2022-kr)) | |
142 (sample-text . "Hangul ($(CGQ1[(B) $(C>H3gGO<<?d(B, $(C>H3gGO=J4O1n(B") | |
143 (documentation . nil))) | |
144 | |
145 ;;; for XEmacs (will be obsoleted) | |
146 | |
147 (define-language-environment 'korean | |
148 "Korean" | |
149 (lambda () | |
150 (set-coding-category-system 'iso-8-2 'euc-kr) | |
151 (set-coding-priority-list '(iso-8-2 iso-7 iso-8-designate)) | |
152 (set-pathname-coding-system 'euc-kr) | |
153 (add-hook 'comint-exec-hook | |
154 (lambda () | |
155 (let ((proc (get-buffer-process (current-buffer)))) | |
156 (set-process-input-coding-system proc 'euc-kr) | |
157 (set-process-output-coding-system proc 'euc-kr)))) | |
158 (set-buffer-file-coding-system-for-read 'automatic-conversion) | |
159 (set-default-buffer-file-coding-system 'euc-kr) | |
160 (setq keyboard-coding-system 'euc-kr) | |
161 (setq terminal-coding-system 'euc-kr) | |
162 (when (eq 'x (device-type (selected-device))) | |
163 (x-use-halfwidth-roman-font 'korean-ksc5601 "ksc5636")) | |
164 | |
165 ;; EGG specific setup 97.02.05 jhod | |
166 (when (featurep 'egg) | |
167 (when (not (featurep 'egg-kor)) | |
168 (provide 'egg-kor) | |
169 (load "its/its-hangul") | |
170 (setq its:*standard-modes* | |
171 (cons (its:get-mode-map "hangul") its:*standard-modes*))) | |
172 (setq-default its:*current-map* (its:get-mode-map "hangul"))) | |
173 | |
174 ;; ;; (setq-default quail-current-package | |
175 ;; ;; (assoc "hangul" quail-package-alist)) | |
176 )) | |
177 | |
178 ;;; korean.el ends here |