【发布时间】:2012-12-08 07:49:18
【问题描述】:
我在 Emacs 中使用 python-mode.el 来编辑一些 Python 代码,它有一个最烦人的功能,它会自动缩进注释然后开始一个新行。例如,如果我有这个:
def x():
y = 1
<cursor is here, at root indentation level>
然后在根缩进级别加一个#:
def x():
y = 1
#
<cursor is now here>
它会自动缩进,插入 #,并在 # 之后插入回车。这让我疯狂。我希望我的 cmets 准确地留在我放置它们的位置!有什么建议?
我查看了该模式的 elisp 代码,但找不到任何东西,也无法在网上其他地方找到任何东西。我所能找到的只是 cmets 不会用于未来的缩进(py-honor-comment-indentation),但与评论本身无关。也不是奇怪的回车。
【问题讨论】:
-
FWIW,与 Emacs 捆绑的 python 模式不会遇到这个问题,AFAICS。
标签: python emacs comments indentation python-mode