Seiji Zenitani
zenit****@users*****
2006年 1月 8日 (日) 12:54:10 JST
Index: CarbonEmacsPackage/GPL/site-start.d/carbon-emacs-japanese-init.el diff -u CarbonEmacsPackage/GPL/site-start.d/carbon-emacs-japanese-init.el:1.11 CarbonEmacsPackage/GPL/site-start.d/carbon-emacs-japanese-init.el:1.12 --- CarbonEmacsPackage/GPL/site-start.d/carbon-emacs-japanese-init.el:1.11 Thu Dec 29 18:44:09 2005 +++ CarbonEmacsPackage/GPL/site-start.d/carbon-emacs-japanese-init.el Sun Jan 8 12:54:10 2006 @@ -3,8 +3,14 @@ ;; Settings will be ignored in a non-Japanese environment ;; 日本語環境でのみ以下の設定をロードします -(when +;; Chinese and Korean settings can be made from lines in sections A and B. +;; In section A, some modification will be required. +;; e.g. sjis-mac and 'Japanese should be replaced. +;; In section B, no modification is necessary. +;; Lines in section C are not necessary. +(when + (or ;; 1. Mac OS X Japanese Language environment ;; The environment variable __CF_USER_TEXT_ENCODING could be @@ -20,24 +26,58 @@ ;; ============= Japanese language setting ====================== + ;; A. language environment (set-language-environment 'Japanese) (set-default-coding-systems 'utf-8-unix) (set-keyboard-coding-system (if (eq window-system 'mac) 'sjis-mac 'utf-8)) ; by seto-san (set-clipboard-coding-system 'utf-8) (set-terminal-coding-system 'utf-8) -;; (set-file-name-coding-system 'utf-8m) ; already set + ;; (set-file-name-coding-system 'utf-8m) ; already set + ;; A. end - ;; ---- inline input method (window-system) ---- + ;; B. inline input method (window-system) (when (eq window-system 'mac) -;; (setq default-input-method "MacOSX-IM-JP") (mac-setup-inline-input-method) (add-hook 'minibuffer-setup-hook 'mac-change-language-to-us) -;; (add-hook 'isearch-mode-hook 'mac-im-isearch-mode-setup) -;; (add-hook 'isearch-mode-end-hook 'mac-im-isearch-mode-cleanup) - ) - ;; ---- inline nput method ---- + ;; B. end + + ;; C. fix: Unicode => Japanese mapping + ;; Thanks to saiki-san (see [macemacsjp-users 870]) + ;; register circle around digits to cjk table (by Ando-san) + (defadvice utf-translate-cjk-load-tables + (after my-ad-circled-digit activate) + (dotimes (i 20) + (let ((unicode (+ #x2460 i)) + (char (+ 54433 i))) + (if (utf-translate-cjk-substitutable-p unicode) + (puthash unicode char ucs-unicode-to-mule-cjk)) + (puthash char unicode ucs-mule-cjk-to-unicode)))) + ;; prevent to use half-width marks (by Nanba-san) + (utf-translate-cjk-set-unicode-range + '((#x2e80 . #xd7a3) + (#xff00 . #xffef) + (#xa7 . #xa7) ; + (#xb0 . #xb1) ; + (#xb4 . #xb4) ; + (#xb6 . #xb6) ; + (#xd7 . #xd7) ; + (#xf7 . #xf7) ; + (#x370 . #x3ff) ; ギリシャ + (#x400 . #x4ff) ; キリル + (#x2000 . #x206f) ; 一般句読点 + (#x2103 . #x2103) ; ℃ + (#x212b . #x212b) ; Å + (#x2190 . #x21ff) ; 矢印 + (#x2200 . #x22ff) ; 数学記号 + (#x2300 . #x23ff) ; 技術記号 + (#x2460 . #x2473) ; 円囲み数字 + (#x2500 . #x257f) ; 罫線 + (#x25a0 . #x25ff) ; 幾何学模様 + (#x2600 . #x26ff) ; その他の記号 + )) + ;; C. end ;; ============= Japanese language setting ======================