【发布时间】:2015-10-22 14:45:08
【问题描述】:
我发现 emacs 中的 python-mode 存在问题。我一般c++开发,很少做python。
我最近发现了这个问题:
我的 emacs -Q
我打开一个python文件
它包含:
import re as myre
Var = [
%
% 代表光标位置。然后,在该位置,我尝试使用制表符并收到此错误:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
python-indent-context()
python-indent--calculate-indentation()
python-indent-calculate-indentation(nil)
python-indent-line(nil)
python-indent-line-function()
indent-for-tab-command(nil)
call-interactively(indent-for-tab-command nil nil)
command-execute(indent-for-tab-command)
我已经有一个月左右没有使用 python 开发了,但我不记得这是个问题。 我正在使用 emacs 24.5.1 windows 7 64、python 2.7.3 和 - 当然 - -Q 所以没有配置。
现在,我尝试通过运行它来应用 python-mode 6.2.1
Emacs –Q 在从头开始 (setq load-path (append load-path (list "~/.emacs.d/python-mode.el-6.2.1"))) (需要'python-mode)
我打开一个 python 文件(与上面相同)然后我可以缩进。这一切都很好,所以如果我在我的 NORMAL 配置中加载 python-mode 6.2.1 el 文件,这可以解决问题,但是现在使用新的 6.2.1 我没有得到与以前相同的主题颜色(现在是bland 和 variable 与其他文本的颜色相同,而不是突出。此外,which-function-mode 似乎(再次)被破坏并且在 python 中开发很缓慢(当你打开一个大文件时) - 我记得 python-mode和 which-function-mode 在 24.3 中互相不友好,但是用 STOCK el 24.5 解决了
不幸的是,对我来说,6.2.1 解决了一个问题,但也带来了其他问题——包括回归。
如果我可以只使用解决缩进问题的补丁,那就太好了。
谢谢。
【问题讨论】:
标签: python python-2.7 emacs emacs24 python-mode