GNU bug report logs - #36884
Default python mode with electric-indent-mode sometimes indents empty lines

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Jarosław Rzeszótko <jrzeszotko@HIDDEN>; dated Thu, 1 Aug 2019 07:07:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 36884 <at> debbugs.gnu.org:


Received: (at 36884) by debbugs.gnu.org; 1 Aug 2019 08:52:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 01 04:52:11 2019
Received: from localhost ([127.0.0.1]:53455 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ht6ok-0000L0-NR
	for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 04:52:11 -0400
Received: from mail-io1-f67.google.com ([209.85.166.67]:36634)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jrzeszotko@HIDDEN>) id 1ht6oi-0000Kl-I9
 for 36884 <at> debbugs.gnu.org; Thu, 01 Aug 2019 04:52:09 -0400
Received: by mail-io1-f67.google.com with SMTP id o9so39013582iom.3
 for <36884 <at> debbugs.gnu.org>; Thu, 01 Aug 2019 01:52:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=x9TL7o7WxjefsfpCBeZfnzmLi2ftmm9lnNlAbL1A5rU=;
 b=uJ8+F1UWuRZ/g0jejPO3t6fIc9oHKPJuvO89FZegv2ipICQr/HdtTxm6HYMb5veZZ3
 cqiyFd+qxB3VrBW73/MbybfYsR7tTHtIVMXqXHXByonY26XxyX89F6ZO8ayz3WPaozE8
 4jvIVeW5Yf6Mo1s6UCTpMKqxgM2DvM8kdL3ymcAx8Vp8WgiLjdHT+TA0D/wxUaL+VSIA
 YyP/U1mPR5yHo269Hz6BDetwHnhWWHBbL3UvCuVbcjFBEdxKebI80t+p1+BKtQJG6Kuy
 shV+eC3KTjK4VDVAz+qpyVNqPB6jWlVjXsxVYDUc+G0wvO4w91HJ5NLoSF/8x9WinlU8
 wCfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=x9TL7o7WxjefsfpCBeZfnzmLi2ftmm9lnNlAbL1A5rU=;
 b=ZXr10FkL0No1GCw4oogop+nk/L6HTCpXZRU57C+4tIhiVIZlsbBnaZL15gO6nGtVNz
 JA/GzDo0Zf9O534L0NyG0EKod5tsclXJfvH6O0GB9X7brIxAR4edmrUCFGI/q1DgplIU
 T6wccYaboNLxvrq6cg6ZLsqSqbmS/cTjE0XzYGwQeWKExhoMyWn2QFr8Io3JOWcrUddG
 pnscEEiiVo1tonpZF6YizD8eVQyD67kQ2DfrBfxM4WjAzoAbKdeD9r7KQ8Hjv4e7O+e1
 fOLnnubZEdHS3cxuKwnYPxSSwjKuiTQTjnpN/I9HsGk4Y9D+yDXNi9LiK001N7tLPyuU
 SFnw==
X-Gm-Message-State: APjAAAXW3/C2fNEATOVvsXt3uC0dWVfwz40Xj7HNeAYs/uENLh7ypwoF
 FLHkZ35PD9FopdTUPzKt+a7XqZ4djjPZuViFtYp7zfXO
X-Google-Smtp-Source: APXvYqxsCzPxtZTSD4M6uOGMdNffu/irzi4bY9U2VotOWq9IjclXkx81fwHvTrWykufannqMHo+yeOGqGeTMM5f+7TY=
X-Received: by 2002:a02:c549:: with SMTP id g9mr12706872jaj.14.1564649522637; 
 Thu, 01 Aug 2019 01:52:02 -0700 (PDT)
MIME-Version: 1.0
References: <CAO_X8WByiRv9TQWC0vWRROeVdjV+LQu-F4PmSu+B4rdppW-=vg@HIDDEN>
 <88e5aea8-cee3-993c-8b8e-b7651f48459d@HIDDEN>
In-Reply-To: <88e5aea8-cee3-993c-8b8e-b7651f48459d@HIDDEN>
From: =?UTF-8?B?SmFyb3PFgmF3IFJ6ZXN6w7N0a28=?= <jrzeszotko@HIDDEN>
Date: Thu, 1 Aug 2019 10:51:51 +0200
Message-ID: <CAO_X8WBEe+sJdy9i1UhDZJXEgrCOed4A31cjtL1yx1ArqROpQg@HIDDEN>
Subject: Re: bug#36884: Default python mode with electric-indent-mode
 sometimes indents empty lines
