LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 805|回复: 0

emacs could not display Chinese

[复制链接]
发表于 2009-4-25 09:23:55 | 显示全部楼层 |阅读模式
It give a warning:

  1. Warning: no fonts matching `-*-fixed-medium-r-normal-*-16-*-*-*-*-*-iso8859-1' available [2 times]
复制代码


  1. cat .emacs
复制代码


  1. ;; --------------------------------------------------------------------------
  2. ;; eim chinese input mehod
  3. ;; --------------------------------------------------------------------------

  4. (add-to-list 'load-path "~/.emacs.d/site-lisp/eim")
  5. (autoload 'eim-use-package "eim" "Another emacs input method")

  6. ;; testing *FEATURE* tooltip
  7. (setq eim-use-tooltip nil)

  8. (register-input-method
  9. "eim-wb" "euc-cn" 'eim-use-package
  10. "五笔" "汉字五笔输入法" "wb.txt")
  11. (register-input-method
  12. "eim-py" "euc-cn" 'eim-use-package
  13. "拼音" "汉字拼音输入法" "py.txt")

  14. ;; input English with ';' temporary
  15. (require 'eim-extra)
  16. (global-set-key ";" 'eim-insert-ascii)

  17. ;; eim-wb page
  18. (add-hook 'eim-wb-load-hook
  19.           (lambda ()
  20.             (let ((map (eim-mode-map)))
  21.               (define-key map "-" 'eim-previous-page)
  22.               (define-key map "=" 'eim-next-page))))

  23. (add-hook 'eim-wb-load-hook
  24.           (lambda ()
  25.             (let ((map (eim-mode-map)))
  26.               (define-key map "," 'eim-previous-page)
  27.               (define-key map "." 'eim-next-page))))

  28. ;; eim-py page
  29. (add-hook 'eim-py-load-hook
  30.           (lambda ()
  31.             (let ((map (eim-mode-map)))
  32.               (define-key map "-" 'eim-previous-page)
  33.               (define-key map "=" 'eim-next-page))))

  34. (add-hook 'eim-py-load-hook
  35.           (lambda ()
  36.             (let ((map (eim-mode-map)))
  37.               (define-key map "," 'eim-previous-page)
  38.               (define-key map "." 'eim-next-page))))

  39. ;; --------------------------------------------------------------------------
  40. ;; shortcuts
  41. ;; --------------------------------------------------------------------------

  42. ;; F7 compile
  43. (global-set-key [(f7)] 'compile)

  44. ;; F12-c calendar
  45. (global-set-key (kbd "<f12> c") 'calendar)

  46. ;; F2 wiki-mode
  47. (global-set-key [(f2)] 'emacs-wiki-find-file)

  48. ;; F4 shell-Mode
  49. (global-set-key [(f4)] 'ansi-term)

  50. ;; F9 list bookmarks
  51. (global-set-key (kbd "<f9>") 'list-bookmarks)

  52. ;; --------------------------------------------------------------------------
  53. ;; theme
  54. ;; --------------------------------------------------------------------------

  55. ;; cursor color
  56. ;; seems not working, add it at the bottom
  57. (set-cursor-color "white")

  58. ;; mouse color
  59. (set-mouse-color "white")

  60. ;; cursor type
  61. ;; (set-default 'cursor-type 'bar)
  62. (setq-default cursor-type 'box)

  63. ;; fg & bg color
  64. ;; (set-foreground-color "#FDFF00")
  65. ;; (set-foreground-color "#00FF00")
  66. (set-foreground-color "#CCCCCC")
  67. (set-background-color "#343434")

  68. ;; highlight theme
  69. (set-face-foreground 'highlight "white")
  70. (set-face-background 'highlight "blue")

  71. ;; region theme
  72. (set-face-foreground 'region "cyan")
  73. (set-face-background 'region "blue")

  74. ;; secondary selection theme
  75. (set-face-foreground 'secondary-selection "skyblue")
  76. (set-face-background 'secondary-selection "darkblue")

  77. ;; calendar color
  78. (setq calendar-load-hook
  79. '(lambda ()
  80. (set-face-foreground 'diary-face "skyblue")
  81. (set-face-background 'holiday-face "slate blue")
  82. (set-face-foreground 'holiday-face "white")))

  83. ;; --------------------------------------------------------------------------
  84. ;; custom user interface
  85. ;; --------------------------------------------------------------------------

  86. ;; remove startup
  87. (setq inhibit-startup-message t)

  88. ;; remove scrollbar
  89. (set-scroll-bar-mode nil)


  90. ;; remove toolbar
  91. (tool-bar-mode nil)

  92. ;; show path
  93. (setq frame-title-format "lee@%b")

  94. ;; image enable
  95. (auto-image-file-mode t)

  96. ;; show column number
  97. (column-number-mode t)

  98. ;; highlight matched brackets
  99. (show-paren-mode t)

  100. ;; display time
  101. (display-time-mode 1)
  102. (setq display-time-24hr-format t)
  103. (setq display-time-day-and-date t)

  104. ;; --------------------------------------------------------------------------
  105. ;; misc
  106. ;; --------------------------------------------------------------------------

  107. ;; sudo
  108. ;; tramp means: Transparent Remote (file) Access, Multiple Protocol,
  109. (require 'tramp)


  110. ;; default mode is text-mode
  111. (setq default-major-mode 'text-mode);

  112. ;; syntax highlight
  113. (global-font-lock-mode t)

  114. ;; support X paste
  115. (setq x-select-enable-clipboard t)

  116. ;; auto line break
  117. ;; (setq default-fill-column 80)

  118. ;; no backup file
  119. (setq-default make-backup-files nil)

  120. ;; move mouse while cursor close to mouse
  121. (mouse-avoidance-mode 'animate)
  122. (transient-mark-mode t);

  123. ;; remove bell
  124. (setq visible-bell t)

  125. ;; use `y/n` instead of `yes/no`
  126. (fset 'yes-or-no-p 'y-or-n-p)

  127. ;; default work DIR
  128. ;; (setq default-directory "/home/yuki/shuge/s/")

  129. ;; --------------------------------------------------------------------------
  130. ;; tab
  131. ;; --------------------------------------------------------------------------

  132. (setq indent-tabs-mode nil)
  133. ;; (setq tab-stop-list ())
  134. (setq default-tab-width 4)
  135. (setq tab-width 4)
  136. ;; (setq-default indent-tabs-mode t)
  137. (setq-default indent-tabs-mode nil)

  138. ;; --------------------------------------------------------------------------
  139. ;; tab
  140. ;; for C Programming
  141. ;; --------------------------------------------------------------------------

  142. (setq indent-tabs-mode nil)
  143. (setq default-tab-width 4)
  144. (setq tab-width 4)
  145. (setq tab-stop-list ())
  146. (loop for x downfrom 40 to 1 do
  147.       (setq tab-stop-list (cons (* x 4) tab-stop-list)))

  148. (defconst my-c-style
  149.   '((c-tab-always-indent        . t)
  150.     (c-comment-only-line-offset . 4)
  151.     (c-hanging-braces-alist     . ((substatement-open after)
  152.                                    (brace-list-open)))
  153.     (c-hanging-colons-alist     . ((member-init-intro before)
  154.                                    (inher-intro)
  155.                                    (case-label after)
  156.                                    (label after)
  157.                                    (access-label after)))
  158.     (c-cleanup-list             . (scope-operator
  159.                                    empty-defun-braces
  160.                                    defun-close-semi))
  161.     (c-offsets-alist            . ((arglist-close . c-lineup-arglist)
  162.                                    (substatement-open . 0)
  163.                                    (case-label        . 4)
  164.                                    (block-open        . 0)
  165.                                    (knr-argdecl-intro . -)))
  166.     (c-echo-syntactic-information-p . t)
  167.     )
  168.   "My C Programming Style")

  169. ;; offset customizations not in my-c-style
  170. (setq c-offsets-alist '((member-init-intro . ++)))

  171. ;; Customizations for all modes in CC Mode.
  172. (defun my-c-mode-common-hook ()
  173.   ;; add my personal style and set it for the current buffer
  174.   (c-add-style "PERSONAL" my-c-style t)
  175.   ;; other customizations
  176.   (setq tab-width 4
  177.         ;; this will make sure spaces are used instead of tabs
  178.         indent-tabs-mode nil)
  179.   ;; we like auto-newline and hungry-delete
  180.   (c-toggle-auto-hungry-state 1)
  181.   ;; key bindings for all supported languages.  We can put these in
  182.   ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map,
  183.   ;; java-mode-map, idl-mode-map, and pike-mode-map inherit from it.
  184.   (define-key c-mode-base-map "\C-m" 'c-context-line-break)
  185.   )

  186. (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

  187. ;; --------------------------------------------------------------------------
  188. ;; auto-complete
  189. ;; --------------------------------------------------------------------------

  190. ;; part I

  191. (global-set-key "\M- " 'hippie-expand)
  192. (setq hippie-expand-try-functions-list
  193.    '(try-complete-file-name-partially
  194.      try-complete-file-name
  195.      try-expand-all-abbrevs
  196.      try-expand-list
  197.      try-expand-line
  198.      try-expand-dabbrev
  199.      try-expand-dabbrev-all-buffers
  200.      try-expand-dabbrev-from-kill
  201.      try-complete-lisp-symbol-partially
  202.      try-complete-lisp-symbol))

  203. ;; part II

  204. (defun my-indent-or-complete ()
  205.    (interactive)
  206.    (if (looking-at "\\>")
  207.           (hippie-expand nil)
  208.           (indent-for-tab-command))
  209. )

  210. (global-set-key [(control tab)] 'my-indent-or-complete)

  211. (autoload 'senator-try-expand-semantic "senator")

  212. (setq hippie-expand-try-functions-list
  213.           '(
  214.                 senator-try-expand-semantic
  215.                 try-expand-dabbrev
  216.                 try-expand-dabbrev-visible
  217.                 try-expand-dabbrev-all-buffers
  218.                 try-expand-dabbrev-from-kill
  219.                 try-expand-list
  220.                 try-expand-list-all-buffers
  221.                 try-expand-line
  222.         try-expand-line-all-buffers
  223.         try-complete-file-name-partially
  224.         try-complete-file-name
  225.         try-expand-whole-kill
  226.         )
  227. )

  228. ;; --------------------------------------------------------------------------
  229. ;; po-mode
  230. ;; --------------------------------------------------------------------------

  231. (setq auto-mode-alist
  232.         (cons '("\\.po\\'\\|\\.po\\." . po-mode) auto-mode-alist))
  233. (autoload 'po-mode "po-mode" "Major mode for translators to edit PO files" t)

  234. ;; --------------------------------------------------------------------------
  235. ;; reStructuredText
  236. ;; rest-mode
  237. ;; --------------------------------------------------------------------------

  238. (add-to-list 'load-path "~/.emacs.d/site-lisp/rst")
  239. (autoload 'rst-use-package "rst" "lastest rst support")

  240. (setq auto-mode-alist
  241.       (append '(
  242. ;; ("\\.txt$" . rst-mode)
  243.                 ("\\.rst$" . rst-mode)
  244.                 ("\\.rest$" . rst-mode)) auto-mode-alist))


复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表