#### 改进
1. auto-complete 的 parser 的 结果 刷新会有延迟。一个名字更改之后,老名字应该立即去除。
#### 实践
综合了 主干blog 的配置(其实就是 python-mode 安装包里的 INSTALL 和 README 的 提示) 和 Emacs Wiki 上 IPython 的 配置。
0.配置放置在 python-mode-init.el 中。
1.Install IPython
Linux:
sudo apt-get install ipython-notebook : 12.10 得到的是 0.12.1ref : http://ipython.org/install.html
Windows:
IPython 工作得不好: 没有 输出。 ( 最后使用的是 Python.exe )
py-execute-region 是 python-mode.el 的 func。
没有用到 IPython Completions,而且,src code (6.1.2 ) 中,没有出现 在 buffer 中显示 completion 别且切换到 buffer 中的 code 。
2 安装 Pymacs 和 ropemacs。
(0) apt-get install pyrope
(1) Pymacs : git clone --> checkout (tag) v0.25 --> make
详细,查看 makefile 中的 各个 targets 。
先 make ,再 test , 再 sudo make install 。
(2)apt-get install pyropemacs
3. 配置 pymacs-init.el
初始化 project root :
C-x p o : rope-open-project
Key | Command |
---|---|
M-/ | rope-code-assist |
M-? | rope-lucky-assist |
C-c g | rope-goto-definition |
C-c d | rope-show-doc |
C-c f | rope-find-occurrences |
C-c r s | rope-change-signature |
C-c r m | rope-extract-method |
C-c r i | rope-inline |
C-x p u | rope-undo |
C-x p r | rope-redo |
需求:
1. 重构:方便、精确 的 refactor 很重要
2.
3.
4. 和 Python shell 交互 --> buffer 中的 code 直接发送到 emacs 中 执行 : 免了打开 IDLE
5. 补全 并且 candidate 不会以 buffer 的 形式 弹出
Misc :
代码折叠: 带有 GUI 的东西,如果只是 plain code 的话,GUI 的 初始化 函数会有很多。
code check / syntax check : flymake :pyflakes
查询 Python 文档(次要)
emacs wiki 同时讲述 多个 alternatives,太混乱,于是,我找了讲述 某个 suite 的 blog,了解概要,链接如下:
http://www.jesshamrick.com/2012/09/18/emacs-as-a-python-ide/
####
1. Pymacs(后端,负责 python 和 LISP 交互) 和 Ropemacs
2.
3. Ropemacs ( 需要 Rope, Ropemode, Pymacs and Ropemacs )
4. IPython :(0.14) 以上
5. auto-complete + Python-mode | Rope : better
#### Suite
1. emac-for-python : epy-init.el
#### Links
0. IPython : here(0.14):
1.Python Mode : download : Configs
2.禁止 补全 以 buffer 形式 弹出
3. Pymacs Pymacs code
Ropemacs ropemacs code
#### Dependency
0. python-mode.el
1. IPython : pre : Python 2.7
IPython : 和 Python-mode 兼容, Ropemacs 和 Python-mode 兼容(使用 Python-mode hook)
2. Ropemacs : rope + pymacs