17052
|
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
|
17071
|
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.
|
17052
|
24
|
|
25 ;;; Commentary:
|
|
26
|
|
27 ;; For Japanese, character sets JISX0201, JISX0208, JISX0212 are
|
|
28 ;; supported.
|
|
29
|
|
30 ;;; Code:
|
|
31
|
|
32 (make-coding-system
|
|
33 'coding-system-sjis 1 ?S
|
|
34 "Coding-system of Shift-JIS used in Japan." t)
|
|
35
|
|
36 ;; ISO-2022-JP and JUNET are aliases for ISO-2022-7.
|
|
37 (put 'coding-system-iso-2022-jp 'coding-system 'coding-system-iso-2022-7)
|
|
38 (put 'coding-system-junet 'coding-system 'coding-system-iso-2022-7)
|
|
39
|
|
40 (make-coding-system
|
|
41 'coding-system-old-jis 2 ?J
|
|
42 "Coding-system used for old jis terminal."
|
|
43 '((ascii t) nil nil nil
|
|
44 short ascii-eol ascii-cntl seven nil nil use-roman use-oldjis))
|
|
45
|
|
46 (make-coding-system
|
|
47 'coding-system-euc-japan 2 ?E
|
|
48 "Coding-system of Japanese EUC (Extended Unix Code)."
|
|
49 '(ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212
|
|
50 short ascii-eol ascii-cntl nil nil single-shift))
|
|
51
|
|
52 (register-input-method
|
|
53 "Japanese" '("quail-ja" quail-use-package "quail/japanese"))
|
|
54
|
|
55 (register-input-method
|
|
56 "Japanese" '("quail-ja-hiragana" quail-use-package "quail/japanese"))
|
|
57
|
|
58 (defun setup-japanese-environment ()
|
|
59 (interactive)
|
|
60 (setq coding-category-iso-8-2 'coding-system-euc-japan)
|
|
61
|
|
62 (set-coding-priority
|
|
63 '(coding-category-iso-7
|
|
64 coding-category-iso-8-2
|
|
65 coding-category-sjis
|
|
66 coding-category-iso-8-1
|
|
67 coding-category-iso-else
|
|
68 coding-category-internal))
|
|
69
|
|
70 (if (eq system-type 'ms-dos)
|
|
71 (progn
|
|
72 (setq-default buffer-file-coding-system 'coding-system-sjis)
|
|
73 (set-terminal-coding-system 'coding-system-sjis)
|
|
74 (set-keyboard-coding-system 'coding-system-sjis)
|
|
75 (setq default-process-coding-system
|
|
76 '(coding-system-sjis-dos . coding-system-sjis-dos)))
|
|
77 (setq-default buffer-file-coding-system 'coding-system-iso-2022-jp)
|
|
78 (set-terminal-coding-system 'coding-system-iso-2022-jp)
|
|
79 (set-keyboard-coding-system 'coding-system-iso-2022-jp))
|
|
80
|
|
81 (set-default-input-method "Japanese" "quail-ja")
|
|
82 )
|
|
83
|
|
84 (set-language-info-alist
|
|
85 "Japanese" '((setup-function . setup-japanese-environment)
|
|
86 (tutorial . "TUTORIAL.jp")
|
|
87 (charset . (japanese-jisx0208 japanese-jisx0208-1978
|
|
88 japanese-jisx0212 latin-jisx0201
|
|
89 katakana-jisx0201))
|
|
90 (coding-system . (coding-system-euc-japan
|
|
91 coding-system-sjis
|
|
92 coding-system-old-jis
|
|
93 coding-system-iso-2022-jp))
|
|
94 (documentation . t)
|
|
95 (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B")))
|
|
96
|
|
97 ;;; japanese.el ends here
|