Python.el错误处理docstring上的M-q缩进

Python.el错误处理docstring上的M-q缩进,python,emacs,Python,Emacs,给定函数 def foo(): """ etc stuff """ pass 当我运行M-q以更新我的文档字符串时,emacs(24.3.1,python.el)将重新格式化foo,如下所示: def foo(): """etc stuff """ pass 我如何告诉python.el别管它?(我知道这种行为是新的,不同计算机(我无权访问)上的旧emacs没有这样做) python.el所做的实际上是python约定(尽管第一行后面没有空行)-请参见的示

给定函数

def foo():
  """
  etc
  stuff
  """
  pass
当我运行M-q以更新我的文档字符串时,emacs(24.3.1,python.el)将重新格式化foo,如下所示:

def foo():
  """etc
  stuff
  """
  pass

我如何告诉python.el别管它?(我知道这种行为是新的,不同计算机(我无权访问)上的旧emacs没有这样做)

python.el所做的实际上是python约定(尽管第一行后面没有空行)-请参见的示例:

def complex(real=0.0, imag=0.0):
    """Form a complex number.

    Keyword arguments:
    real -- the real part (default 0.0)
    imag -- the imaginary part (default 0.0)
    """
    if imag == 0.0 and real == 0.0:
        return complex_zero
看看,改变这种行为的参数是
'python-fill-docstring-style'
,它默认为
pep-257
,但提供了一些替代方案:

:type '(choice
          (const :tag "Don't format docstrings" nil)
          (const :tag "Django's coding standards style." django)
          (const :tag "One newline and start and Two at end style." onetwo)
          (const :tag "PEP-257 with 2 newlines at end of string." pep-257)
          (const :tag "PEP-257 with 1 newline at end of string." pep-257-nn)
          (const :tag "Symmetric style." symmetric))

这实际上是Python约定,尽管缺少一个空行-请参阅。搜索表明
'python-fill-docstring-style'
是您要查找的参数(您可能需要
'nil'
'symmetric'
)。@jornsharpe-Ah,感谢变量提示。我真的想要DJANGO,挥杆和失误!没问题。@jonrsharpe-哈哈,没问题。把你的评论记下来作为答案,我会把它记下来的!讽刺的是,您在PEP257中引用的示例实际上被Emacs错误地填充了:关键字参数列表被折叠成一行。有办法解决这个问题吗?