Differences between revisions 16 and 17
Revision 16 as of 2007-01-15 04:06:52
Size: 4656
Editor: nickcheng
Comment:
Revision 17 as of 2009-12-25 07:16:15
Size: 4660
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
-- hoxide [[[DateTime(2004-08-15T04:57:08Z)]]] -- hoxide [<<DateTime(2004-08-15T04:57:08Z)>>]
Line 5: Line 5:
[[TableOfContents]] <<TableOfContents>>
Line 30: Line 30:
下载python-mode.el,鉴于用google搜所也要定时间我直接把代码贴到["python-mode.el"],拷贝粘帖就可以了.
  * attachment:Python-Mode -- ["nickcheng"]
   * 这个附件是zip文件, 如果下载后扩展名不对, 请自己更正 -- ["nickcheng"]
下载python-mode.el,鉴于用google搜所也要定时间我直接把代码贴到[[python-mode.el]],拷贝粘帖就可以了.
  * [[attachment:Python-Mode]] -- [[nickcheng]]
   * 这个附件是zip文件, 如果下载后扩展名不对, 请自己更正 -- [[nickcheng]]

-- hoxide [2004-08-15 04:57:08]

emacs配置问题集

简述

windows下~/在什么地方

  • 默认在c:/, 也就是说.emacs应该放在c:/.emacs
  • ~/目录在windows下是%HOME%变量来控制的,设置一个系统变量或者用户变量,比如(%HOME%=E:\My Documents),Emacs就会到相应的目录下寻找.emacs文件。可以在命令行下使用如下命令来设置 {{{set HOME=E:\My Document

}}}

  • 在系统环境PATH中设置相应的目录也是可以的。 --EddyXu

python.el

Emacs22/23中包含一个python.el,它是Emacs开发者维护的版本。不需要对Emacs做任何特殊设置,就可以直接识别python源文件。

python-mode.el

python-model.el由Python社区维护,和python.el无关。

你需要下载python-mode.el,并作一些设置才能使它正常工作。

很遗憾emacs默认不包含python-mode.这可能和目前python-mode还不稳定有关,我在使用时就发现了一些小问题,但瑕不掩瑜python-mode是很好的东西.

安装

下载python-mode.el,鉴于用google搜所也要定时间我直接把代码贴到python-mode.el,拷贝粘帖就可以了.

把下载的python-mode.el放在任何一个你喜欢的地方,我选择d:/emacs/site-lisp, 然后把

 (load "d:/emacs/site-lisp/python-mode.el")
 (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))

粘帖到.emacs文件的最后. 另外为了让emacs可以自动高亮显示,也要设置一下,可以用options菜单下的选项,然后save有关的设置就自动保存在.emacs里了,我就是这样的. 或者把下面的代码贴到.emacs

(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(case-fold-search t)
 '(current-language-environment "Chinese-GB")
 '(default-input-method "chinese-py-punct")
 '(global-font-lock-mode t nil (font-lock))
 '(show-paren-mode t nil (paren))
 '(transient-mark-mode t))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )

经过上面的设置emacs自动将.py的文件设置到python-mode,如果想手动进入python模式,按M-x python-mode

nickcheng的安装体验

原文见: http://nickcheng.com/index.php/2006/02/28/config-the-emacs-for-python-dev/

安装配置包

Python-Mode的zip包里有4个文件. 先別管都是干嘛的了, 我是一股脑的都放到emacs的site-lisp目录下了. 然后运行bin目录下的runemacs.exe启动Emacs, 用下面的命令检查包是不是放好了.

M-x locate-library RET python-mode RET

RET就是回车的意思了!

更改配置文件

默认Emacs的配置文件在这个位置:

%userprofile%\Application Data\.emacs

如果没有的话可以新建一个, 然后输入下面的代码

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Python设置
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq auto-mode-alist
(cons ‘(”\\.py$” . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
(cons ‘(”python” . python-mode) interpreter-mode-alist))

(autoload ‘python-mode “python-mode” “Python editing mode.” t)

(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; 设置结束
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

存盘, 重新启动Emacs

基本上已经可以使用了!

Maxima Mode

  • 把Maxima嵌入到Emacs中 复制Maxima安装目录里emacs下的所有文件到Emacs的搜索路径中, 我是直接复制到 F:\emacs\site-lisp\maxima 下 添加以下内容到.emacs中

;;Maxima in Emacs
(load "f:/emacs/site-lisp/maxima/maxima.el")
(autoload 'maxima-mode "maxima" "Maxima mode" t)
(autoload 'maxima "maxima" "Maxima interaction" t)
(autoload 'maxima-minibuffer "maxima" "Maxima in a minibuffer" t)
(setq auto-mode-alist (cons '("\\.max" . maxima-mode) auto-mode-alist))
  • 由此可以是用maxima-mode了, 包括编辑.max的高亮, 和maxima的解释器. 再配合LaTeX-mode就完美了.

XEmacs

  • Xemacs的配置问题, 待补

EmacsConfig (last edited 2009-12-25 07:16:15 by localhost)