annotate lisp/mule/japanese.el @ 5600:80aed35416d7

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