To: =?UTF-8?Q?Andreas_R=C3=B6hler?= <andreas.roehler@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000feb1b3058f0a5ae2"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36884
Cc: 36884 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000feb1b3058f0a5ae2
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

M-x about-emacs shows:
GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4) of
2019-02-03, modified by Debian

C-h k [RET] shows that it is bound to the "newline" function. I get the
same behavior with --no-init.

Cheers,
Jarek

On Thu, Aug 1, 2019 at 9:55 AM Andreas R=C3=B6hler <andreas.roehler@easy-em=
acs.de>
wrote:

>
> On 01.08.19 09:06, Jaros=C5=82aw Rzesz=C3=B3tko wrote:
> > When pressing enter with the cursor like this:
> >
> > def test():
> >     print("test")
> > [cursor]
> >
> > Emacs (26.1) correctly just inserts a blank line. However, with this:
> >
> > def test():
> >     if True:
> >           print("test")
> > [cursor]
> >
> > Emacs inserts a blank line and indents it one level. With this:
> >
> > def test():
> >     if True:
> >         if False:
> >               print("test")
> > [cursor]
> >
> > it inserts a blank line and indents it two levels, etc. Moreover, with
> > two methods like this:
> >
> > def test1():
> >     if True:
> >           print("test")
> >
> > [cursor]def test2():
> >     if True:
> >           print("test")
> >
> > pressing enter will also indent the def block, instead of just
> > inserting the empty line.
>
>
> Hi Jaros=C5=82aw,
>
> python-mode.el developer here, just being interested.
>
> AFAIU electric-indent-mode doesn't run a timer, cursor position alone
> would not trigger it.
>
> Assume there is a command used from pos. Which? BTW the key alone
> doesn't tell enough, as RET and C-j changed binding recently. Reporting
> Emacs version will be useful.
>
> Thanks,
>
> Andreas
>
>
>
>
>

--000000000000feb1b3058f0a5ae2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">M-x about-emacs shows:<div>GNU Emacs 26.1 (build 2, x86_64=
-pc-linux-gnu, GTK+ Version 3.24.4)=C2=A0of 2019-02-03, modified by Debian<=
br></div><div><br></div><div>C-h k [RET] shows that it is bound to the &quo=
t;newline&quot; function. I get the same behavior with --no-init.</div><div=
><br></div><div>Cheers,</div><div>Jarek</div></div><br><div class=3D"gmail_=
quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Aug 1, 2019 at 9:55 AM=
 Andreas R=C3=B6hler &lt;<a href=3D"mailto:andreas.roehler@HIDDEN">a=
ndreas.roehler@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex"><br>
On 01.08.19 09:06, Jaros=C5=82aw Rzesz=C3=B3tko wrote:<br>
&gt; When pressing enter with the cursor like this:<br>
&gt;<br>
&gt; def test():<br>
&gt; =C2=A0 =C2=A0 print(&quot;test&quot;)<br>
&gt; [cursor]<br>
&gt;<br>
&gt; Emacs (26.1) correctly just inserts a blank line. However, with this:<=
br>
&gt;<br>
&gt; def test():<br>
&gt; =C2=A0 =C2=A0 if True:<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print(&quot;test&quot;)<br>
&gt; [cursor]<br>
&gt;<br>
&gt; Emacs inserts a blank line and indents it one level. With this:<br>
&gt;<br>
&gt; def test():<br>
&gt; =C2=A0 =C2=A0 if True:<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 if False:<br>
&gt; =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print(&quot;test=
&quot;)<br>
&gt; [cursor]<br>
&gt;<br>
&gt; it inserts a blank line and indents it two levels, etc. Moreover, with=
 <br>
&gt; two methods like this:<br>
&gt;<br>
&gt; def test1():<br>
&gt; =C2=A0 =C2=A0 if True:<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print(&quot;test&quot;)<br>
&gt;<br>
&gt; [cursor]def test2():<br>
&gt; =C2=A0 =C2=A0 if True:<br>
&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print(&quot;test&quot;)<br>
&gt;<br>
&gt; pressing enter will also indent the def block, instead of just <br>
&gt; inserting the empty line.<br>
<br>
<br>
Hi Jaros=C5=82aw,<br>
<br>
python-mode.el developer here, just being interested.<br>
<br>
AFAIU electric-indent-mode doesn&#39;t run a timer, cursor position alone <=
br>
would not trigger it.<br>
<br>
Assume there is a command used from pos. Which? BTW the key alone <br>
doesn&#39;t tell enough, as RET and C-j changed binding recently. Reporting=
 <br>
