Search code examples
pythonemacsdocstringpep8autoformatting

In emacs Python mode, how do I set a different auto-fill width for docstrings and code?


I would like to have auto-fill set to 79 columns for code sections and 72 for docstrings to get automatic PEP8 compliance. There seems to be an option to do this for Lisp mode (emacs-lisp-docstring-fill-column) but not for Python.

Is there an enhanced python-mode.el around somewhere that includes this?


Solution

  • Current python-mode.el provides

    (defcustom py-docstring-fill-column 72 [...]
    
    (defcustom py-comment-fill-column 79 [...]
    

    while for code value of fill-column is used.