Sujet : Re: Python (was Re: I did not inhale)
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.unix.programmer comp.lang.misc comp.editorsDate : 29. Aug 2024, 02:22:18
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vaoig9$3m9tm$3@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
User-Agent : Pan/0.160 (Toresk; )
On Thu, 29 Aug 2024 02:29:55 +0200, Janis Papanagnou wrote:
If there's only
primitive editing commands available (i.e. selection by mouse, or long
clumsy keyboard sequences) it may be irrelevant whether you indent code
in a Python or in a "C" program. If you're using editors like Vi that
block selection can be done with '%' and the indent with '>%' and the
reverse indent with '<%' (without the quotes); but that works only if
you have the syntactical elements (the braces, parenthesis, brackets) as
definition of the program block. That won't work for a block in a
language like Python where blocks are defined by layout (by the grade of
indentation); then you'd have to resort to the primitive editors'
selection features, mouse/menus or more laborious keyboard commands.
I have Emacs commands defined to jump quickly between lines with matching
indentation. That lets me easily select entire statement blocks in Python.