annotate lisp/mule/japanese.el @ 5361:62b9ef1ed4ac

Change "special form" to "special operator" in the manuals, too 2011-03-01 Aidan Kehoe <kehoea@parhasard.net> * lispref/commands.texi (Using Interactive): * lispref/compile.texi (Eval During Compile): * lispref/compile.texi (Compiled-Function Objects): * lispref/control.texi (Sequencing): * lispref/control.texi (Conditionals): * lispref/control.texi (Combining Conditions): * lispref/control.texi (Iteration): * lispref/control.texi (Catch and Throw): * lispref/control.texi (Handling Errors): * lispref/control.texi (Cleanups): * lispref/display.texi (Temporary Displays): * lispref/eval.texi (Quoting): * lispref/eval.texi (Multiple values): * lispref/frames.texi (Input Focus): * lispref/functions.texi (Argument List): * lispref/functions.texi (Defining Functions): * lispref/functions.texi (Anonymous Functions): * lispref/internationalization.texi (Level 3 Primitives): * lispref/internationalization.texi (Domain Specification): * lispref/intro.texi (A Sample Function Description): * lispref/intro.texi (A Sample Variable Description): * lispref/lists.texi (Sets And Lists): * lispref/macros.texi (Defining Macros): * lispref/macros.texi (Backquote): * lispref/positions.texi (Excursions): * lispref/positions.texi (Narrowing): * lispref/searching.texi (Saving Match Data): * lispref/sequences.texi (Sequence Functions): * lispref/sequences.texi (Array Functions): * lispref/specifiers.texi (Adding Specifications): * lispref/variables.texi (Local Variables): * lispref/variables.texi (Defining Variables): * lispref/variables.texi (Setting Variables): * lispref/variables.texi (Default Value): * lispref/windows.texi (Selecting Windows): * lispref/windows.texi (Window Configurations): No longer use @defspec, since we no longer use the term "special form"; instead use @deffn {Special Operator}. Unfortunately there's no way in texinfo to redefine @defspec in one place.
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 01 Mar 2011 14:18:45 +0000
parents 1d74a1d115ee
children 311f6817efc2 308d34e9f07d
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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; General Public License for more details.
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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
27 ;;; 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
28
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 ;; For Japanese, character sets JISX0201, JISX0208, JISX0212 are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 ;; supported.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 ;;; Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
778
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
36 (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
37 '(dimension
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
38 2
3659
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 1891
diff changeset
39 registries ["JISX0213.2000-1"]
778
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
40 chars 94
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
41 columns 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
42 direction l2r
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
43 final ?O
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
44 graphic 0
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
45 short-name "JISX0213-1"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
46 long-name "JISX0213-1"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
47 ))
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
48
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
49 ;; JISX0213 Plane 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
50 (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
51 '(dimension
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
52 2
3659
98af8a976fc3 [xemacs-hg @ 2006-11-05 22:31:31 by aidan]
aidan
parents: 1891
diff changeset
53 registries ["JISX0213.2000-2"]
778
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
54 chars 94
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
55 columns 2
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
56 direction l2r
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
57 final ?P
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
58 graphic 0
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
59 short-name "JISX0213-2"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
60 long-name "JISX0213-2"
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
61 ))
2923009caf47 [xemacs-hg @ 2002-03-16 10:38:59 by ben]
ben
parents: 771
diff changeset
62
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 ;;; Syntax of Japanese characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 (loop for row in '(33 34 40)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 do (modify-syntax-entry `[japanese-jisx0208 ,row] "_"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 (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
67 do (modify-syntax-entry char "w"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 (modify-syntax-entry ?\$B!J(B "($B!K(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 (modify-syntax-entry ?\$B!N(B "($B!O(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 (modify-syntax-entry ?\$B!P(B "($B!Q(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 (modify-syntax-entry ?\$B!V(B "($B!W(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 (modify-syntax-entry ?\$B!X(B "($B!Y(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 (modify-syntax-entry ?\$B!K(B ")$B!J(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 (modify-syntax-entry ?\$B!O(B ")$B!N(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 (modify-syntax-entry ?\$B!Q(B ")$B!P(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 (modify-syntax-entry ?\$B!W(B ")$B!V(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 (modify-syntax-entry ?\$B!Y(B ")$B!X(B")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 ;;; Character categories S, A, H, K, G, Y, and C
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 (define-category ?S "Japanese 2-byte symbol character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 (modify-category-entry [japanese-jisx0208 33] ?S)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 (modify-category-entry [japanese-jisx0208 34] ?S)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 (modify-category-entry [japanese-jisx0208 40] ?S)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 (define-category ?A "Japanese 2-byte Alphanumeric character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 (modify-category-entry [japanese-jisx0208 35] ?A)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 (define-category ?H "Japanese 2-byte Hiragana character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 (modify-category-entry [japanese-jisx0208 36] ?H)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 (define-category ?K "Japanese 2-byte Katakana character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 (modify-category-entry [japanese-jisx0208 37] ?K)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 (define-category ?G "Japanese 2-byte Greek character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 (modify-category-entry [japanese-jisx0208 38] ?G)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 (define-category ?Y "Japanese 2-byte Cyrillic character.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 (modify-category-entry [japanese-jisx0208 39] ?Y)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 (define-category ?C "Japanese 2-byte Kanji characters.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 (loop for row from 48 to 126
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 do (modify-category-entry `[japanese-jisx0208 ,row] ?C))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 (loop for char in '(?$B!<(B ?$B!+(B ?$B!,(B)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 do (modify-category-entry char ?K)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 (modify-category-entry char ?H))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 (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
101 do (modify-category-entry char ?C))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 (modify-category-entry 'japanese-jisx0212 ?C)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 (defvar japanese-word-regexp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 "\\cA+\\cH*\\|\\cK+\\cH*\\|\\cC+\\cH*\\|\\cH+\\|\\ck+\\|\\sw+"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 "Regular expression used to match a Japanese word.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 (set-word-regexp japanese-word-regexp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 (setq forward-word-regexp "\\w\\>")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 (setq backward-word-regexp "\\<\\w")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 ;;; Paragraph setting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 (setq sentence-end
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 (concat
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 "[.?!][]\"')}]*"
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 "[$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
120 "\\)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 "\\($\\|\t\\| \\)"
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 "$B!#(B"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 "\\)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 "[ \t\n]*"))
1891
402bf23dd28f [xemacs-hg @ 2004-01-29 05:22:37 by stephent]
stephent
parents: 810
diff changeset
126
402bf23dd28f [xemacs-hg @ 2004-01-29 05:22:37 by stephent]
stephent
parents: 810
diff changeset
127 ;; allow paragraphs to start with a zenkaku space
402bf23dd28f [xemacs-hg @ 2004-01-29 05:22:37 by stephent]
stephent
parents: 810
diff changeset
128 (setq paragraph-start "[ $B!!(B\t\n\f]")
402bf23dd28f [xemacs-hg @ 2004-01-29 05:22:37 by stephent]
stephent
parents: 810
diff changeset
129 (setq paragraph-separate "[ $B!!(B\t\f]*$")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 ;; EGG specific setup
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 (define-egg-environment 'japanese
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 "Japanese settings for egg."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 (lambda ()
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
135 (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
136 (with-fboundp 'its:get-mode-map
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
137 (when (not (featurep 'egg-jpn))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
138 (load "its-hira")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
139 (load "its-kata")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
140 (load "its-hankaku")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
141 (load "its-zenkaku")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
142 (setq its:*standard-modes*
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
143 (append
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
144 (list (its:get-mode-map "roma-kana")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
145 (its:get-mode-map "roma-kata")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
146 (its:get-mode-map "downcase")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
147 (its:get-mode-map "upcase")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
148 (its:get-mode-map "zenkaku-downcase")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
149 (its:get-mode-map "zenkaku-upcase"))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
150 its:*standard-modes*))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
151 (provide 'egg-jpn))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
152 (setq wnn-server-type 'jserver)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
153 ;; 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
154 ;; or egg-sj3
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
155 ;; (setq egg-default-startup-file "eggrc-wnn")
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
156 (setq-default its:*current-map* (its:get-mode-map "roma-kana"))))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157
450
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 428
diff changeset
158 ;; stuff for providing grammatic processing of Japanese text
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 ;; something like this should probably be created for all environments...
450
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 428
diff changeset
160 ;; #### 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
161 ;; Then the language environment should set these things, probably buffer-
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 428
diff changeset
162 ;; locally.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
164 ;; #### will be moved to fill.el
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
165 (defvar space-insertable
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
166 (let* ((aletter (concat "\\(" ascii-char "\\|" kanji-char "\\)"))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
167 (kanji-space-insertable
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
168 (concat
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 "$B!"(B" aletter "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 "$B!#(B" aletter "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 aletter "$B!J(B" "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 "$B!K(B" aletter "\\|"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 ascii-alphanumeric kanji-kanji-char "\\|"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
174 kanji-kanji-char ascii-alphanumeric)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
175 (concat " " aletter "\\|" kanji-space-insertable))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
176 "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
177
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
178 ;; Beginning of FSF synching with international/japanese.el.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
179
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 ;; 'iso-2022-jp 2 ?J
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 ;; "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201) nil nil nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 ;; short ascii-eol ascii-cntl seven)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 ;; '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 ;; (mime-charset . iso-2022-jp)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 'iso-2022-jp 'iso2022
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
192 "ISO-2022-JP (Japanese mail)"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 '(charset-g0 ascii
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 short t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 seven t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 input-charset-conversion ((latin-jisx0201 ascii)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 (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
198 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
199 latin-jisx0201 japanese-jisx0212 katakana-jisx0201)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 mnemonic "MULE/7bit"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
201 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
202 "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
203 ))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
204
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
205 (make-coding-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
206 'jis7 'iso2022
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
207 "JIS7 (old Japanese 7-bit encoding)"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
208 '(charset-g0 ascii
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
209 charset-g1 katakana-jisx0201
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
210 short t
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
211 seven t
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
212 lock-shift t
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
213 input-charset-conversion ((latin-jisx0201 ascii)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
214 (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
215 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
216 mnemonic "JIS7"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
217 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
218 "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
219 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
220 ))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
221
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
222 (make-coding-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
223 'jis8 'iso2022
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
224 "JIS8 (old Japanese 8-bit encoding)"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
225 '(charset-g0 ascii
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
226 charset-g1 katakana-jisx0201
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
227 short t
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
228 input-charset-conversion ((latin-jisx0201 ascii)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
229 (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
230 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
231 japanese-jisx0208)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
232 mnemonic "JIS8"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
233 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
234 "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
235 Uses high bytes for half-width katakana."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 ))
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 (define-coding-system-alias 'junet 'iso-2022-jp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 ;; 'iso-2022-jp-2 2 ?J
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 ;; "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
243 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 ;; chinese-gb2312 korean-ksc5601) nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 ;; (nil latin-iso8859-1 greek-iso8859-7) nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 ;; short ascii-eol ascii-cntl seven nil single-shift)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 ;; '((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 ;; chinese-gb2312 korean-ksc5601
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 ;; latin-iso8859-1 greek-iso8859-7)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 ;; (mime-charset . iso-2022-jp-2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 ;; 'japanese-shift-jis 1 ?S
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 ;; "Shift-JIS 8-bit encoding for Japanese (MIME:SHIFT_JIS)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 ;; nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 ;; '((safe-charsets ascii japanese-jisx0208 japanese-jisx0208-1978
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 ;; latin-jisx0201 katakana-jisx0201)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
260 ;; (mime-charset . shift-jis)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 ;; (charset-origin-alist (japanese-jisx0208 "SJIS" encode-sjis-char)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 ;; (katakana-jisx0201 "SJIS" encode-sjis-char))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 (make-coding-system
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
265 'shift-jis 'shift-jis
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
266 "Shift-JIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
267 '(mnemonic "Ja/SJIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
268 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
269 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
270 latin-jisx0201 katakana-jisx0201)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
271 ))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
273 ;; A former name?
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
274 (define-coding-system-alias 'shift_jis 'shift-jis)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
275
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
276 ;; FSF:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
277 ;; (define-coding-system-alias 'shift-jis 'japanese-shift-jis)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 ;; (define-coding-system-alias 'sjis 'japanese-shift-jis)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 ;; 'japanese-iso-7bit-1978-irv 2 ?j
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 ;; "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
283 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201 t) nil nil nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 ;; short ascii-eol ascii-cntl seven nil nil use-roman use-oldjis)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 ;; '(ascii japanese-jisx0208-1978 japanese-jisx0208 latin-jisx0201))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 'iso-2022-jp-1978-irv 'iso2022
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
290 "ISO-2022-JP-1978-IRV (Old JIS)"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 '(charset-g0 ascii
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 short t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 seven t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 output-charset-conversion ((ascii latin-jisx0201)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 (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
296 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
297 japanese-jisx0208-1978)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
298 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
299 "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
300 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
301 mnemonic "Ja-78/7bit"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
304 ;; FSF:
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 ;; (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
306 ;; (define-coding-system-alias 'old-jis 'japanese-iso-7bit-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 (define-coding-system-alias 'old-jis 'iso-2022-jp-1978-irv)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 ;; (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 ;; 'japanese-iso-8bit 2 ?E
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 ;; "ISO 2022 based EUC encoding for Japanese (MIME:EUC-JP)"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 ;; '(ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 ;; short ascii-eol ascii-cntl nil nil single-shift)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 ;; '((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
316 ;; katakana-jisx0201 japanese-jisx0212)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 ;; (mime-charset . euc-jp)))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
318 ;;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 (make-coding-system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 'euc-jp 'iso2022
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
321 "Japanese EUC"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 '(charset-g0 ascii
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 charset-g1 japanese-jisx0208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 charset-g2 katakana-jisx0201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 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
326 safe-charsets (ascii japanese-jisx0208 katakana-jisx0201 japanese-jisx0212)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 short t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 mnemonic "Ja/EUC"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
329 documentation
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
330 "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
331 Equivalent MIME encoding: EUC-JP.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
332
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
333 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
334 a similar structure:
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 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
337
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
338 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
339 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
340 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
341 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
342 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
343 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
344 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
345 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
346
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
347 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
348 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
349 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
350 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
351 components, in the obvious way.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
352
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
353 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
354 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
355 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
356 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
357 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
358 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
359 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
360
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
361 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
362 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
363 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
364 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
365 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
366
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 ))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
369 ;; FSF:
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 ;; (define-coding-system-alias 'euc-japan-1990 'japanese-iso-8bit)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 ;; (define-coding-system-alias 'euc-japan 'japanese-iso-8bit)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 ;; (define-coding-system-alias 'euc-jp 'japanese-iso-8bit)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 (define-coding-system-alias 'euc-japan 'euc-jp) ; only for w3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 (define-coding-system-alias 'japanese-euc 'euc-jp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 (set-language-info-alist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 "Japanese" '((setup-function . setup-japanese-environment-internal)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 (exit-function . exit-japanese-environment)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 (tutorial . "TUTORIAL.ja")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 (charset japanese-jisx0208 japanese-jisx0208-1978
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 japanese-jisx0212 latin-jisx0201 katakana-jisx0201)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 (coding-system 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)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 (coding-priority iso-2022-jp euc-jp
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
386 shift-jis iso-2022-jp-2)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
387 ;; 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
388 ;; What an incredible fucking mess!!!!!!!!!!!!!!!!!!!!!!!!!!
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
389 ;; 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
390 ;; 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
391 ;; 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
392 ;; 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
393 ;; 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
394 ;;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
395 ;; 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
396 ;; to get an encoding name.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
397 ;;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
398 (locale
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
399 ;; 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
400 ;; 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
401 ;; japanese japanese.euc
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
402 ;; 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
403 ;; Cygwin b20.1: ja_JP.EUC
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
404 ;; 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
405
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
406 ;; EUC locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
407 "ja_JP.EUC"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
408 "ja_JP.eucJP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
409 "ja_JP.AJEC"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
410 "ja_JP.ujis"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
411 "Japanese-EUC"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
412 "japanese.euc"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
413
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
414 ;; Shift-JIS locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
415 "ja_JP.SJIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
416 "ja_JP.mscode"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
417 "ja.SJIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
418
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
419 ;; 7-bit locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
420 "ja_JP.ISO-2022-JP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
421 "ja_JP.jis7"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
422 "ja_JP.pjis"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
423 "ja_JP.JIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
424 "ja.JIS"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
425
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
426 ;; 8-bit locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
427 "ja_JP.jis8"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
428
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
429 ;; encoding-unspecified locales
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
430 "ja_JP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
431 "Ja_JP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
432 "Jp_JP"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
433 "japanese"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
434 "japan"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
435 "ja"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 450
diff changeset
436 )
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 ;; (input-method . "japanese")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 (features japan-util)
450
98528da0b7fc Import from CVS: tag r21-2-40
cvs
parents: 428
diff changeset
439 (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
440 (documentation . t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441
4145
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
442 ;; 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
443 ;; 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
444 ;; little helps there.)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
445 (set-language-info "Japanese"
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
446 'native-coding-system
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
447 (list
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
448 ;; first, see if an explicit encoding was given.
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
449 (lambda (locale)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
450 (let ((case-fold-search t))
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
451 (cond
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
452 ;; many unix versions
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
453 ((string-match "\\.euc" locale) 'euc-jp)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
454 ((string-match "\\.sjis" locale) 'shift-jis)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
455
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
456 ;; X11R6 (CJKV p. 471)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
457 ((string-match "\\.jis7" locale) 'jis7)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
458 ((string-match "\\.jis8" locale) 'jis8)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
459 ((string-match "\\.mscode" locale) 'shift-jis)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
460 ((string-match "\\.pjis" locale) 'iso-2022-jp)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
461 ((string-match "\\.ujis" locale) 'euc-jp)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
462
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
463 ;; other names in X11R6 locale.alias
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
464 ((string-match "\\.ajec" locale) 'euc-jp)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
465 ((string-match "-euc" locale) 'euc-jp)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
466 ((string-match "\\.iso-2022-jp" locale) 'iso-2022-jp)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
467 ((string-match "\\.jis" locale) 'jis7) ;; or just jis?
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
468 )))
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
469
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
470 ;; aix (CJKV p. 465)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
471 (lambda (locale)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
472 (when (eq system-type 'aix)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
473 (cond
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
474 ((string-match "^Ja_JP" locale) 'shift-jis)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
475 ((string-match "^ja_JP" locale) 'euc-jp))))
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
476
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
477 ;; other X11R6 locale.alias
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
478 (lambda (locale)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
479 (cond
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
480 ((string-match "^Jp_JP" locale) 'euc-jp)
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
481 ((and (eq system-type 'hpux) (eq locale "japanese"))
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
482 'shift-jis)))
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
483
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
484 ;; fallback
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
485 'euc-jp))
edb00a8b4eff [xemacs-hg @ 2007-08-26 20:00:29 by aidan]
aidan
parents: 4072
diff changeset
486
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 ;;; japanese.el ends here