unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Rumpf <prumpf@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 17449@debbugs.gnu.org
Subject: bug#17449: 24.4.50; Empty lines confuse electric-indent-post-self-insert-function.
Date: Fri, 9 May 2014 17:36:51 +0000	[thread overview]
Message-ID: <CAKXcsMaN+UitA-KH=n0deUF3uiKPLs5rwwFAGZyFsdsJuK6aSA@mail.gmail.com> (raw)
In-Reply-To: <83siojue61.fsf@gnu.org>

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

Thanks for the response, but I really don't think this is the intended
behaviour! If you type

M-x python-mode <RET>
if a == 3:<RET>
<RET>
<RET>
<RET>

the cursor will jump back and forth between column 0 and 4 on every
alternate line, which simply does not make sense.

As for the documentation, here is the relevant paragraph from C-h k RET:

    If `electric-indent-mode' is enabled, this indents the final new line
    that it adds, and reindents the preceding line.  To just insert
    a newline, use M-x electric-indent-just-newline.

Since we're in electric-indent-mode in the test case (it is enabled by
default for me in emacs -Q), the behaviour I've seen definitely does not
match the documentation.


On Fri, May 9, 2014 at 4:09 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Fri, 9 May 2014 10:09:03 +0000
> > From: Philipp Rumpf <prumpf@gmail.com>
> >
> > In C mode and Python mode, hitting <RET> on an indented but otherwise
> > empty line results in an unindented new line at point, rather than an
> > indented line.
> >
> > To reproduce in emacs -Q:
> >
> > M-x python-mode<RET>
> > if a == 3:<RET>
> > <RET>
> > M-: (current-column)<RET>
> >
> > Expected result: 4 / indented line
> > Actual result: 0 / line not indented
>
> Per the design.  "C-h k RET" displays this text:
>
>   RET (translated from <return>) runs the command newline, which is an
>   interactive compiled Lisp function in `simple.el'.
>
>   It is bound to RET.
>
>   (newline &optional ARG INTERACTIVE)
>
>   Insert a newline, and move to left margin of the new line if it's blank.
>                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>

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

  reply	other threads:[~2014-05-09 17:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 10:09 bug#17449: 24.4.50; Empty lines confuse electric-indent-post-self-insert-function Philipp Rumpf
2014-05-09 16:09 ` Eli Zaretskii
2014-05-09 17:36   ` Philipp Rumpf [this message]
2014-05-09 18:03 ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAKXcsMaN+UitA-KH=n0deUF3uiKPLs5rwwFAGZyFsdsJuK6aSA@mail.gmail.com' \
    --to=prumpf@gmail.com \
    --cc=17449@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).