Emacs version will be useful.<br>
<br>
Thanks,<br>
<br>
Andreas<br>
<br>
<br>
<br>
<br>
</blockquote></div>

--000000000000feb1b3058f0a5ae2--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36884; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Aug 2019 07:54:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 01 03:54:45 2019
Received: from localhost ([127.0.0.1]:53419 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ht5vB-0007QH-H5
	for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 03:54:45 -0400
Received: from lists.gnu.org ([209.51.188.17]:45843)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andreas.roehler@HIDDEN>) id 1ht5v8-0007Q8-W7
 for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 03:54:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45947)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <andreas.roehler@HIDDEN>) id 1ht5v7-0005hp-VS
 for bug-gnu-emacs@HIDDEN; Thu, 01 Aug 2019 03:54:42 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1ht5v7-0007ms-22
 for bug-gnu-emacs@HIDDEN; Thu, 01 Aug 2019 03:54:41 -0400
Received: from mout.kundenserver.de ([212.227.126.134]:50233)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <andreas.roehler@HIDDEN>)
 id 1ht5v6-0007m5-Pl
 for bug-gnu-emacs@HIDDEN; Thu, 01 Aug 2019 03:54:41 -0400
Received: from [192.168.178.39] ([87.123.193.228]) by mrelayeu.kundenserver.de
 (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id
 1M2Plu-1hvq0T0nok-003vzA for <bug-gnu-emacs@HIDDEN>; Thu, 01 Aug 2019
 09:54:35 +0200
Subject: Re: bug#36884: Default python mode with electric-indent-mode
 sometimes indents empty lines
To: bug-gnu-emacs@HIDDEN
References: <CAO_X8WByiRv9TQWC0vWRROeVdjV+LQu-F4PmSu+B4rdppW-=vg@HIDDEN>
From: =?UTF-8?Q?Andreas_R=c3=b6hler?= <andreas.roehler@HIDDEN>
Message-ID: <88e5aea8-cee3-993c-8b8e-b7651f48459d@HIDDEN>
Date: Thu, 1 Aug 2019 09:56:53 +0200
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101
 Thunderbird/60.7.2
MIME-Version: 1.0
In-Reply-To: <CAO_X8WByiRv9TQWC0vWRROeVdjV+LQu-F4PmSu+B4rdppW-=vg@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
X-Provags-ID: V03:K1:zYBVpz+E39sOz+ZJ0jTcuIZCB9/VHa7fTWXQFNWv94r8UPLeyHd
 SwnFI8xDR2dVuh+KAVaQl5QbSLNPtY+Uw/unoTmiiLi7DenctwTzECi/TEVxYYDwCFs1X74
 ZtErVEFBMRmEDRsrdxK84OHzmCuDqe8ANJo3Gj1M9kQRyHKUsvb7Eugrj/0DVpPXikmp1xo
 b3YzPr0xxchCKg4s8w1cA==
X-UI-Out-Filterresults: notjunk:1;V03:K0:xmQgzFpXyeQ=:3zW5mNpsScYo2FSt4VPgEw
 Xp+9dEAWkB2Hxy0vLesYVp71rneZQ0HdF63+73nYuM/JQGM/UF3Bu5wrtv3By7g2ayjmKMxnn
 lyYegizKHF+KpDnQjhhKw1/8pC1SvCyP1ZyCcCKjVWQJTLKV1pQ9Jx0oIYfwOW+gUWwaucrgy
 rnPQTVA+xeXhaEm3oybn5zZ0Ax3eoS4KLzn05L3QH5NMXunoj2My0Qj91eiSkysYdA20xSGdF
 CjOqdVPjTY5suY1/rEAJTgFRPk3gULtbfKpqpIHyNhPcC5Lfs6Gd2mfPVWXIquyRXEz77SGjG
 gOIixYkEbh5gKeuhwFokuPF9gNGUtd2j2B+pgKMFXJVvnkY0OTAqhR92egDRskEQkHkbDSa/+
 ltkTqyFL+Jj4HGYmY5mPHSYDecUpixQ8T1d52tDQkFFeHx+lngDGB9epTJY0lUsfBaisEPgNx
 aQFRGWbvngAt2TdZgnXEcVx4zGtxqUGyBV1jsbJlJiO97vw823ZH9MccMtswHtlRt9TCmpgmm
 8rKRI904xAVx/CctfABJtlFcJ/JL34lKiPzVY6GHeN1vSKPnVVEpyjc9xCx9BjxeVG6SmIJ+b
 5I3uCGszKuP+wck4Mgf5qD3WSFEbxBE7uzwkkdlBT3ctp1Boipxtb78kNHF7ZZAMVbRVuzeVm
 JEgteeAv4lRd6XUbRpmAg7xWr/XdQqfRpee1OXITV2629igW06QJxzp3a1DN4DpqQN/03U3sk
 zUkMTxPE2T2Jg6RXWUi99mZJV5OICYc9D2jhfeoRe9pwybRyiiAMSpNC/XxxKF33nyUPuKF8W
 RSnQK2W
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.126.134
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


On 01.08.19 09:06, Jarosław Rzeszótko wrote:
> When pressing enter with the cursor like this:
>
> def test():
>     print("test")
> [cursor]
>
> Emacs (26.1) correctly just inserts a blank line. However, with this:
>
> def test():
>     if True:
>           print("test")
> [cursor]
>
> Emacs inserts a blank line and indents it one level. With this:
>
> def test():
>     if True:
>         if False:
>               print("test")
> [cursor]
>
> it inserts a blank line and indents it two levels, etc. Moreover, with 
> two methods like this:
>
> def test1():
>     if True:
>           print("test")
>
> [cursor]def test2():
>     if True:
>           print("test")
>
> pressing enter will also indent the def block, instead of just 
> inserting the empty line.


Hi Jarosław,

python-mode.el developer here, just being interested.

AFAIU electric-indent-mode doesn't run a timer, cursor position alone 
would not trigger it.

Assume there is a command used from pos. Which? BTW the key alone 
doesn't tell enough, as RET and C-j changed binding recently. Reporting 
Emacs version will be useful.

Thanks,

Andreas





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#36884; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Aug 2019 07:06:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 01 03:06:46 2019
Received: from localhost ([127.0.0.1]:53405 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ht5Aj-0006L4-Ln
	for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 03:06:45 -0400
Received: from lists.gnu.org ([209.51.188.17]:42751)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jrzeszotko@HIDDEN>) id 1ht5Ah-0006Kx-Hb
 for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 03:06:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:37390)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <jrzeszotko@HIDDEN>) id 1ht5Ag-0006Q1-Gt
 for bug-gnu-emacs@HIDDEN; Thu, 01 Aug 2019 03:06:43 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 FROM_EXCESS_BASE64,HTML_MESSAGE autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jrzeszotko@HIDDEN>) id 1ht5Af-0000uO-Ib
 for bug-gnu-emacs@HIDDEN; Thu, 01 Aug 2019 03:06:42 -0400
Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:43932)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <jrzeszotko@HIDDEN>)
 id 1ht5Af-0000tn-Dw
 for bug-gnu-emacs@HIDDEN; Thu, 01 Aug 2019 03:06:41 -0400
