korean.el 2.7 KB
Newer Older
Karl Heuer's avatar
Karl Heuer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
;;; korean.el --- Support for Korean

;; Copyright (C) 1995 Free Software Foundation, Inc.
;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.

;; Keywords: multilingual, Korean

;; This file is part of GNU Emacs.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
Karl Heuer's avatar
Karl Heuer committed
21 22 23
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
Karl Heuer's avatar
Karl Heuer committed
24 25 26 27 28 29 30 31

;;; Commentary:

;; For Korean, the character set KSC5601 is supported.

;;; Code:

(make-coding-system
32
 'euc-kr 2 ?K
Karl Heuer's avatar
Karl Heuer committed
33 34 35 36
 "Coding-system of Korean EUC (Extended Unix Code)."
 '((ascii t) korean-ksc5601 nil nil
   nil ascii-eol ascii-cntl))

37
(define-coding-system-alias 'euc-kr 'euc-korea)
Karl Heuer's avatar
Karl Heuer committed
38 39

(make-coding-system
40 41
 'iso-2022-kr 2 ?k
 "MIME ISO-2022-KR"
Karl Heuer's avatar
Karl Heuer committed
42
 '(ascii (nil korean-ksc5601) nil nil
43
	 nil ascii-eol ascii-cntl seven locking-shift nil nil nil nil nil
44
	 designation-bol))
Karl Heuer's avatar
Karl Heuer committed
45 46 47 48 49 50 51 52 53 54 55 56 57

(register-input-method
 "Korean" '("quail-hangul" quail-use-package "quail/hangul"))
(register-input-method
 "Korean" '("quail-hangul3" quail-use-package "quail/hangul3"))
(register-input-method
 "Korean" '("quail-hanja" quail-use-package "quail/hanja"))
(register-input-method
 "Korean" '("quail-symbol-ksc" quail-use-package "quail/symbol-ksc"))
(register-input-method
 "Korean" '("quail-hanja-jis" quail-use-package "quail/hanja-jis"))

(defun setup-korean-environment ()
58 59 60
  "Setup multilingual environment (MULE) for Korean."
  (interactive)
  (setup-english-environment)
61
  (setq coding-category-iso-8-2 'euc-kr)
Karl Heuer's avatar
Karl Heuer committed
62 63 64 65 66 67

  (set-coding-priority
   '(coding-category-iso-7
     coding-category-iso-8-2
     coding-category-iso-8-1))

68
  (setq-default buffer-file-coding-system 'euc-kr)
Karl Heuer's avatar
Karl Heuer committed
69 70 71 72

  (setq default-input-method '("Korean" . "quail-hangul"))
  )

73 74 75 76 77
(defun describe-korean-support ()
  "Describe How Emacs supports Korean."
  (interactive)
  (describe-language-support-internal "Korean"))

Karl Heuer's avatar
Karl Heuer committed
78 79
(set-language-info-alist
 "Korean" '((setup-function . setup-korean-environment)
80
	    (describe-function . describe-korean-support)
Karl Heuer's avatar
Karl Heuer committed
81 82
	    (tutorial . "TUTORIAL.kr")
	    (charset . (korean-ksc5601))
83
	    (coding-system . (euc-kr iso-2022-kr))
84 85
	    (sample-text . "Hangul ($(CGQ1[(B)	$(C>H3gGO<<?d(B, $(C>H3gGO=J4O1n(B")
	    (documentation . nil)))
Karl Heuer's avatar
Karl Heuer committed
86 87

;;; korean.el ends here