428
|
1 ;;; japanese.el --- Japanese support -*- coding: iso-2022-7bit; -*-
|
|
2
|
|
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
|
|
4 ;; Licensed to the Free Software Foundation.
|
|
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
|
771
|
6 ;; Copyright (C) 2000, 2002 Ben Wing.
|
428
|
7
|
|
8 ;; Keywords: multilingual, Japanese
|
|
9
|
|
10 ;; This file is part of XEmacs.
|
|
11
|
|
12 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
13 ;; under the terms of the GNU General Public License as published by
|
|
14 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
15 ;; any later version.
|
|
16
|
|
17 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20 ;; General Public License for more details.
|
|
21
|
|
22 ;; You should have received a copy of the GNU General Public License
|
|
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
25 ;; 02111-1307, USA.
|
|
26
|
771
|
27 ;;; Synched up with: Emacs 20.6 (international/japanese.el).
|
|
28
|
428
|
29 ;;; Commentary:
|
|
30
|
|
31 ;; For Japanese, character sets JISX0201, JISX0208, JISX0212 are
|
|
32 ;; supported.
|
|
33
|
|
34 ;;; Code:
|
|
35
|
778
|
36 (make-charset 'japanese-jisx0213-1 "JISX0213 Plane 1 (Japanese)"
|
|
37 '(dimension
|
|
38 2
|
3659
|
39 registries ["JISX0213.2000-1"]
|
778
|
40 chars 94
|
|
41 columns 2
|
|
42 direction l2r
|
|
43 final ?O
|
|
44 graphic 0
|
|
45 short-name "JISX0213-1"
|
|
46 long-name "JISX0213-1"
|
|
47 ))
|
|
48
|
|
49 ;; JISX0213 Plane 2
|
|
50 (make-charset 'japanese-jisx0213-2 "JISX0213 Plane 2 (Japanese)"
|
|
51 '(dimension
|
|
52 2
|
3659
|
53 registries ["JISX0213.2000-2"]
|
778
|
54 chars 94
|
|
55 columns 2
|
|
56 direction l2r
|
|
57 final ?P
|
|
58 graphic 0
|
|
59 short-name "JISX0213-2"
|
|
60 long-name "JISX0213-2"
|
|
61 ))
|
|
62
|
428
|
63 ;;; Syntax of Japanese characters.
|
|
64 (modify-syntax-entry 'katakana-jisx0201 "w")
|
|
65 (modify-syntax-entry 'japanese-jisx0212 "w")
|
|
66
|
|
67 (modify-syntax-entry 'japanese-jisx0208 "w")
|
|
68 (loop for row in '(33 34 40)
|
|
69 do (modify-syntax-entry `[japanese-jisx0208 ,row] "_"))
|
|
70 (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)
|
|
71 do (modify-syntax-entry char "w"))
|
|
72 (modify-syntax-entry ?\$B!J(B "($B!K(B")
|
|
73 (modify-syntax-entry ?\$B!N(B "($B!O(B")
|
|
74 (modify-syntax-entry ?\$B!P(B "($B!Q(B")
|
|
75 (modify-syntax-entry ?\$B!V(B "($B!W(B")
|
|
76 (modify-syntax-entry ?\$B!X(B "($B!Y(B")
|
|
77 (modify-syntax-entry ?\$B!K(B ")$B!J(B")
|
|
78 (modify-syntax-entry ?\$B!O(B ")$B!N(B")
|
|
79 (modify-syntax-entry ?\$B!Q(B ")$B!P(B")
|
|
80 (modify-syntax-entry ?\$B!W(B ")$B!V(B")
|
|
81 (modify-syntax-entry ?\$B!Y(B ")$B!X(B")
|
|
82
|
|
83 ;;; Character categories S, A, H, K, G, Y, and C
|
|
84 (define-category ?S "Japanese 2-byte symbol character.")
|
|
85 (modify-category-entry [japanese-jisx0208 33] ?S)
|
|
86 (modify-category-entry [japanese-jisx0208 34] ?S)
|
|
87 (modify-category-entry [japanese-jisx0208 40] ?S)
|
|
88 (define-category ?A "Japanese 2-byte Alphanumeric character.")
|
|
89 (modify-category-entry [japanese-jisx0208 35] ?A)
|
|
90 (define-category ?H "Japanese 2-byte Hiragana character.")
|
|
91 (modify-category-entry [japanese-jisx0208 36] ?H)
|
|
92 (define-category ?K "Japanese 2-byte Katakana character.")
|
|
93 (modify-category-entry [japanese-jisx0208 37] ?K)
|
|
94 (define-category ?G "Japanese 2-byte Greek character.")
|
|
95 (modify-category-entry [japanese-jisx0208 38] ?G)
|
|
96 (define-category ?Y "Japanese 2-byte Cyrillic character.")
|
|
97 (modify-category-entry [japanese-jisx0208 39] ?Y)
|
|
98 (define-category ?C "Japanese 2-byte Kanji characters.")
|
|
99 (loop for row from 48 to 126
|
|
100 do (modify-category-entry `[japanese-jisx0208 ,row] ?C))
|
|
101 (loop for char in '(?$B!<(B ?$B!+(B ?$B!,(B)
|
|
102 do (modify-category-entry char ?K)
|
|
103 (modify-category-entry char ?H))
|
|
104 (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)
|
|
105 do (modify-category-entry char ?C))
|
|
106 (modify-category-entry 'japanese-jisx0212 ?C)
|
|
107
|
|
108 (defvar japanese-word-regexp
|
|
109 "\\cA+\\cH*\\|\\cK+\\cH*\\|\\cC+\\cH*\\|\\cH+\\|\\ck+\\|\\sw+"
|
|
110 "Regular expression used to match a Japanese word.")
|
|
111
|
|
112 (set-word-regexp japanese-word-regexp)
|
|
113 (setq forward-word-regexp "\\w\\>")
|
|
114 (setq backward-word-regexp "\\<\\w")
|
|
115
|
|
116 ;;; Paragraph setting
|
|
117 (setq sentence-end
|
|
118 (concat
|
|
119 "\\("
|
|
120 "\\("
|
|
121 "[.?!][]\"')}]*"
|
|
122 "\\|"
|
|
123 "[$B!%!)!*(B][$B!O!I!G!K!Q!M!S!U!W!Y(B]*"
|
|
124 "\\)"
|
|
125 "\\($\\|\t\\| \\)"
|
|
126 "\\|"
|
|
127 "$B!#(B"
|
|
128 "\\)"
|
|
129 "[ \t\n]*"))
|
1891
|
130
|
|
131 ;; allow paragraphs to start with a zenkaku space
|
|
132 (setq paragraph-start "[ $B!!(B\t\n\f]")
|
|
133 (setq paragraph-separate "[ $B!!(B\t\f]*$")
|
428
|
134
|
|
135 ;; EGG specific setup
|
|
136 (define-egg-environment 'japanese
|
|
137 "Japanese settings for egg."
|
|
138 (lambda ()
|
771
|
139 (with-boundp '(its:*standard-modes* its:*current-map* wnn-server-type)
|
|
140 (with-fboundp 'its:get-mode-map
|
|
141 (when (not (featurep 'egg-jpn))
|
|
142 (load "its-hira")
|
|
143 (load "its-kata")
|
|
144 (load "its-hankaku")
|
|
145 (load "its-zenkaku")
|
|
146 (setq its:*standard-modes*
|
|
147 (append
|
|
148 (list (its:get-mode-map "roma-kana")
|
|
149 (its:get-mode-map "roma-kata")
|
|
150 (its:get-mode-map "downcase")
|
|
151 (its:get-mode-map "upcase")
|
|
152 (its:get-mode-map "zenkaku-downcase")
|
|
153 (its:get-mode-map "zenkaku-upcase"))
|
|
154 its:*standard-modes*))
|
|
155 (provide 'egg-jpn))
|
|
156 (setq wnn-server-type 'jserver)
|
|
157 ;; Can't do this here any more. Must do it when selecting egg-wnn
|
|
158 ;; or egg-sj3
|
|
159 ;; (setq egg-default-startup-file "eggrc-wnn")
|
|
160 (setq-default its:*current-map* (its:get-mode-map "roma-kana"))))))
|
428
|
161
|
450
|
162 ;; stuff for providing grammatic processing of Japanese text
|
428
|
163 ;; something like this should probably be created for all environments...
|
450
|
164 ;; #### Arrgh. This stuff should defvar'd in either fill.el or kinsoku.el.
|
|
165 ;; Then the language environment should set these things, probably buffer-
|
|
166 ;; locally.
|
428
|
167
|
771
|
168 ;; #### will be moved to fill.el
|
|
169 (defvar space-insertable
|
|
170 (let* ((aletter (concat "\\(" ascii-char "\\|" kanji-char "\\)"))
|
|
171 (kanji-space-insertable
|
|
172 (concat
|
428
|
173 "$B!"(B" aletter "\\|"
|
|
174 "$B!#(B" aletter "\\|"
|
|
175 aletter "$B!J(B" "\\|"
|
|
176 "$B!K(B" aletter "\\|"
|
|
177 ascii-alphanumeric kanji-kanji-char "\\|"
|
771
|
178 kanji-kanji-char ascii-alphanumeric)))
|
|
179 (concat " " aletter "\\|" kanji-space-insertable))
|
|
180 "Regexp for finding points that can have spaces inserted into them for justification")
|
428
|
181
|
771
|
182 ;; Beginning of FSF synching with international/japanese.el.
|
|
183
|
428
|
184 ;; (make-coding-system
|
|
185 ;; 'iso-2022-jp 2 ?J
|
|
186 ;; "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)"
|
|
187 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
|
|
188 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201) nil nil nil
|
|
189 ;; short ascii-eol ascii-cntl seven)
|
|
190 ;; '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208
|
|
191 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201)
|
|
192 ;; (mime-charset . iso-2022-jp)))
|
|
193
|
|
194 (make-coding-system
|
|
195 'iso-2022-jp 'iso2022
|
771
|
196 "ISO-2022-JP (Japanese mail)"
|
428
|
197 '(charset-g0 ascii
|
|
198 short t
|
|
199 seven t
|
|
200 input-charset-conversion ((latin-jisx0201 ascii)
|
|
201 (japanese-jisx0208-1978 japanese-jisx0208))
|
|
202 mnemonic "MULE/7bit"
|
771
|
203 documentation
|
|
204 "Coding system used for communication with mail and news in Japan."
|
|
205 ))
|
|
206
|
|
207 (make-coding-system
|
|
208 'jis7 'iso2022
|
|
209 "JIS7 (old Japanese 7-bit encoding)"
|
|
210 '(charset-g0 ascii
|
|
211 charset-g1 katakana-jisx0201
|
|
212 short t
|
|
213 seven t
|
|
214 lock-shift t
|
|
215 input-charset-conversion ((latin-jisx0201 ascii)
|
|
216 (japanese-jisx0208-1978 japanese-jisx0208))
|
|
217 mnemonic "JIS7"
|
|
218 documentation
|
|
219 "Old JIS 7-bit encoding; mostly superseded by ISO-2022-JP.
|
|
220 Uses locking-shift (SI/SO) to select half-width katakana."
|
|
221 ))
|
|
222
|
|
223 (make-coding-system
|
|
224 'jis8 'iso2022
|
|
225 "JIS8 (old Japanese 8-bit encoding)"
|
|
226 '(charset-g0 ascii
|
|
227 charset-g1 katakana-jisx0201
|
|
228 short t
|
|
229 input-charset-conversion ((latin-jisx0201 ascii)
|
|
230 (japanese-jisx0208-1978 japanese-jisx0208))
|
|
231 mnemonic "JIS8"
|
|
232 documentation
|
|
233 "Old JIS 8-bit encoding; mostly superseded by ISO-2022-JP.
|
|
234 Uses high bytes for half-width katakana."
|
428
|
235 ))
|
|
236
|
|
237 (define-coding-system-alias 'junet 'iso-2022-jp)
|
|
238
|
|
239 ;; (make-coding-system
|
|
240 ;; 'iso-2022-jp-2 2 ?J
|
|
241 ;; "ISO 2022 based 7bit encoding for CJK, Latin-1, and Greek (MIME:ISO-2022-JP-2)"
|
|
242 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
|
|
243 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201
|
|
244 ;; chinese-gb2312 korean-ksc5601) nil
|
|
245 ;; (nil latin-iso8859-1 greek-iso8859-7) nil
|
|
246 ;; short ascii-eol ascii-cntl seven nil single-shift)
|
|
247 ;; '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208
|
|
248 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201
|
|
249 ;; chinese-gb2312 korean-ksc5601
|
|
250 ;; latin-iso8859-1 greek-iso8859-7)
|
|
251 ;; (mime-charset . iso-2022-jp-2)))
|
|
252
|
|
253 ;; (make-coding-system
|
|
254 ;; 'japanese-shift-jis 1 ?S
|
|
255 ;; "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)"
|
|
256 ;; nil
|
|
257 ;; '((safe-charsets ascii japanese-jisx0208 japanese-jisx0208-1978
|
|
258 ;; latin-jisx0201 katakana-jisx0201)
|
771
|
259 ;; (mime-charset . shift-jis)
|
428
|
260 ;; (charset-origin-alist (japanese-jisx0208 "SJIS" encode-sjis-char)
|
|
261 ;; (katakana-jisx0201 "SJIS" encode-sjis-char))))
|
|
262
|
|
263 (make-coding-system
|
771
|
264 'shift-jis 'shift-jis
|
|
265 "Shift-JIS"
|
|
266 '(mnemonic "Ja/SJIS"
|
|
267 documentation "The standard Japanese encoding in MS Windows."
|
|
268 ))
|
428
|
269
|
771
|
270 ;; A former name?
|
|
271 (define-coding-system-alias 'shift_jis 'shift-jis)
|
|
272
|
|
273 ;; FSF:
|
|
274 ;; (define-coding-system-alias 'shift-jis 'japanese-shift-jis)
|
428
|
275 ;; (define-coding-system-alias 'sjis 'japanese-shift-jis)
|
|
276
|
|
277 ;; (make-coding-system
|
|
278 ;; 'japanese-iso-7bit-1978-irv 2 ?j
|
|
279 ;; "ISO 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman"
|
|
280 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
|
|
281 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201 t) nil nil nil
|
|
282 ;; short ascii-eol ascii-cntl seven nil nil use-roman use-oldjis)
|
|
283 ;; '(ascii japanese-jisx0208-1978 japanese-jisx0208 latin-jisx0201))
|
|
284
|
|
285 (make-coding-system
|
|
286 'iso-2022-jp-1978-irv 'iso2022
|
771
|
287 "ISO-2022-JP-1978-IRV (Old JIS)"
|
428
|
288 '(charset-g0 ascii
|
|
289 short t
|
|
290 seven t
|
|
291 output-charset-conversion ((ascii latin-jisx0201)
|
|
292 (japanese-jisx0208 japanese-jisx0208-1978))
|
771
|
293 documentation
|
|
294 "This is a coding system used for old JIS terminals. It's an ISO
|
|
295 2022 based 7-bit encoding for Japanese JISX0208-1978 and JISX0201-Roman."
|
428
|
296 mnemonic "Ja-78/7bit"
|
|
297 ))
|
|
298
|
771
|
299 ;; FSF:
|
428
|
300 ;; (define-coding-system-alias 'iso-2022-jp-1978-irv 'japanese-iso-7bit-1978-irv)
|
|
301 ;; (define-coding-system-alias 'old-jis 'japanese-iso-7bit-1978-irv)
|
|
302
|
|
303 (define-coding-system-alias 'old-jis 'iso-2022-jp-1978-irv)
|
|
304
|
|
305 ;; (make-coding-system
|
|
306 ;; 'japanese-iso-8bit 2 ?E
|
|
307 ;; "ISO 2022 based EUC encoding for Japanese (MIME:EUC-JP)"
|
|
308 ;; '(ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212
|
|
309 ;; short ascii-eol ascii-cntl nil nil single-shift)
|
|
310 ;; '((safe-charsets ascii latin-jisx0201 japanese-jisx0208 japanese-jisx0208-1978
|
771
|
311 ;; katakana-jisx0201 japanese-jisx0212)
|
428
|
312 ;; (mime-charset . euc-jp)))
|
771
|
313 ;;
|
428
|
314 (make-coding-system
|
|
315 'euc-jp 'iso2022
|
771
|
316 "Japanese EUC"
|
428
|
317 '(charset-g0 ascii
|
|
318 charset-g1 japanese-jisx0208
|
|
319 charset-g2 katakana-jisx0201
|
|
320 charset-g3 japanese-jisx0212
|
|
321 short t
|
|
322 mnemonic "Ja/EUC"
|
771
|
323 documentation
|
|
324 "Japanese EUC (Extended Unix Code), the standard Japanese encoding in Unix.
|
|
325 Equivalent MIME encoding: EUC-JP.
|
|
326
|
|
327 Japanese EUC was the forefather of all the different EUC's, which all follow
|
|
328 a similar structure:
|
|
329
|
|
330 1. Up to four character sets can be encoded.
|
|
331
|
|
332 2. This is a non-modal encoding, i.e. it is impossible to set a global state
|
|
333 that affects anything more than the directly following character. [Modal
|
|
334 encodings typically have escape sequences to change global settings, which
|
|
335 affect all the following characters until the setting is turned off.
|
|
336 Modal encodings are typically used when it's necessary to support text in
|
|
337 a wide variety of character sets and still keep basic ASCII compatibility,
|
|
338 or in cases (e.g. sending email) where the allowed characters that can
|
|
339 pass the gateway are small and (typically) no high-bit range is available.
|
|
340
|
|
341 3. The first character set is always ASCII or some national variant of it,
|
|
342 and encoded in the standard ASCII position. All characters in all other
|
|
343 character sets are encoded entirely using high-half bytes. Therefore,
|
|
344 it is safe to scan for ASCII characters, such as '/' to separate path
|
|
345 components, in the obvious way.
|
|
346
|
|
347 4. Each of the other three character sets can be of dimension 1, 2, or 3.
|
|
348 A dimension-1 character set contains 96 bytes; a dimension-2 character
|
|
349 set contains 96 x 96 bytes; and a dimension-3 character set contains
|
|
350 96 x 96 x 96 bytes. 94 instead of 96 as the number of characters per
|
|
351 dimension is also supported. Character sets of dimensions 1, 2, and 3
|
|
352 use 1-3 bytes, respectively, to encode a character, and each byte is
|
|
353 in the range A0-FF (or A1-FE for those with 94 bytes per dimension).
|
|
354
|
|
355 5. The four character sets encoded in EUC are called G0, G1, G2, and G3.
|
|
356 As mentioned earlier, G0 is ASCII or some variant, and encoded into
|
|
357 the ASCII positions 00 - 7F. G1 is encoded directly by laying out
|
|
358 its bytes. G2 is encoded using an 8E byte followed by the character's
|
|
359 bytes. G3 is encoded using an 8F byte followed by the character's bytes."
|
|
360
|
428
|
361 ))
|
|
362
|
771
|
363 ;; FSF:
|
428
|
364 ;; (define-coding-system-alias 'euc-japan-1990 'japanese-iso-8bit)
|
|
365 ;; (define-coding-system-alias 'euc-japan 'japanese-iso-8bit)
|
|
366 ;; (define-coding-system-alias 'euc-jp 'japanese-iso-8bit)
|
|
367
|
|
368 (define-coding-system-alias 'euc-japan 'euc-jp) ; only for w3
|
|
369 (define-coding-system-alias 'japanese-euc 'euc-jp)
|
|
370
|
|
371 (set-language-info-alist
|
|
372 "Japanese" '((setup-function . setup-japanese-environment-internal)
|
|
373 (exit-function . exit-japanese-environment)
|
|
374 (tutorial . "TUTORIAL.ja")
|
|
375 (charset japanese-jisx0208 japanese-jisx0208-1978
|
|
376 japanese-jisx0212 latin-jisx0201 katakana-jisx0201)
|
|
377 (coding-system iso-2022-jp euc-jp
|
771
|
378 shift-jis iso-2022-jp-2)
|
428
|
379 (coding-priority iso-2022-jp euc-jp
|
771
|
380 shift-jis iso-2022-jp-2)
|
|
381 ;; These locale names come from the X11R6 locale.alias file.
|
|
382 ;; What an incredible fucking mess!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
383 ;; What's worse is that typical Unix implementations of
|
|
384 ;; setlocale() return back exactly what you passed them, even
|
|
385 ;; though it's perfectly allowed (and in fact done under
|
|
386 ;; Windows) to expand the locale to its full form (including
|
|
387 ;; encoding), so you have some hint as to the encoding!!!
|
|
388 ;;
|
|
389 ;; We order them in such a way that we're maximally likely
|
|
390 ;; to get an encoding name.
|
|
391 ;;
|
|
392 (locale
|
|
393 ;; SunOS 5.7: ja ja_JP.PCK ja_JP.UTF-8 japanese
|
|
394 ;; RedHat Linux 6.2J: ja ja_JP ja_JP.eucJP ja_JP.ujis \
|
|
395 ;; japanese japanese.euc
|
|
396 ;; HP-UX 10.20: ja_JP.SJIS ja_JP.eucJPput ja_JP.kana8
|
|
397 ;; Cygwin b20.1: ja_JP.EUC
|
|
398 ;; FreeBSD 2.2.8: ja_JP.EUC ja_JP.SJIS
|
|
399
|
|
400 ;; EUC locales
|
|
401 "ja_JP.EUC"
|
|
402 "ja_JP.eucJP"
|
|
403 "ja_JP.AJEC"
|
|
404 "ja_JP.ujis"
|
|
405 "Japanese-EUC"
|
|
406 "japanese.euc"
|
|
407
|
|
408 ;; Shift-JIS locales
|
|
409 "ja_JP.SJIS"
|
|
410 "ja_JP.mscode"
|
|
411 "ja.SJIS"
|
|
412
|
|
413 ;; 7-bit locales
|
|
414 "ja_JP.ISO-2022-JP"
|
|
415 "ja_JP.jis7"
|
|
416 "ja_JP.pjis"
|
|
417 "ja_JP.JIS"
|
|
418 "ja.JIS"
|
|
419
|
|
420 ;; 8-bit locales
|
|
421 "ja_JP.jis8"
|
|
422
|
|
423 ;; encoding-unspecified locales
|
|
424 "ja_JP"
|
|
425 "Ja_JP"
|
|
426 "Jp_JP"
|
|
427 "japanese"
|
|
428 "japan"
|
|
429 "ja"
|
|
430 )
|
|
431
|
|
432 (native-coding-system
|
|
433 ;; first, see if an explicit encoding was given.
|
810
|
434 (lambda (locale)
|
771
|
435 (let ((case-fold-search t))
|
|
436 (cond
|
|
437 ;; many unix versions
|
|
438 ((string-match "\\.euc" locale) 'euc-jp)
|
|
439 ((string-match "\\.sjis" locale) 'shift-jis)
|
|
440
|
|
441 ;; X11R6 (CJKV p. 471)
|
|
442 ((string-match "\\.jis7" locale) 'jis7)
|
|
443 ((string-match "\\.jis8" locale) 'jis8)
|
|
444 ((string-match "\\.mscode" locale) 'shift-jis)
|
|
445 ((string-match "\\.pjis" locale) 'iso-2022-jp)
|
|
446 ((string-match "\\.ujis" locale) 'euc-jp)
|
|
447
|
|
448 ;; other names in X11R6 locale.alias
|
|
449 ((string-match "\\.ajec" locale) 'euc-jp)
|
|
450 ((string-match "-euc" locale) 'euc-jp)
|
|
451 ((string-match "\\.iso-2022-jp" locale) 'iso-2022-jp)
|
|
452 ((string-match "\\.jis" locale) 'jis7) ;; or just jis?
|
|
453 )))
|
|
454
|
|
455 ;; aix (CJKV p. 465)
|
810
|
456 (lambda (locale)
|
771
|
457 (when (eq system-type 'aix)
|
|
458 (cond
|
|
459 ((string-match "^Ja_JP" locale) 'shift-jis)
|
|
460 ((string-match "^ja_JP" locale) 'euc-jp))))
|
|
461
|
|
462 ;; other X11R6 locale.alias
|
810
|
463 (lambda (locale)
|
771
|
464 (cond
|
|
465 ((string-match "^Jp_JP" locale) 'euc-jp)
|
|
466 ((and (eq system-type 'hpux) (eq locale "japanese"))
|
|
467 'shift-jis)))
|
|
468
|
|
469 ;; fallback
|
810
|
470 euc-jp)
|
771
|
471
|
428
|
472 ;; (input-method . "japanese")
|
|
473 (features japan-util)
|
450
|
474 (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B")
|
428
|
475 (documentation . t)))
|
|
476
|
|
477 ;;; japanese.el ends here
|