unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Ross Donaldson <gastove@gmail.com>
Cc: 28475@debbugs.gnu.org
Subject: bug#28475: 25.3; python double-indents multi-line function argument blocks
Date: Sun, 24 Sep 2017 13:42:12 -0400	[thread overview]
Message-ID: <87fubcm1sb.fsf@users.sourceforge.net> (raw)
In-Reply-To: <CAC+S337NyyEYJF6VT9j8Bw7J0GzVVwvNatMv6-MJLbSgQre9Ww@mail.gmail.com> (Ross Donaldson's message of "Sun, 24 Sep 2017 17:02:05 +0000")

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.





  reply	other threads:[~2017-09-24 17:42 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 [this message]
2017-10-12 21:11           ` Ross Donaldson
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fubcm1sb.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=28475@debbugs.gnu.org \
    --cc=gastove@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).