Received: by mail-io1-xd33.google.com with SMTP id k20so142026442ios.10
 for <bug-gnu-emacs@HIDDEN>; Thu, 01 Aug 2019 00:06:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=YgNVegd/OWoNW9rSHevUe1jcA4cYcc/b1+u6m3KyW78=;
 b=bePww8yt0Q8MEZIXW9QSaifKLc2aRS32JYY0UrmwqZfGSt4M3IRobVoQZhMFy6RTmR
 lxJ+MmP4UzN2EleflVi6fRxypjURP3JlkDT/Q8g0dvJrNih5hnzqT/fKZm6ip7d0kUVF
 0sAZKQ568oM5+rUGpDxteMExyiSf7woXChncnqjuIkMxK7iGp760UpR37jIWmFXiNgR8
 p9y3r9KdWRAoPplMhu3fjra7DebMMTCcQD063g22HLE9Fbc+o77ptBxIBm7ypLs7PFwp
 LU453BpYmHrLPWd3Tyl20lBTlYoPI4LKt2ioaqGzpafma1vqchbXxnzi5l5g93Y49rht
 gKOQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=YgNVegd/OWoNW9rSHevUe1jcA4cYcc/b1+u6m3KyW78=;
 b=QW4ZOfzA2CO3MFywlZZFpq4X6ynoF3IW1MCvvkumpHn43eFTbJipN1HklGop4lPKYL
 FOql0AJ6oDOBVbwxPEBI/eL5ZwaJmPRYZoxf9oRopsLtRpMgP0T3iQK0BsqyCQAR296q
 oPk0UOZtqCEoRcSgVNhXOa1wCj++9S4EE3C/bW0yHnDNQZ8wvQa2+0DH31KrDH9O7VVI
 /vht0eLiL0hW4irKILIfQEwNssIhNAR91J2j8ceqcpr2IPnduHlOgcceu/VkZ1XHSnt/
 lLloBef3qD0Vq7b/pF7jmhI2AFOKNzWVjfFMX414zaHmtOZyVhsgfn1/IfYuLx5zC/HH
 Qh2g==
