Mercurial > hg > xemacs-beta
comparison lisp/mule/japanese.el @ 4145:edb00a8b4eff
[xemacs-hg @ 2007-08-26 20:00:29 by aidan]
Generally make the language environments and coding systems a little more sane.
author | aidan |
---|---|
date | Sun, 26 Aug 2007 20:00:42 +0000 |
parents | aa28d959af41 |
children | 1d74a1d115ee |
comparison
equal
deleted
inserted
replaced
4144:4a08a9219456 | 4145:edb00a8b4eff |
---|---|
422 "Jp_JP" | 422 "Jp_JP" |
423 "japanese" | 423 "japanese" |
424 "japan" | 424 "japan" |
425 "ja" | 425 "ja" |
426 ) | 426 ) |
427 | |
428 (native-coding-system | |
429 ;; first, see if an explicit encoding was given. | |
430 (lambda (locale) | |
431 (let ((case-fold-search t)) | |
432 (cond | |
433 ;; many unix versions | |
434 ((string-match "\\.euc" locale) 'euc-jp) | |
435 ((string-match "\\.sjis" locale) 'shift-jis) | |
436 | |
437 ;; X11R6 (CJKV p. 471) | |
438 ((string-match "\\.jis7" locale) 'jis7) | |
439 ((string-match "\\.jis8" locale) 'jis8) | |
440 ((string-match "\\.mscode" locale) 'shift-jis) | |
441 ((string-match "\\.pjis" locale) 'iso-2022-jp) | |
442 ((string-match "\\.ujis" locale) 'euc-jp) | |
443 | |
444 ;; other names in X11R6 locale.alias | |
445 ((string-match "\\.ajec" locale) 'euc-jp) | |
446 ((string-match "-euc" locale) 'euc-jp) | |
447 ((string-match "\\.iso-2022-jp" locale) 'iso-2022-jp) | |
448 ((string-match "\\.jis" locale) 'jis7) ;; or just jis? | |
449 ))) | |
450 | |
451 ;; aix (CJKV p. 465) | |
452 (lambda (locale) | |
453 (when (eq system-type 'aix) | |
454 (cond | |
455 ((string-match "^Ja_JP" locale) 'shift-jis) | |
456 ((string-match "^ja_JP" locale) 'euc-jp)))) | |
457 | |
458 ;; other X11R6 locale.alias | |
459 (lambda (locale) | |
460 (cond | |
461 ((string-match "^Jp_JP" locale) 'euc-jp) | |
462 ((and (eq system-type 'hpux) (eq locale "japanese")) | |
463 'shift-jis))) | |
464 | |
465 ;; fallback | |
466 euc-jp) | |
467 | |
468 ;; (input-method . "japanese") | 427 ;; (input-method . "japanese") |
469 (features japan-util) | 428 (features japan-util) |
470 (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B") | 429 (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B") |
471 (documentation . t))) | 430 (documentation . t))) |
472 | 431 |
432 ;; Set the native-coding-system separately so the lambdas get compiled. (Not | |
433 ;; a huge speed improvement, but this code is called at startup, and every | |
434 ;; little helps there.) | |
435 (set-language-info "Japanese" | |
436 'native-coding-system | |
437 (list | |
438 ;; first, see if an explicit encoding was given. | |
439 (lambda (locale) | |
440 (let ((case-fold-search t)) | |
441 (cond | |
442 ;; many unix versions | |
443 ((string-match "\\.euc" locale) 'euc-jp) | |
444 ((string-match "\\.sjis" locale) 'shift-jis) | |
445 | |
446 ;; X11R6 (CJKV p. 471) | |
447 ((string-match "\\.jis7" locale) 'jis7) | |
448 ((string-match "\\.jis8" locale) 'jis8) | |
449 ((string-match "\\.mscode" locale) 'shift-jis) | |
450 ((string-match "\\.pjis" locale) 'iso-2022-jp) | |
451 ((string-match "\\.ujis" locale) 'euc-jp) | |
452 | |
453 ;; other names in X11R6 locale.alias | |
454 ((string-match "\\.ajec" locale) 'euc-jp) | |
455 ((string-match "-euc" locale) 'euc-jp) | |
456 ((string-match "\\.iso-2022-jp" locale) 'iso-2022-jp) | |
457 ((string-match "\\.jis" locale) 'jis7) ;; or just jis? | |
458 ))) | |
459 | |
460 ;; aix (CJKV p. 465) | |
461 (lambda (locale) | |
462 (when (eq system-type 'aix) | |
463 (cond | |
464 ((string-match "^Ja_JP" locale) 'shift-jis) | |
465 ((string-match "^ja_JP" locale) 'euc-jp)))) | |
466 | |
467 ;; other X11R6 locale.alias | |
468 (lambda (locale) | |
469 (cond | |
470 ((string-match "^Jp_JP" locale) 'euc-jp) | |
471 ((and (eq system-type 'hpux) (eq locale "japanese")) | |
472 'shift-jis))) | |
473 | |
474 ;; fallback | |
475 'euc-jp)) | |
476 | |
473 ;;; japanese.el ends here | 477 ;;; japanese.el ends here |