From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ross Donaldson Newsgroups: gmane.emacs.bugs Subject: bug#28475: 25.3; python double-indents multi-line function argument blocks Date: Thu, 12 Oct 2017 14:11:49 -0700 Message-ID: References: <87tvzsmgep.fsf@users.sourceforge.net> <87ing8m4kb.fsf@users.sourceforge.net> <87fubcm1sb.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507842742 29341 195.159.176.226 (12 Oct 2017 21:12:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2017 21:12:22 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.3.1 Cc: Ross Donaldson , 28475@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 12 23:12:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2km0-0005wC-Pk for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Oct 2017 23:12:09 +0200 Original-Received: from localhost ([::1]:47260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2km6-0000eb-GA for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Oct 2017 17:12:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kly-0000eR-Jm for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 17:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2klu-0007xz-JS for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 17:12:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55969) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2klu-0007xu-FT for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 17:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e2klu-0004ly-9L for bug-gnu-emacs@gnu.org; Thu, 12 Oct 2017 17:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ross Donaldson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Oct 2017 21:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28475-submit@debbugs.gnu.org id=B28475.150784272018339 (code B ref 28475); Thu, 12 Oct 2017 21:12:02 +0000 Original-Received: (at 28475) by debbugs.gnu.org; 12 Oct 2017 21:12:00 +0000 Original-Received: from localhost ([127.0.0.1]:36417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2kls-0004lj-Fq for submit@debbugs.gnu.org; Thu, 12 Oct 2017 17:12:00 -0400 Original-Received: from mail-pf0-f171.google.com ([209.85.192.171]:44926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2klp-0004lU-9h for 28475@debbugs.gnu.org; Thu, 12 Oct 2017 17:11:58 -0400 Original-Received: by mail-pf0-f171.google.com with SMTP id x7so6678503pfa.1 for <28475@debbugs.gnu.org>; Thu, 12 Oct 2017 14:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=6y289CF3h8ahhvpxy1nSD4hncOBx4pSpsdRc4D/VND8=; b=q4l9iU2YFR8WdDkbbUDHNM80OUwnT1C/eIhALWqZArRt8ZmjExIXXP2FwzF3vn17Gu 8ybrwvL605hbzx2sseSBr926OdkkI80WGV5/wUWScJYO+SZC2y9NrfArAOohgXWVgY1+ 4ANAYbfrvDQ6Bk70NpsbHe9YDSITLZhQLWGBIjr12wLMaRClakqMgjtDs5alsp3/AUxO neWvRKCwvV9d+rOzTRJgFBdQlIrIh1yfihnAZErR6jBmfUaNkXvTsGgB5SoHxIUpxLtw fztG5Fu8ju8almTI7QPrqm+CgJaBJw3nEcKbsrm6kv96jeZYhg/6FwgLn4Ut+m6BGXeT xL+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=6y289CF3h8ahhvpxy1nSD4hncOBx4pSpsdRc4D/VND8=; b=PxfHhhqLK+LGWGaYUybHc8gGUXLvIyBWZDmEbln80lv5i6u0Y6yjCk+Sm9D3o+Fdh8 Yf3DslKzXCerCZ59roZ9zMvY+ptu1KFsGiXPtzpQLxq5cbBVaQozCD7lGVqor4OSzp0w e+mN94QrPIJHDZfTN80SIDJJjQdHZCYsWDaMkjMhL1Ed873vin/sEKnWHPMeL9bre95d GlRITOj9UDD+HZ5/QutL/Fl34us5rtZ7jPkAIM0uAQ1ZKA8+xPqMg/WE9cPbHVC3b1Rn MAS7p/zy00J0K4erhLbZemn38I4uDVgJlZNly8JDCkZXE7LyIo7h9/sw02d2cNtrYpoH ehTQ== X-Gm-Message-State: AMCzsaX3Z7LJ1LYxpvOimuTpGJvDd++72jUYYXQXPCL8qy1vRHLGO8+Y iQoq1mDZ3gSo2yaC8J+aOX+0JJ95 X-Google-Smtp-Source: AOwi7QA+Gi1fjfhvuVfAAQsaHE/ky47o3Fa5TcGZmebRi9fODqymLzUmsYggGL9LjnXGrVkEQT+syg== X-Received: by 10.159.244.18 with SMTP id x18mr1203193plr.117.1507842711223; Thu, 12 Oct 2017 14:11:51 -0700 (PDT) Original-Received: from becon.local (c-24-20-193-4.hsd1.or.comcast.net. [24.20.193.4]) by smtp.gmail.com with ESMTPSA id n12sm26379112pfb.149.2017.10.12.14.11.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Oct 2017 14:11:50 -0700 (PDT) Original-Received: by becon.local (Postfix, from userid 501) id 7FBFD16256E2; Thu, 12 Oct 2017 14:11:49 -0700 (PDT) In-reply-to: <87fubcm1sb.fsf@users.sourceforge.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138305 Archived-At: 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 writes: > >> From 83a622ec32a64ae30e68de18a84cc32fc6a811d9 Mon Sep 17 00:00:00 2001 >> From: Ross Donaldson >> 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.