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

Previous Next

Package: emacs;

Reported by: Jarosław Rzeszótko <jrzeszotko <at> gmail.com>

Date: Thu, 1 Aug 2019 07:07:01 UTC

Severity: normal

Full log


Message #11 received at 36884 <at> debbugs.gnu.org (full text, mbox):

From: Jarosław Rzeszótko <jrzeszotko <at> gmail.com>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 36884 <at> debbugs.gnu.org
Subject: Re: bug#36884: Default python mode with electric-indent-mode
 sometimes indents empty lines
Date: Thu, 1 Aug 2019 10:51:51 +0200
[Message part 1 (text/plain, inline)]
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öhler <andreas.roehler <at> easy-emacs.de>
wrote:

>
> 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
>
>
>
>
>
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 324 days ago.

Previous Next


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