all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jarosław Rzeszótko" <jrzeszotko@gmail.com>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
Cc: 36884@debbugs.gnu.org
Subject: bug#36884: Default python mode with electric-indent-mode sometimes indents empty lines
Date: Thu, 1 Aug 2019 10:51:51 +0200	[thread overview]
Message-ID: <CAO_X8WBEe+sJdy9i1UhDZJXEgrCOed4A31cjtL1yx1ArqROpQg@mail.gmail.com> (raw)
In-Reply-To: <88e5aea8-cee3-993c-8b8e-b7651f48459d@easy-emacs.de>

[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]

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@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
>
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 2304 bytes --]

  reply	other threads:[~2019-08-01  8:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01  7:06 bug#36884: Default python mode with electric-indent-mode sometimes indents empty lines Jarosław Rzeszótko
2019-08-01  7:56 ` Andreas Röhler
2019-08-01  8:51   ` Jarosław Rzeszótko [this message]
2019-08-02  1:25   ` Noam Postavsky
2019-08-02  5:08     ` Jarosław Rzeszótko
2019-08-02 10:39       ` Andreas Röhler
2019-08-02 14:55         ` Jarosław Rzeszótko

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

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

  git send-email \
    --in-reply-to=CAO_X8WBEe+sJdy9i1UhDZJXEgrCOed4A31cjtL1yx1ArqROpQg@mail.gmail.com \
    --to=jrzeszotko@gmail.com \
    --cc=36884@debbugs.gnu.org \
    --cc=andreas.roehler@easy-emacs.de \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.