Re: [Python-mode] bug lp:328842, flexible-indentation of multiline assignements
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
Re: [Python-mode] bug lp:328842, flexible-indentation of multiline assignements
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
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
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] highlight-indentation
Am 25.03.2011 16:08, schrieb Barry Warsaw: Hi Andreas, I don't disagree with anything you wrote, and of course we're allowed to use anything GPL'd. I don't think even politeness mandates pre-approval in order to *use* GPL code. The "let's be nice" comment wasn't directed at you personally, or really anybody here - I think we're all being nice, helpful, and polite, which to me is one of the most important principles of FLOSS. :) It also wasn't a comment on our use of GPL code. It was related to our bringing in a copy of someone else's file, which is already under their own VCS, into our VCS. Doing so could give the impression that we're the authoritative copy of the file. I wouldn't want to usurp someone else's authority on that without their approval. I hope that makes sense. Me too :-) Somehow the VCS seems at stake now. Okay, let's go on. Thanks and sorry should I have provoked too much writing. Let's go into another turn. Andreas Cheers, -Barry ___ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode
Re: [Python-mode] highlight-indentation
I agree wholeheartedly with Barry's previous message on the indentation topic. Let me provide you with an analogy from a totally different realm. If I take the dog out in the evening for a bathroom walk, I doubt that I really need to tell my wife. After all, it's part of my nightly routine to walk Lily before coming up to bed. There is no signed contract which dictates that I tell her I'm walking the dog. If Ellen happens to come downstairs she will notice the absence of me, the dog and the leash, and not jump to the conclusion that a neighbor has snuck in to walk the dog while I've flown off to the Caribbean with some floozy (or gone "hiking in the Appalachians" as a certain former politician from South Carolina did). Still, as I head out the door, I let her know that Lily and I will be back in a few minutes. It's just the nice thing to do. 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
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] highlight-indentation
Hi Andreas, I don't disagree with anything you wrote, and of course we're allowed to use anything GPL'd. I don't think even politeness mandates pre-approval in order to *use* GPL code. The "let's be nice" comment wasn't directed at you personally, or really anybody here - I think we're all being nice, helpful, and polite, which to me is one of the most important principles of FLOSS. :) It also wasn't a comment on our use of GPL code. It was related to our bringing in a copy of someone else's file, which is already under their own VCS, into our VCS. Doing so could give the impression that we're the authoritative copy of the file. I wouldn't want to usurp someone else's authority on that without their approval. I hope that makes sense. 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
Am 25.03.2011 14:35, schrieb Andreas Röhler: Am 25.03.2011 14:07, schrieb s...@pobox.com: 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 Hi Skip, I'll introduce a defcustom for that just set `py-multiline-indent-to-first-element' Sorry, that's my mistake. Thats will be boolean, as it's name says. When indenting to common indent-offset, use the defcustom than created for that purpose. `py-multiline-indent-to-first-element' must be nil than, as the indent of the first element shouldn't matter. 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
Am 25.03.2011 14:07, schrieb s...@pobox.com: 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 Hi Skip, I'll introduce a defcustom for that just set `py-multiline-indent-to-first-element' --or however it will be called finally-- onto the value you prefer. Default will be 2 probably, just my taste, but that may change. :-) 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
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] highlight-indentation
Am 14.03.2011 17:49, schrieb Barry Warsaw: @pycon so just a quick reply... On Mar 12, 2011, at 01:44 PM, Andreas Röhler wrote: As for the approval: thought that's precisely what the GPL is for. Well, the GPL makes it *legal*, but approval keeps us nice. :) -B Hi Barry, makes me some headache, will see if I'm able to explain the --in the precise case purely abstract-- reasons: First at the GPL: its often blamed and disputed and has some quirks. But seen from the world outside it provides indeed some miraculous, which you may call freedom. BTW I'm not going to relate it to other licences providing free software, just the phenomen Emacs and GPL at stake here. GPL just works, it provides permissions to use, change, distribute etc. Lets further assume any person publishing code under GPL knows what it's doing. If not, we should not try to fix that by extra personal permissions handed over, but by teaching the meaning of the GPL. OTOH if someone is going to state obvious things, these statements change its meaning. Same when asking questions already answered. The danger here is raising wrong expectations. If you ask for a use, did you ask for a permission to change too? What, if the author later changes it's mind? Will you pull the code than out again? See diskussions lately around python.el, what kind of difficulties may arise, when confidence in GPL should not be enough. Nonetheless always trying to be as polite as my habits permit... :-) Cheers Andreas -- https://code.launchpad.net/~a-roehler/python-mode/python-mode-components https://code.launchpad.net/s-x-emacs-werkstatt/ ___ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode
[Python-mode] bug lp:328842, flexible-indentation of multiline assignements
Hi Barry, hi all, 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) ;; Would introduce two boolean variables py-multiline-assignement-first-column: "If a multiline-assignement element in first-column should be indented" py-multiline-indent-to-first-element: "If a multiline-assignement in first-column should be indented to the end of it's first element. " Also: (defcustom py-indent-in-delimiter 1 "When inside a multiline-assignement: How many colums indent should be more than opening bracket, brace or parenthesis. " :type 'integer :group 'python) (make-variable-buffer-local 'py-indent-in-delimiter) Cheers ___ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode