google code-beautifer

星期日, 12月 30, 2007

設定(X)Emacs中文環境參數

1.1 版

前言


在已完善中文化的Linux 系統如Mandriva 2008上跑big5跟utf8中文已不成問題。不過這兩個編碼系統都不夠好。要在Linux上跑CCCII等大字集編碼還有一段路,還是有必要仔細研究一下Emacs對中文設定(X)Emacs中文環境參數,這樣可以用Emacs來作大字集編碼中文的發展測試平台。

這裡針對討論近年來3個版本討論: xEmacs 21.5 及 Emacs22.0.50, Emacs 22.1.5 (支援unicode)。其中 Emacs 22.1.5是在Mandriva 新版(2008)上的測試結果(locale 設定: LANG=zh_TW.UTF-8)。其他是直接引用舊版的測試結果,應該是Windows上的Emacs。我不太確定當初locale 設定,我猜是LANG=zh_TW(意思就是big5)。Emacs以後的23 版的結構應該跟22.1接近,這裡專注在這個版本討論。

基本設定


Mule 在 win32 build 的 xEmacs 21.5 及 Emacs 22.0.50(跟之後) 都有內建。
查看設定值可由選單中選 Edit->MultiLingual "Mule"->Describe CurrentCoding system
( XEmacs 21.5 在 在選單 Options->Advanced (Customize) ->Emacs-> Environment-> I18n->mule
Emacs 22.0.50 在 Options->Customize Emacs->Top level CustomizationGroup -> Environment -> I18n -> mule)

  • Coding system for saving this buffer:
  • Default coding system (for new files):

兩者預設值都是 ISO8 -- iso-2022-8
Emacs 22.1.5 在這裡就看不到這兩個變數,我猜測是因為支援unicode造成的改版,實際上是否移到別的地方,或者可否自行在起始檔(如.emacs) 加入選項,還待研究。

Emacs 22.1.5相關的重要變數有

  • Keyboard Coding Syste (預設值: nil)
  • Default Input Method (設定值: chinese-py-punct-b5)
  • Current Language Environment (設定值: Chinese-BIG5)
  • Utf Translate Cjk Unicode Range (預設值: Cons-cell:
    Integer: 11904
    Integer: 55203
    Cons-cell:
    Integer: 65280
    Integer: 65519
  • Utf Translate Cjk Mode (預設值: t)
  • Utf 8 Compose Scripts (預設值: nil)
  • Enable Multibyte Characters (預設值: t)
  • Selection Coding System (預設值: compound-text-with-extensions)
  • Unibyte Display Via Language Environment (預設值: nil)
  • Describe Char Unicodedata File (預設值: )
  • Leim (預設值: )

XEmacs 21.5 相關的重要變數有

  • Current Language Environmen
  • Default Input Method


Emacs 22.0.50相關的重要變數有

  • Keyboard Coding Syste (預設值: cp950)
  • Default Input Method (預設值: chinese-py-punct-b5)
  • Current Language Environment (預設值: Chinese-BIG5)
  • Utf Translate Cjk Unicode Range (預設值: )
  • Utf Translate Cjk Mode (預設值: t)
  • Utf 8 Compose Scripts (預設值: nil)
  • Enable Multibyte Characters (預設值: t)
  • Selection Coding System (預設值: utf-16le-dos)
  • Unibyte Display Via Language Environment (預設值: nil)
  • Describe Char Unicodedata File (預設值: )
  • Leim (預設值: )