Re: [Python-mode] bug lp:328842, flexible-indentation of multiline assignements

2011-03-25 Thread skip

Andreas What about indenting it to the end of first element of previous
Andreas line?

That is precisely the problem.  That's what it does today, and if the lhs of
the assignment is a complex expression, the continuation is indented way too
far.  I would much prefer just to simply indent by the normal block indent.

Skip
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] bug lp:328842, flexible-indentation of multiline assignements

2011-03-25 Thread Barry Warsaw
On Mar 25, 2011, at 09:51 AM, Andreas Röhler wrote:

while considering the request valid, even if the current
non-indent is an option,

what's the recommendable indent?

Would not choose the block-indent step, rather signal
it's something different at stake.

What about indenting it to the end of first element of
previous line?

;;;
(longer, sequence, of_items,
that, needs, to_be, wrapped) = input_list

packed_entry = (long, sequence, of_items,
 that, needs, to_be, wrapped)
;;

I must be missing something because these two snippets get indented like this
for me, running r405:

-snip snip-
(longer, sequence, of_items,
 that, needs, to_be, wrapped) = input_list

packed_entry = (long, sequence, of_items,
that, needs, to_be, wrapped)
-snip snip-

which seems exactly right to me!

If you do introduce a variable to control this, please do retain the current
behavior as default.

Cheers,
-Barry


signature.asc
Description: PGP signature
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] bug lp:328842, flexible-indentation of multiline assignements

2011-03-25 Thread Andreas Röhler

Am 25.03.2011 16:54, schrieb Barry Warsaw:

On Mar 25, 2011, at 09:51 AM, Andreas Röhler wrote:


while considering the request valid, even if the current
non-indent is an option,

what's the recommendable indent?

Would not choose the block-indent step, rather signal
it's something different at stake.

What about indenting it to the end of first element of
previous line?

;;;
(longer, sequence, of_items,
that, needs, to_be, wrapped) = input_list

packed_entry = (long, sequence, of_items,
 that, needs, to_be, wrapped)
;;


I must be missing something because these two snippets get indented like this
for me, running r405:

-snip snip-
(longer, sequence, of_items,
  that, needs, to_be, wrapped) = input_list

packed_entry = (long, sequence, of_items,
 that, needs, to_be, wrapped)
-snip snip-

which seems exactly right to me!



Noticed.

As different styles are possible, think we can deliver what has been 
requested for.





If you do introduce a variable to control this, please do retain the current
behavior as default.


Okay.

Would help having an appropriate name for these indents.

What about calling the first an `left-inbound indent' --default will be 
1--, the second `right-inbound-indent' --default will be (1+ column of 
opening parentesis)--





Cheers,
-Barry


___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] bug lp:328842, flexible-indentation of multiline assignements

2011-03-25 Thread Andreas Röhler

Am 25.03.2011 19:32, schrieb s...@pobox.com:

I find this indentation truly grating:

 self.last_abc_attr = self.last_xyz_attr = \
  self.last_abc_other = \
  self.last_xyz_other = None

Now, I can move self.last_xyz_attr to a continuation line, but though the
result is slightly different, it is, in my opinion, just as bad:

 self.last_abc_attr = \
self.last_xyz_attr = \
self.last_abc_other = \
self.last_xyz_other = None

What I would like to see is this (given a four-space block indent):

 self.last_abc_attr = \
 self.last_xyz_attr = \
 self.last_abc_other = \
 self.last_xyz_other = None

or, if the second expression remained on the first line:

 self.last_abc_attr = self.last_xyz_attr = \
 self.last_abc_other = \
 self.last_xyz_other = None

I don't care if this behavior is the default.  I just want to be able to
control it.  Currently, I have to manually format lines like this, and if
I'm not careful and reindent an entire function or file, then python-mode
undoes my work.

Skip



Hi Skip,

think that may be done.

As it's a different thing though than indenting inside tuples, lists etc.,
would you mind making a bug entry giving your last examples?

Andreas


___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] bug lp:328842, flexible-indentation of multiline assignements

2011-03-25 Thread Barry Warsaw
On Mar 25, 2011, at 08:58 PM, Andreas Röhler wrote:

 -snip snip-
 (longer, sequence, of_items,
   that, needs, to_be, wrapped) = input_list

 packed_entry = (long, sequence, of_items,
  that, needs, to_be, wrapped)
 -snip snip-

What about calling the first an `left-inbound indent' --default will be 1--,
the second `right-inbound-indent' --default will be (1+ column of opening
parentesis)--

Those names seem pretty good to me.  I would make both of them default to
column_of_first_nonwhitespace_after_paren.

E.g.

(  one, two, three,
   four, five, six  ) = things

and

(
 one,
 two,
 three) = things

Cheers,
-Barry


signature.asc
Description: PGP signature
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] bug lp:328842, flexible-indentation of multiline assignements

2011-03-25 Thread skip

Andreas As it's a different thing though than indenting inside tuples,
Andreas lists etc., would you mind making a bug entry giving your last
Andreas examples?

This bug is close enough:

https://bugs.launchpad.net/python-mode/+bug/629916

I just added a comment.

Skip
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode