2024-09-28 22:03:53 发布
网友
我正在用Emacs编写一些Python代码,但是当我完成一个函数块并想定义下一个函数时,该行会自动缩进:
def funA(x): print("Hello!") return 1 def funB(y):<--- cursor is here, when I press RET line is automatically indented!
既然def应该在第一列中,我如何才能使Emacs不这样做呢?在
def
这是一个已知的错误,已在Emacs的当前开发版本中修复:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18228
作为临时修复,您可以使用以下代码,这将导致electric-indent-mode不重新缩进冒号上的当前行:
electric-indent-mode
(add-hook 'python-mode-hook (lambda () (setq electric-indent-chars '(?\n))))
这是一个已知的错误,已在Emacs的当前开发版本中修复:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18228
作为临时修复,您可以使用以下代码,这将导致
electric-indent-mode
不重新缩进冒号上的当前行:相关问题 更多 >
编程相关推荐