2008-03-04

在Windows下用Emacs作为Python的IDE

关键字: python
闲来无事, 写Python代码玩, 没有好的IDE. 想到Emacs超强, 到网上一查果然.
于是去下载Emacs最新版/Python-mode.el回来折腾.没想到还碰到了很多问题, 好在在Google大神的帮助下一一解决, 记录下来供有相同问题的同志参考:
1)Emacs的配置文件.emacs不能直接在Windows下建立, 它死活说要一个文件名...我不是明明给了吗...没办法, 用Copy Con .emacs搞定.
2)指定Emacs的配置文件所在的路径,在注册表中CurrentUSer/Software/GNU/Emacs下建立一个REG-SZ值"HOME", 内容就是.emacs所在的路径.
3)修改.emacs(从某位网友那抄来的):
(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)
(setq default-frame-alist
(append
'((font . "-*-Lucida Console-normal-r-*-*-13-*-*-*-c-*-fontset-most"))
default-frame-alist))
(defun w32-restore-frame ()
"Restore a minimized frame"
(interactive)
(w32-send-sys-command 61728))
(defun w32-maximize-frame ()
"Maximize the current frame"
(interactive)
(w32-send-sys-command 61488))
;;; Maximum Windows Frame
(w32-maximize-frame)
最开始总是报错, 后来看一下Emacs的出错信息, 原来抄来的单引号和双引号都有问题,手动改好.
4)运行...还是报错...python找不到...发现是因为Path里没有python解释器的路径...我加,我加,我加加加
大功告成. 运行, 发现它的输出实在难看...
PS:Emacs自带python.el,不过传说不如python.org上的python-mode.el好用...虽然我没感觉.
评论
发表评论

提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则

您还没有登录,请登录后发表评论

白发红颜
搜索本博客
博客分类
我的相册
06a5e694-eff2-474e-91b3-63ab49632d57-thumb
IMG_1989
共 9 张
存档
最新评论