comparison lisp/language/japanese.el @ 197:acd284d43ca1 r20-3b25

Import from CVS: tag r20-3b25
author cvs
date Mon, 13 Aug 2007 10:00:02 +0200
parents 3bb7ccffb0c0
children e45d5e7c476e
comparison
equal deleted inserted replaced
196:58e0786448ca 197:acd284d43ca1
1 ;;; japanese.el --- Japanese support 1 ;;; japanese.el --- Japanese support
2 2
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5 ;; Copyright (C) 1997 MORIOKA Tomohiko 5 ;; Copyright (C) 1997 MORIOKA Tomohiko
6 6
7 ;; Keywords: multilingual, Japanese 7 ;; Keywords: multilingual, Japanese
8 8
9 ;; This file is part of XEmacs. 9 ;; This file is part of XEmacs.
136 kanji-kanji-char ascii-alphanumeric )) 136 kanji-kanji-char ascii-alphanumeric ))
137 137
138 (defvar space-insertable (concat " " aletter "\\|" kanji-space-insertable) 138 (defvar space-insertable (concat " " aletter "\\|" kanji-space-insertable)
139 "Regexp for finding points that can have spaces inserted into them for justification") 139 "Regexp for finding points that can have spaces inserted into them for justification")
140 140
141 ;; (define-coding-system-alias 'iso-2022-7 'iso-2022-jp) 141 ;; (make-coding-system
142 ;; (define-coding-system-alias 'iso-2022-7 'junet) 142 ;; 'iso-2022-jp 2 ?J
143 ;; "ISO 2022 based 7bit encoding for Japanese (MIME:ISO-2022-JP)"
144 ;; '((ascii japanese-jisx0208-1978 japanese-jisx0208
145 ;; latin-jisx0201 japanese-jisx0212 katakana-jisx0201 t) nil nil nil
146 ;; short ascii-eol ascii-cntl seven))
147
148 ;; (define-coding-system-alias 'junet 'iso-2022-jp)
143 149
144 (make-coding-system 150 (make-coding-system
145 'iso-2022-jp 'iso2022 151 'iso-2022-jp 'iso2022
146 "Coding-system used for communication with mail and news in Japan." 152 "Coding-system used for communication with mail and news in Japan."
147 '(charset-g0 ascii 153 '(charset-g0 ascii
208 ;;(define-coding-system-alias 'euc-japan-1990 'euc-japan) 214 ;;(define-coding-system-alias 'euc-japan-1990 'euc-japan)
209 215
210 (copy-coding-system 'euc-jp 'euc-japan) ; only for w3 216 (copy-coding-system 'euc-jp 'euc-japan) ; only for w3
211 (copy-coding-system 'euc-jp 'japanese-euc) 217 (copy-coding-system 'euc-jp 'japanese-euc)
212 218
213 (register-input-method
214 "Japanese" '("quail-ja-hiragana" quail-use-package "quail/japanese"))
215 (register-input-method
216 "Japanese" '("quail-ja" quail-use-package "quail/japanese"))
217
218 (defun setup-japanese-environment ()
219 "Setup multilingual environment (MULE) for Japanese."
220 (interactive)
221 (setq coding-category-iso-8-2 'euc-jp)
222
223 (set-coding-priority
224 '(coding-category-iso-7
225 coding-category-iso-8-2
226 coding-category-sjis
227 coding-category-iso-8-1
228 coding-category-iso-else
229 coding-category-internal))
230
231 (if (eq system-type 'ms-dos)
232 (progn
233 (setq-default buffer-file-coding-system 'shift_jis)
234 (set-terminal-coding-system 'shift_jis)
235 (set-keyboard-coding-system 'shift_jis)
236 (setq default-process-coding-system '(shift_jis-dos . shift_jis-dos)))
237 (setq-default buffer-file-coding-system 'iso-2022-jp)
238 (set-terminal-coding-system 'iso-2022-jp)
239 (set-keyboard-coding-system 'iso-2022-jp))
240
241 (set-default-input-method "Japanese" "quail-ja")
242
243 (setq sendmail-coding-system 'iso-2022-jp
244 rmail-file-coding-system 'iso-2022-jp)
245 )
246
247 (defun describe-japanese-support ()
248 "Describe how Emacs supports Japanese."
249 (interactive)
250 (describe-language-support-internal "Japanese"))
251
252 (set-language-info-alist 219 (set-language-info-alist
253 "Japanese" '((setup-function . setup-japanese-environment) 220 "Japanese" '((setup-function . setup-japanese-environment)
254 (describe-function . describe-japanese-support)
255 (tutorial . "TUTORIAL.jp") 221 (tutorial . "TUTORIAL.jp")
256 (charset . (japanese-jisx0208 japanese-jisx0208-1978 222 (charset . (japanese-jisx0208 japanese-jisx0208-1978
257 japanese-jisx0212 latin-jisx0201 223 japanese-jisx0212 latin-jisx0201
258 katakana-jisx0201)) 224 katakana-jisx0201))
259 (coding-system . (euc-jp shift_jis 225 (coding-system . (iso-2022-jp euc-jp
260 iso-2022-jp iso-2022-jp-1978-irv)) 226 shift_jis iso-2022-jp-1978-irv))
261 (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B") 227 (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B")
262 (documentation . nil))) 228 (documentation . t)))
263 229
264 ;; for XEmacs (will be obsoleted) 230 ;; for XEmacs (will be obsoleted)
265 231
266 (define-language-environment 'japanese 232 (define-language-environment 'japanese
267 "Japanese (includes JIS and EUC)" 233 "Japanese (includes JIS and EUC)"