X-Gm-Message-State: APjAAAWH/9yX6KrQ3Kz3aMSe1Svut3AbhTYoPjS2oAWQFV2Zx3396c2E
 lUi2Py4+1ZWbUgPv2pKCVnmcDyM+oi8uFlohBScLaCw1
X-Google-Smtp-Source: APXvYqxqbZvX8L4IfZ4XNdGNAuvTuGBPSMXUg9VgtnK+fn1iRGWlnGJck/0mcLORAeVcx4h/DbKjzjckmHex81kA514=
X-Received: by 2002:a6b:f216:: with SMTP id q22mr76327921ioh.65.1564643199977; 
 Thu, 01 Aug 2019 00:06:39 -0700 (PDT)
MIME-Version: 1.0
From: =?UTF-8?B?SmFyb3PFgmF3IFJ6ZXN6w7N0a28=?= <jrzeszotko@HIDDEN>
Date: Thu, 1 Aug 2019 09:06:29 +0200
Message-ID: <CAO_X8WByiRv9TQWC0vWRROeVdjV+LQu-F4PmSu+B4rdppW-=vg@HIDDEN>
Subject: Default python mode with electric-indent-mode sometimes indents empty
 lines
To: "bug-gnu-emacs@HIDDEN" <bug-gnu-emacs@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000228e00058f08e2a1"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::d33
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--000000000000228e00058f08e2a1
Content-Type: text/plain; charset="UTF-8"

When pressing enter with the cursor like this:

def test():
    print("test")
[cursor]

Emacs (26.1) correctly just inserts a blank line. However, with this:

def test():
    if True:
          print("test")
[cursor]

Emacs inserts a blank line and indents it one level. With this:

def test():
    if True:
        if False:
              print("test")
[cursor]

it inserts a blank line and indents it two levels, etc. Moreover, with two
methods like this:

def test1():
    if True:
          print("test")

[cursor]def test2():
    if True:
          print("test")

pressing enter will also indent the def block, instead of just inserting
the empty line.

--000000000000228e00058f08e2a1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">When pressing enter with the cursor like this:<div><br></d=
iv><div>def test():</div><div>=C2=A0 =C2=A0 print(&quot;test&quot;)</div><d=
iv>[cursor]</div><div><br></div><div>Emacs (26.1) correctly just inserts a =
blank line. However, with this:</div><div><br></div><div><div>def test():</=
div><div>=C2=A0 =C2=A0 if True:</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 print(&quot;test&quot;)</div><div>[cursor]</div><div><br></div></div><d=
iv>Emacs inserts a blank line and indents it one level. With this:</div><di=
v><br></div><div><div>def test():</div><div>=C2=A0 =C2=A0 if True:</div><di=
v>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if False:<br></div><div>=C2=A0 =C2=A0=C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print(&quot;test&quot;)</div><div>[curso=
r]</div></div><div><br></div><div>it inserts a blank line and indents it tw=
o levels, etc. Moreover, with two methods like this:</div><div><br></div><d=
iv><div>def test1():</div><div>=C2=A0 =C2=A0 if True:</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 print(&quot;test&quot;)</div><div><br></div><div>[=
cursor]def test2():</div><div>=C2=A0 =C2=A0 if True:</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 print(&quot;test&quot;)</div></div><div><br></div>=
<div>pressing enter will also indent the def block, instead of just inserti=
ng the empty line.=C2=A0</div></div>

--000000000000228e00058f08e2a1--




Acknowledgement sent to Jarosław Rzeszótko <jrzeszotko@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#36884; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 1 Aug 2019 09:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.