Emacs 在开括号后配置python挂起缩进
Emacs将我的代码缩进如下:Emacs 在开括号后配置python挂起缩进,emacs,indentation,Emacs,Indentation,Emacs将我的代码缩进如下: def my_function( a, b, c): pass if my_function( 1, 2, 3): pass 然而,PEP8指出,它应该像这样缩进,以避免将悬挂缩进与下一行混淆: def my_function( a, b, c): pass if my_function( 1, 2, 3): pass 如何配置emacs的旧python.el,在本例中使用现有
def my_function(
a, b, c):
pass
if my_function(
1, 2, 3):
pass
然而,PEP8指出,它应该像这样缩进,以避免将悬挂缩进与下一行混淆:
def my_function(
a, b, c):
pass
if my_function(
1, 2, 3):
pass
如何配置emacs的旧
python.el
,在本例中使用现有的python continuation offset
变量(在左括号和换行符之后),以便以第二种方式缩进?仅供参考,GNU emacs 25中的python模式正确地格式化了它 我不确定python
标记是否与此相符,我认为这更像是一个特定于emacs的缩进问题,因为这可能独立于语言,对吗?@spikespaz在大多数情况下,每个emacs模式都有自己的缩进和格式化实现,因此我认为答案可能特定于python模式。不过我同意,python
标记可能不正确,因为作为python专家并不意味着你更有可能回答这个问题。