Coding system names changed as follows:
[bpt/emacs.git] / lisp / language / japanese.el
1 ;;; japanese.el --- Japanese support
2
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
5
6 ;; Keywords: multilingual, Japanese
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;; For Japanese, character sets JISX0201, JISX0208, JISX0212 are
28 ;; supported.
29
30 ;;; Code:
31
32 (define-coding-system-alias 'iso-2022-7 'iso-2022-jp)
33 (define-coding-system-alias 'iso-2022-7 'junet)
34
35 (make-coding-system
36 'shift_jis 1 ?S
37 "Coding-system of Shift-JIS used in Japan." t)
38
39 (define-coding-system-alias 'shift_jis 'sjis)
40
41 (make-coding-system
42 'iso-2022-jp-1978-irv 2 ?J
43 "Coding-system used for old jis terminal."
44 '((ascii t) nil nil nil
45 short ascii-eol ascii-cntl seven nil nil use-roman use-oldjis))
46
47 (define-coding-system-alias 'iso-2022-jp-1978-irv 'old-jis)
48
49 (make-coding-system
50 'euc-japan-1990 2 ?E
51 "Coding-system of Japanese EUC (Extended Unix Code)."
52 '(ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212
53 short ascii-eol ascii-cntl nil nil single-shift))
54
55 (define-coding-system-alias 'euc-japan-1990 'euc-japan)
56
57 (register-input-method
58 "Japanese" '("quail-ja-hiragana" quail-use-package "quail/japanese"))
59 (register-input-method
60 "Japanese" '("quail-ja" quail-use-package "quail/japanese"))
61
62 (defun setup-japanese-environment ()
63 "Setup multilingual environment (MULE) for Japanese."
64 (interactive)
65 (setq coding-category-iso-8-2 'euc-japan-1990)
66
67 (set-coding-priority
68 '(coding-category-iso-7
69 coding-category-iso-8-2
70 coding-category-sjis
71 coding-category-iso-8-1
72 coding-category-iso-else
73 coding-category-emacs-mule))
74
75 (if (eq system-type 'ms-dos)
76 (progn
77 (setq-default buffer-file-coding-system 'sjis)
78 (set-terminal-coding-system 'sjis)
79 (set-keyboard-coding-system 'sjis)
80 (setq default-process-coding-system '(sjis-dos . sjis-dos)))
81 (setq-default buffer-file-coding-system 'iso-2022-jp)
82 (set-terminal-coding-system 'iso-2022-jp)
83 (set-keyboard-coding-system 'iso-2022-jp))
84
85 (set-default-input-method "Japanese" "quail-ja")
86
87 (setq sendmail-coding-system 'iso-2022-jp
88 rmail-file-coding-system 'iso-2022-jp)
89 )
90
91 (set-language-info-alist
92 "Japanese" '((setup-function . setup-japanese-environment)
93 (tutorial . "TUTORIAL.jp")
94 (charset . (japanese-jisx0208 japanese-jisx0208-1978
95 japanese-jisx0212 latin-jisx0201
96 katakana-jisx0201))
97 (coding-system . (euc-japan-1990 sjis
98 iso-2022-jp iso-2022-jp-1978-irv))
99 (sample-text . "Japanese (\e$BF|K\8l\e(B) \e$B$3$s$K$A$O\e(B, \e(I:]FAJ\e(B")
100 (documentation . t)))
101
102 ;;; japanese.el ends here