From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gustaf Waldemarson Newsgroups: gmane.emacs.bugs Subject: bug#62696: python.el: Extra indentation for conditionals Date: Sun, 16 Apr 2023 17:49:26 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007a5cb205f976055c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3116"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62696@debbugs.gnu.org To: kobarity Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 16 17:50:15 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1po4dq-0000eq-UI for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Apr 2023 17:50:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1po4dg-0000fU-Fv; Sun, 16 Apr 2023 11:50:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1po4df-0000f4-1j for bug-gnu-emacs@gnu.org; Sun, 16 Apr 2023 11:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1po4de-0000Rh-Pm for bug-gnu-emacs@gnu.org; Sun, 16 Apr 2023 11:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1po4de-0000tt-AN for bug-gnu-emacs@gnu.org; Sun, 16 Apr 2023 11:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gustaf Waldemarson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Apr 2023 15:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62696 X-GNU-PR-Package: emacs Original-Received: via spool by 62696-submit@debbugs.gnu.org id=B62696.16816601853429 (code B ref 62696); Sun, 16 Apr 2023 15:50:02 +0000 Original-Received: (at 62696) by debbugs.gnu.org; 16 Apr 2023 15:49:45 +0000 Original-Received: from localhost ([127.0.0.1]:52362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1po4dM-0000tF-Tt for submit@debbugs.gnu.org; Sun, 16 Apr 2023 11:49:45 -0400 Original-Received: from mail-yb1-f176.google.com ([209.85.219.176]:34332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1po4dK-0000t0-OG for 62696@debbugs.gnu.org; Sun, 16 Apr 2023 11:49:43 -0400 Original-Received: by mail-yb1-f176.google.com with SMTP id r184so7472771ybc.1 for <62696@debbugs.gnu.org>; Sun, 16 Apr 2023 08:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681660177; x=1684252177; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3ciZQdeJo1Sub0+1yZus/ORWSPvVwldVw9m7EpuGF4w=; b=mCkVRfFtmxq7uNHs4iPF8QTevUmMvUWXy/UVLTKd0cop2ssOBzpHw7eXvtY5BdotXH bDjyEAdcGPZHNODotxfyJZrMlruhSkWAaS14aF6Dlfi3GXUgKNa8BtjrJLAoApNR0lZ3 pjnGevUdNxfGLLz41XoSIIS1X7RRPTyc4i/qemy2RHyncKLDfJNvGY6FVkF7/MmYbvSH 9bCiLVQ3WY6D/Gk0UikCIaKVoBS0DzbnV07LvkIcRuc3PzSo8+RluV4kLFq2Yo0P9CrW bjTqlvVXpYSOEy0wBkmrVInbhUZ5DZSOjCz1LsA1AeAIwmlFoctjiC+eYSdVaL4qaSUl q0rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681660177; x=1684252177; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3ciZQdeJo1Sub0+1yZus/ORWSPvVwldVw9m7EpuGF4w=; b=c0PCmAsCnjGsCWuxpZfcuCyAn6iR2uV5Z7w0kXBK8GsFz0t6+ULrMLK3VSOt8u1NNE J25cQI4isyU2QwrEJkrAyQgEuuzMFtAWEpMoK3WN9ojW03Dg/r18qYn3FkmGFUTVz1Hg TRUoRnnaBDxJAWHPNY4+Qf1mWDxHKhHdNGTGuz/mbLO5hac+QfNiPYgQdsv3gCa9CDHq Ub49cFjcnUYlbYG/E5CNlcziQxIwSE4nFSo5XLlHDpSIHVzE++AxsE23cTlOwS9jWepq OJ5QK51ER9/36oh1Br8UbdCBgpNdjQRDt6vRDwcpufCXYjF+WhVaMglD0yv+WZFTlo7q o1ng== X-Gm-Message-State: AAQBX9f3vIupw30zyU1dsjnIlH1NfDjooKJA60BoogzwuLPj69uD43oh 1StBD55du87Tz4JeUHD8VT9zF1GbI4L4DRKHaVc= X-Google-Smtp-Source: AKy350Z0tmBzPuIbdhQw2BUw7u72FhadBaqCELhh4MuZFWalvoQ1r3/a4mhmXU04HBXF6mld1oyBx8JGNPuwXa+ikpY= X-Received: by 2002:a25:d40f:0:b0:b8c:ad5:6b4e with SMTP id m15-20020a25d40f000000b00b8c0ad56b4emr7774238ybf.12.1681660176914; Sun, 16 Apr 2023 08:49:36 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260138 Archived-At: --0000000000007a5cb205f976055c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, I think that's a really good idea actually. It might also be a good idea to add a negative example (i.e., the black-indentation style you mentioned earlier), or a reference to one (maybe to the tests?) Best regards, Gustaf Den s=C3=B6n 16 apr. 2023 kl 15:24 skrev kobarity : > > kobarity wrote: > > Gustaf Waldemarson wrote: > > > "Increase indentation inside parens of a block. > > > When this variable is set to non-nil and the contents of a block > > > inside parens are indented to the same level as outside the same > > > block, increase the indentation of the line." > > > > Thank you for your suggestion. I think this is more readable and > > would like to make changes in this direction. > > I have concluded that it's better to include an example in the > docstring of `python-indent-block-paren-deeper'. How about the > following? I also attached the updated patch. > > "Increase indentation inside parens of a block. > If non-nil, increase the indentation of the lines inside parens > in a header of a block when they are indented to the same level > as the body of the block: > > if (some_expression > and another_expression): > do_something() > > instead of: > > if (some_expression > and another_expression): > do_something() > > This variable only works if the opening paren is followed by > non-whitespace characters on the same line. Modify > `python-indent-def-block-scale' to customize the case where > non-whitespace character does not follow the opening paren on the > same line." > > Best regards, > kobarity > --0000000000007a5cb205f976055c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I think that's a = really good idea actually. It might also be a good idea to add a
<= div>negative example (i.e., the black-indentation style you mentioned earli= er), or
a reference to one (maybe to the tests?)
Best regards,
Gustaf

Den s=C3=B6n 16 apr.= 2023 kl 15:24 skrev kobarity <kob= arity@gmail.com>:

kobarity wrote:
> Gustaf Waldemarson wrote:
> > "Increase indentation inside parens of a block.
> > When this variable is set to non-nil and the contents of a block<= br> > > inside parens are indented to the same level as outside the same<= br> > > block, increase the indentation of the line."
>
> Thank you for your suggestion.=C2=A0 I think this is more readable and=
> would like to make changes in this direction.

I have concluded that it's better to include an example in the
docstring of `python-indent-block-paren-deeper'.=C2=A0 How about the following?=C2=A0 I also attached the updated patch.

"Increase indentation inside parens of a block.
If non-nil, increase the indentation of the lines inside parens
in a header of a block when they are indented to the same level
as the body of the block:

=C2=A0 =C2=A0 if (some_expression
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 and another_expression):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 do_something()

instead of:

=C2=A0 =C2=A0 if (some_expression
=C2=A0 =C2=A0 =C2=A0 =C2=A0 and another_expression):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 do_something()

This variable only works if the opening paren is followed by
non-whitespace characters on the same line.=C2=A0 Modify
`python-indent-def-block-scale' to customize the case where
non-whitespace character does not follow the opening paren on the
same line."

Best regards,
kobarity
--0000000000007a5cb205f976055c--