荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: abat (一只蝙蝠), 信区: Linux
标  题: 在emacs中输入中文
发信站: 荔园晨风BBS站 (Wed Mar 27 22:54:46 2002), 转信



即使你沒有裝設 xcin 或 cxterm ,如果你的 UNIX 有裝設 EMACS 20,你也可以輸入中文
。 你可以抓這兩個檔案裝設嘸蝦米輸入法和注音 輸入法, 你可以依照下列步驟設定。
http://bookmall.hypermart.net/cinput/boshiamy.el
http://bookmall.hypermart.net/cinput/zhuyin.el

首先在你的 home directory 下建立一個 emacs/quail 目錄。

    cd ~
    mkdir emacs
    cd emacs
    mkdir quail


將這兩個檔案放在 ~/emacs/quail/ ,為了增加效率,你最好先編譯這兩個檔案,產生
boshiamy.elc 和 zhuyin.elc 。

接著你要找出 load-path 的值,假設你的 load-path 是

    "/usr/share/emacs/site-lisp" "/usr/share/emacs/20.3/lisp/international"


你必須設定還境參數﹙environment variable﹚ EMACSLOADPATH。

setenv EMACSLOADPATH /usr/share/emacs/site-lisp:/usr/share/emacs/20.
3/lisp/international:~/emacs


建立一個 ~/emacs/leim-list.el 檔。以下是 leim-list.el 的內容。

;;; leim-list.el -- list of LEIM (Library of Emacs Input Method)
;;
;; This file contains a list of LEIM (Library of Emacs Input Method)
;; in the same directory as this file.  Loading this file registeres
;; the whole input methods in Emacs.
;;
;; Each entry has the form:
;;   (register-input-method
;;    INPUT-METHOD LANGUAGE-NAME ACTIVATE-FUNC
;;    TITLE DESCRIPTION
;;    ARG ...)
;; See the function `register-input-method' for the meanings of arguments.
;;
;; If this directory is included in load-path, Emacs automatically
;; loads this file at startup time.

(register-input-method
 "zhuyin" "Chinese-BIG5" 'quail-use-package
 "零壹注音" "中文輸入【零壹注音】"
 "quail/zhuyin")
(register-input-method
 "boshiamy " "Chinese-BIG5" 'quail-use-package
 "嘸蝦米" "中文輸入【嘸蝦米】"
 "quail/boshiamy")


你已經完成所有設定。可以用 emacs 輸入中文了。為了美觀和好用,我通常都建立一個別
名。

alias cemacs "emacs -r -fn 8x16 -l ~/.cemacs"


以下是我的 .cemacs 。

(set-language-environment "Chinese-BIG5")
(custom-set-variables
 '(default-input-method "boshiamy "))
(custom-set-faces)
(defun switch-to-zhuyin ()
  "Switch to Zhuyin input method"
  (interactive)
  (activate-input-method "zhuyin"))
(global-set-key [C-f4] 'switch-to-zhuyin)
(defun switch-to-boshiamy ()
  "Switch to Boshiamy input method"
  (interactive)
  (activate-input-method "boshiamy "))
(global-set-key [C-f9] 'switch-to-boshiamy)
(load "boshiamy-cue")
(global-set-key [C-f1] 'boshiamy-cue-char)


執行指令 cemacs 後,你可以使用 C-\ 切換到中文輸入模式。 Ctrl-F4 切換到注音輸入
,Ctrl-F9 切換到嘸蝦米輸入。如果你仔細看最後兩 行,你會發現按 Ctrl-F1 可以呼叫
 boshiamy-cue-char 。只要你目前的游標是在中文字元上,按 Ctrl-F1 可以顯示嘸蝦米
的輸入碼,讓你學習 嘸蝦米更方便。當然你必需下載這個檔案,
http://bookmall.hypermart.net/cinput/boshiamy-cue.el

編譯,並將

boshiamy-cue.elc 放到 ~/emacs。

--
※ 来源:·荔园晨风BBS站 bbs.szu.edu.cn·[FROM: 192.168.0.146]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店