Emacs Python mode again

Tim Peters (tim@ksr.com)
Fri, 07 Feb 92 17:48:51 EST

Added another function, to reformat existing code (to use the value of
py-indent-offset you like). Easiest thing is to visit a file of old
code, then do

C-x h C-c r

"C-x h" is ordinary Emacs that sets the region to the whole buffer, then
"C-c r" runs the new function py-reindent-top-level-region. Here's the
doc string:

"Reindent region with current value of py-indent-offset.
This is useful when you inherit Python code from someone who used
a silly (i.e., not yours) value for py-indent-offset, or just to see
what your code would look like if you changed your setting of py-
indent-offset.

The region is assumed to be correctly indented and to start with top-
level Python code (i.e., code that starts in the first column). The
region is then reindented with the current value of py-indent-offset.

If you specify a numeric prefix argument, that will be used for the
indentation offset instead.

Special cases: whitespace is deleted from entirely blank lines; and
continuation lines are shifted by the same amount their base line was
shifted, in order to preserve their relative indentation with respect to
their base line."

shiftily y'rs - tim

Tim Peters Kendall Square Research Corp
tim@ksr.com, ksr!tim@uunet.uu.net