Use of a variable in parent loop
Grant Edwards
grant.b.edwards at gmail.com
Mon Sep 28 13:47:33 EDT 2020
On 2020-09-27, Stephane Tougard via Python-list <python-list at python.org> wrote:
> However, I discovered that Emacs interprets as well an empty line or a
> comment as a breaking point of a block, it's not as good as the use of
> pass because I still have to indent up manually, but at least the
> indent-region does not break it.
I don't understand what you expect emacs 'indent-region' to do.
With token-delimited languages, it will re-do the indentation of a
block with respect to the first selected line. That's possible
because for C et al. indentation can be deduced from keywords and
block delimiters.
That's simply not possible with Python because indentation _is_ the
delimiters. Expecting Python to know how your code is supposed to be
indented would be like entering a block of C code with no curly braces
and then expecting emacs to know where to insert them so that the code
does what you want.
You can increase/decrease indentation by selecting a block and hitting
C-c < or C-c >.
--
Grant
More information about the Python-list
mailing list