From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Rumpf Newsgroups: gmane.emacs.bugs Subject: bug#17449: 24.4.50; Empty lines confuse electric-indent-post-self-insert-function. Date: Fri, 9 May 2014 17:36:51 +0000 Message-ID: References: <83siojue61.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b86f126029c9b04f8fb0b46 X-Trace: ger.gmane.org 1399657103 2684 80.91.229.3 (9 May 2014 17:38:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 May 2014 17:38:23 +0000 (UTC) Cc: 17449@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 09 19:38:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WiokR-0003Uy-2Y for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 May 2014 19:38:15 +0200 Original-Received: from localhost ([::1]:53784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiokQ-00040p-ND for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 May 2014 13:38:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiokJ-00040f-8t for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 13:38:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiokE-0001lW-E8 for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 13:38:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiokE-0001lQ-Au for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 13:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WiokD-0007Ei-Ui for bug-gnu-emacs@gnu.org; Fri, 09 May 2014 13:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Rumpf Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 May 2014 17:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17449 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17449-submit@debbugs.gnu.org id=B17449.139965702227717 (code B ref 17449); Fri, 09 May 2014 17:38:01 +0000 Original-Received: (at 17449) by debbugs.gnu.org; 9 May 2014 17:37:02 +0000 Original-Received: from localhost ([127.0.0.1]:57207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WiojF-0007Cn-DJ for submit@debbugs.gnu.org; Fri, 09 May 2014 13:37:01 -0400 Original-Received: from mail-vc0-f173.google.com ([209.85.220.173]:45626) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WiojB-0007CS-UW for 17449@debbugs.gnu.org; Fri, 09 May 2014 13:36:58 -0400 Original-Received: by mail-vc0-f173.google.com with SMTP id il7so5593523vcb.4 for <17449@debbugs.gnu.org>; Fri, 09 May 2014 10:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AupMl2hXd1vWRZyPQBtFfS/KWCL07cuS8lM6tj1yZ+Y=; b=kvvk3qgN3EOkEQPL3T+q0ZEf8tksu34nMCvRw8p/CfIGH5qpguH0EDVisFSmKgeX9f AUJMJRdy4xt7L4WQrYkGUyS3ywSUy03d9Jq1Dv2fscuVB7VVRHQYNw2InWdjWP+ZaMTh m8IvNP7nb3WwlfkGhNNn+AUnRBi3112ii+1jkW1ZPh7Dax1dgKzdRDkiJ1WyNfW/XF/H 99K/crAsBnRpQ6ni2e6WZw9u0g0G8NmG28aTHv7AFD6hctJtBH3olIfy1cvCVeBqNCg4 CvDpbdwYG8XB8LsP8cMv0LeZpSK0ecWVtQVFatMx1vD77jiU9WKXyyTW7yWcbdO5VUvV an7Q== X-Received: by 10.58.85.65 with SMTP id f1mr8727335vez.20.1399657012029; Fri, 09 May 2014 10:36:52 -0700 (PDT) Original-Received: by 10.221.34.142 with HTTP; Fri, 9 May 2014 10:36:51 -0700 (PDT) In-Reply-To: <83siojue61.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88832 Archived-At: --047d7b86f126029c9b04f8fb0b46 Content-Type: text/plain; charset=UTF-8 Thanks for the response, but I really don't think this is the intended behaviour! If you type M-x python-mode if a == 3: 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 wrote: > > Date: Fri, 9 May 2014 10:09:03 +0000 > > From: Philipp Rumpf > > > > In C mode and Python mode, hitting 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 > > if a == 3: > > > > M-: (current-column) > > > > Expected result: 4 / indented line > > Actual result: 0 / line not indented > > Per the design. "C-h k RET" displays this text: > > RET (translated from ) 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. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > --047d7b86f126029c9b04f8fb0b46 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the response= , but I really don't think this is the intended behaviour! If you type<= br>
M-x python-mode <RET>
if a =3D=3D 3:<RET>=
<RET>
<RET>
<RET>

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

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

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

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


On Fri, May 9, 2014 at 4:09 PM, Eli Zare= tskii <eliz@gnu.org> wrote:
> Date: Fri, 9 May 2014 10:09:03 +0000
> From: Philipp Rumpf <prumpf@gma= il.com>
>
> In C mode and Python mode, hitting <RET> on an indented but othe= rwise
> empty line results in an unindented new line at point, rather than an<= br> > indented line.
>
> To reproduce in emacs -Q:
>
> M-x python-mode<RET>
> if a =3D=3D 3:<RET>
> <RET>
> M-: (current-column)<RET>
>
> Expected result: 4 / indented line
> Actual result: 0 / line not indented

Per the design. =C2=A0"C-h k RET" displays this text:

=C2=A0 RET (translated from <return>) runs the command newline, which= is an
=C2=A0 interactive compiled Lisp function in `simple.el'.

=C2=A0 It is bound to RET.

=C2=A0 (newline &optional ARG INTERACTIVE)

=C2=A0 Insert a newline, and move to left margin of the new line if it'= s blank.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^^^^^= ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--047d7b86f126029c9b04f8fb0b46--