annotate lisp/mule/japanese-hooks.el @ 110:fe104dbd9147 r20-1b7

Import from CVS: tag r20-1b7
author cvs
date Mon, 13 Aug 2007 09:19:45 +0200
parents a145efe76779
children cca96a509cfe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1 ;;; japanese-hooks.el --- pre-loaded support for Japanese.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3 ;; Copyright (C) 1992,93,94,95 Free Software Foundation, Inc.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995 Amdahl Corporation.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995 Sun Microsystems.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 ;; This file is part of XEmacs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9 ;; XEmacs is free software; you can redistribute it and/or modify it
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10 ;; under the terms of the GNU General Public License as published by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 ;; any later version.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14 ;; XEmacs is distributed in the hope that it will be useful, but
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 ;; General Public License for more details.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20 ;; along with XEmacs; see the file COPYING. If not, write to the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24 ;;; Synched up with: Mule 2.3.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 ;;; JAPANESE
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30 ;;; Syntax of Japanese characters.
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
31 (modify-syntax-entry 'katakana-jisx0201 "w")
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 (modify-syntax-entry 'japanese-jisx0212 "w")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34 (modify-syntax-entry 'japanese-jisx0208 "w")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35 (loop for row in '(33 34 40)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36 do (modify-syntax-entry `[japanese-jisx0208 ,row] "_"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37 (loop for char in '(?$B!<(B ?$B!+(B ?$B!,(B ?$B!3(B ?$B!4(B ?$B!5(B ?$B!6(B ?$B!7(B ?$B!8(B ?$B!9(B ?$B!:(B ?$B!;(B)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38 do (modify-syntax-entry char "w"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
39 (modify-syntax-entry ?\$B!J(B "($B!K(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40 (modify-syntax-entry ?\$B!N(B "($B!O(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41 (modify-syntax-entry ?\$B!P(B "($B!Q(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42 (modify-syntax-entry ?\$B!V(B "($B!W(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43 (modify-syntax-entry ?\$B!X(B "($B!Y(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44 (modify-syntax-entry ?\$B!K(B ")$B!J(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45 (modify-syntax-entry ?\$B!O(B ")$B!N(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 (modify-syntax-entry ?\$B!Q(B ")$B!P(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 (modify-syntax-entry ?\$B!W(B ")$B!V(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 (modify-syntax-entry ?\$B!Y(B ")$B!X(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51 ;;; Character categories S, A, H, K, G, Y, and C
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 (define-category ?S "Japanese 2-byte symbol character.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53 (modify-category-entry [japanese-jisx0208 33] ?S)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 (modify-category-entry [japanese-jisx0208 34] ?S)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 (modify-category-entry [japanese-jisx0208 40] ?S)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
56 (define-category ?A "Japanese 2-byte Alphanumeric character.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
57 (modify-category-entry [japanese-jisx0208 35] ?A)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
58 (define-category ?H "Japanese 2-byte Hiragana character.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 (modify-category-entry [japanese-jisx0208 36] ?H)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60 (define-category ?K "Japanese 2-byte Katakana character.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 (modify-category-entry [japanese-jisx0208 37] ?K)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62 (define-category ?G "Japanese 2-byte Greek character.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
63 (modify-category-entry [japanese-jisx0208 38] ?G)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 (define-category ?Y "Japanese 2-byte Cyrillic character.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 (modify-category-entry [japanese-jisx0208 39] ?Y)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 (define-category ?C "Japanese 2-byte Kanji characters.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 (loop for row from 48 to 126 do (modify-category-entry `[japanese-jisx0208 ,row] ?C))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68 (loop for char in '(?$B!<(B ?$B!+(B ?$B!,(B)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
69 do (modify-category-entry char ?K)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70 (modify-category-entry char ?H))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 (loop for char in '(?$B!3(B ?$B!4(B ?$B!5(B ?$B!6(B ?$B!7(B ?$B!8(B ?$B!9(B ?$B!:(B ?$B!;(B)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72 do (modify-category-entry char ?C))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 (modify-category-entry 'japanese-jisx0212 ?C)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 (defvar japanese-word-regexp
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76 "\\cA+\\cH*\\|\\cK+\\cH*\\|\\cC+\\cH*\\|\\cH+\\|\\ck+\\|\\sw+"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77 "Regular expression used to match a Japanese word.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 (set-word-regexp japanese-word-regexp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80 (setq forward-word-regexp "\\w\\>")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
81 (setq backward-word-regexp "\\<\\w")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
82
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
83 ;;; Paragraph setting
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
84 (setq sentence-end
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
85 (concat
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
86 "\\("
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
87 "\\("
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88 "[.?!][]\"')}]*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
89 "\\|"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
90 "[$B!%!)!*(B][$B!O!I!G!K!Q!M!S!U!W!Y(B]*"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
91 "\\)"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
92 "\\($\\|\t\\| \\)"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
93 "\\|"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
94 "$B!#(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
95 "\\)"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
96 "[ \t\n]*"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
97 (setq paragraph-start "^[ $B!!(B\t\n\f]")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
98 (setq paragraph-separate "^[ $B!!(B\t\f]*$")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
99
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
100 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
101 'shift-jis 'shift-jis
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
102 "Coding-system of Shift-JIS used in Japan."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
103 '(mnemonic "SJIS"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
104
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
105 (copy-coding-system 'shift-jis 'sjis)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
106
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
107 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
108 'iso-2022-jp 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
109 "Coding-system used for communication with mail and news in Japan."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
110 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
111 short t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
112 seven t
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
113 input-charset-conversion ((latin-jisx0201 ascii)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
114 (japanese-jisx0208-1978 japanese-jisx0208))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
115 mnemonic "Mail/Ja"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
116 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
117
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
118 (copy-coding-system 'iso-2022-jp 'junet)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
119
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
120 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
121 'oldjis 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
122 "Coding-system used for old JIS terminal."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
123 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
124 short t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
125 seven t
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
126 output-charset-conversion ((ascii latin-jisx0201)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
127 (japanese-jisx0208 japanese-jisx0208-1978))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
128 mnemonic "Mail/Ja-old"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
129 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
130
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
131 (make-coding-system
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
132 'euc-japan 'iso2022
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
133 "Coding-system of Japanese EUC (Extended Unix Code)."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
134 '(charset-g0 ascii
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
135 charset-g1 japanese-jisx0208
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
136 charset-g2 katakana-jisx0201
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
137 charset-g3 japanese-jisx0212
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
138 short t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
139 mnemonic "EUC/Ja"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
140 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
141
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
142 (define-language-environment 'japanese
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
143 "Japanese (includes JIS and EUC)"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
144 (lambda ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
145 (set-coding-category-system 'iso-7 'iso-2022-jp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
146 (set-coding-category-system 'iso-8-2 'euc-japan)
74
54cc21c15cbb Import from CVS: tag r20-0b32
cvs
parents: 70
diff changeset
147 (set-coding-priority-list '(iso-7 iso-8-2 shift-jis no-conversion))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
148 ;;'(iso-8-2 iso-8-designate iso-8-1 shift-jis big5)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
149
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
150 ;; EGG specific setup 97.02.05 jhod
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
151 (when (featurep 'egg)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
152 (when (not (featurep 'egg-jpn))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
153 (provide 'egg-jpn)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
154 (setq wnn-server-type 'jserver)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
155 (load "its/its-hira")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
156 (load "its/its-kata")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
157 (load "its/its-hankaku")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
158 (load "its/its-zenkaku")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
159 (setq its:*standard-modes*
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
160 (append
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
161 (list (its:get-mode-map "roma-kana")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
162 (its:get-mode-map "roma-kata")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
163 (its:get-mode-map "downcase")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
164 (its:get-mode-map "upcase")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
165 (its:get-mode-map "zenkaku-downcase")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
166 (its:get-mode-map "zenkaku-upcase"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
167 its:*standard-modes*)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 74
diff changeset
168 (setq-default its:*current-map* (its:get-mode-map "roma-kana")))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
169
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
170 ;; Added by mrb, who doesn't speak japanese - so be sceptical...
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
171 ;; (when (string-match "solaris\\|sunos" system-configuration)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
172 ;;(set-native-coding-system 'euc-japan) ; someday
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
173 (set-pathname-coding-system 'euc-japan)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
174 (add-hook 'comint-exec-hook
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
175 (lambda ()
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
176 (let ((proc (get-buffer-process (current-buffer))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
177 (set-process-input-coding-system proc 'euc-japan)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
178 (set-process-output-coding-system proc 'euc-japan))))
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
179 (set-buffer-file-coding-system-for-read 'autodetect)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
180 (set-default-buffer-file-coding-system 'euc-japan)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
181 (setq keyboard-coding-system 'euc-japan)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
182 (setq terminal-coding-system 'euc-japan)
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 98
diff changeset
183 (when (eq 'x (device-type (selected-device)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 98
diff changeset
184 (x-use-halfwidth-roman-font 'japanese-jisx0208 "jisx0201"))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
185
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
186 (when (eq system-type 'ms-dos)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
187 ;; Shift-JIS is the standard coding system under Japanese MS-DOS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
188 ;; This isn't really code - just a hint to future implementors
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
189 (setq keyboard-coding-system 'shift-jis-dos)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
190 (setq terminal-coding-system 'shift-jis-dos)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
191 (set-default-buffer-file-coding-system 'shift-jis-dos)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
192 ;;(set-default-process-coding-system 'shift-jis-dos 'shift-jis-dos)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
193 )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
194 ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
195
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
196 (set-coding-category-system 'shift-jis 'shift-jis)
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
197
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
198 ;; stuff for providing gramatic processing of Japanese text
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
199 ;; something like this should probably be created for all environments...
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
200
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
201 (defvar aletter (concat "\\(" ascii-char "\\|" kanji-char "\\)"))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
202 (defvar kanji-space-insertable (concat
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
203 "$B!"(B" aletter "\\|"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
204 "$B!#(B" aletter "\\|"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
205 aletter "$B!J(B" "\\|"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
206 "$B!K(B" aletter "\\|"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
207 ascii-alphanumeric kanji-kanji-char "\\|"
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
208 kanji-kanji-char ascii-alphanumeric ))
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
209
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
210 (defvar space-insertable (concat " " aletter "\\|" kanji-space-insertable)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 102
diff changeset
211 "Regexp for finding points that can have spaces inserted into them for justification")