[Python-Dev] whitespace normalization

Tim Peters tim.peters at gmail.com
Thu Apr 26 00:34:46 CEST 2007

> Just a little FYI, python-mode (the one Barry and I manage - dunno about the
> one distributed w/ GNU Emacs these days) is one of those tools that leaves
> trailing whitespace behind when advancing to the next line..

Shouldn't be -- unless the behavior of the Emacs newline-and-indent
has changed.  The pymode version (py-newline-and-indent) relies in
part on newline-and-indent; the intent is documented in the
py-newline-and-indent docstring:

    (defun py-newline-and-indent ()
       In general, deletes the whitespace before
       point, inserts a newline, and takes an educated guess as
       to how you want the new line indented."

IIRC, pymode leaves C-j bound to plain old newline, so if you're in
the habit of starting a new line via C-j no changes of any kind are
made to whitespace.  But that's not the intended way to use pymode.

More information about the Python-Dev mailing list