【发布时间】:2013-06-11 11:05:30
【问题描述】:
我已经搜索了所有内容,我只能找到类似的问题:improper exiting from indentation in emacs python-mode 有人无法从正确的缩进中退出。
每当我创建一个 if 语句时,说
if(foo):
bar()
Python 模式不允许我缩进小节线,迫使我将其保留为
if(foo):
bar()
这会引发缩进错误。这发生在所有 .py 文件中。使用 python.el 时效果很好,但我更喜欢 python-mode 的功能。有没有其他人找到解决方案/遇到这个问题?
我的 .emacs 文件只是加载 python-mode 的行。
【问题讨论】:
-
我没有 emacs,但您是否尝试过在
if之后放置一个空格,这是典型的做法?括号也是多余的,尽管我怀疑这会破坏任何东西。 -
我都试过了,但似乎都没有任何作用。我只好手动添加空格。
-
您关于更喜欢 python-mode.el 功能的评论让我担心(作为 Emacs 维护者,他一直在处理 Emacs w.r.t Python 支持中包含的内容)。显然,SO 不是讨论它的地方,但是请向我们发送一些关于 python-mode.el 的特性的 cmets 到 emacs-devel 或 bug-gnu-emacs。
-
也许你可以试试@sanityinc 在stackoverflow.com/questions/2111041/… 中描述的方式。
标签: python emacs emacs24 python-mode