From: Ross Donaldson <gastove@gmail.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: Ross Donaldson <gastove@gmail.com>, 28475@debbugs.gnu.org
Subject: bug#28475: 25.3; python double-indents multi-line function argument blocks
Date: Thu, 12 Oct 2017 14:11:49 -0700 [thread overview]
Message-ID: <m2tvz4ul4a.fsf@gmail.com> (raw)
In-Reply-To: <87fubcm1sb.fsf@users.sourceforge.net>
ARG -- apologies! I somehow missed this as it came in. Thank you very much for the feedback; I'll make those changes and submit a new patch soon.
Noam Postavsky writes:
> Ross Donaldson <gastove@gmail.com> writes:
>
>> From 83a622ec32a64ae30e68de18a84cc32fc6a811d9 Mon Sep 17 00:00:00 2001
>> From: Ross Donaldson <gastove@gmail.com>
>> Date: Sun, 24 Sep 2017 09:42:23 -0700
>> Subject: [PATCH] Rather than scaling certain python blocks by a
>> constant, scale by a defcustom
>>
>> This provides customization of the number of indent levels in
>> multi-line `def` blocks in python; it also corrects a nearby (but
>> unrelated) incorrect symbol quote.
>
> You're missing the ChangeLog style entry here, see CONTRIBUTE under
> "Commit messages" for details. Also, an imperative style usually reads
> more concisely ("Provide customization..." rather than "This
> provides...").
>
> I think a NEWS entry would be appropriate as well.
>
>> - :safe' booleanp)
>> + :safe 'booleanp)
>
> It's better not to mix up your change with unrelated whitespace fixes.
>
>> (defcustom python-indent-trigger-commands
>> '(indent-for-tab-command yas-expand yas/expand)
>> @@ -746,6 +746,12 @@ It makes underscores and dots word constituent chars.")
>> :type '(repeat symbol)
>> :group 'python)
>>
>> +(defcustom python-indent-def-block-scale 2
>> + "Multiplier applied to indentation inside multi-line def blocks."
>> + :version "26.0"
>
> This should rather be "26.1", as released Emacs versions always end in ".1".
>
>> + :type 'integer
>> + :safe (lambda (i) (and (integerp i) (< 0 i))))
>
> I would probably go with 'natnump here. This does also allow 0 which is
> probably not generally wanted, but still "safe", I think.
>
>> (`(,(or :inside-paren-newline-start-from-block) . ,start)
>> - ;; Add two indentation levels to make the suite stand out.
>> (goto-char start)
>> - (+ (current-indentation) (* python-indent-offset 2)))))))
>> + (+ (current-indentation) (* python-indent-offset python-indent-def-block-scale)))))))
>
> A line break here would keep the line to within a reasonable width
> (generally we try to stay in 80 columns).
>
> Thanks for working on this.
next prev parent reply other threads:[~2017-10-12 21:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-16 18:42 bug#28475: 25.3; python double-indents multi-line function argument blocks Ross Donaldson
2017-09-24 12:26 ` Noam Postavsky
2017-09-24 16:25 ` Ross Donaldson
2017-09-24 16:42 ` Noam Postavsky
2017-09-24 17:02 ` Ross Donaldson
2017-09-24 17:42 ` Noam Postavsky
2017-10-12 21:11 ` Ross Donaldson [this message]
2017-11-07 1:10 ` Noam Postavsky
2017-12-25 20:54 ` Ross Donaldson
2018-01-01 16:17 ` Noam Postavsky
2018-01-02 17:55 ` Ross Donaldson
2017-09-26 0:50 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2tvz4ul4a.fsf@gmail.com \
--to=gastove@gmail.com \
--cc=28475@debbugs.gnu.org \
--cc=npostavs@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.