Because I have
(setq python-indent-offset 4)
in my .emacs, when I start with code such as
def fn():
foo = bar()
if bar1 == bar2:
if blah1 == blah2:
return yay
and mark-whole-buffer (C-x h) followed by indent-region (C-M-\ ), I am expecting to get:
def fn():
foo = bar()
if bar1 == bar2:
if blah1 == blah2:
return yay
but I get instead:
def fn():
foo = bar()
if bar1 == bar2:
if blah1 == blah2:
return yay
Yet indent-region works just fine with curly-brace delimited languages. Is there a way to get it to work with an indentation-based language such as Python?
Please note:
- I am aware of Reindent but I'd like to stay within Emacs.
- I am well acquainted with string-rectangle (C-x r t) and python-indent-shift-right/left (C-c >), but neither these nor their variants do what I'm asking.