[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#19691: closed (24.4; python.el: indentation RFE)

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#19691: closed (24.4; python.el: indentation RFE)
Date: Fri, 30 Jan 2015 03:53:01 +0000

Your message dated Fri, 30 Jan 2015 00:52:32 -0300
with message-id <address@hidden>
and subject line 24.4; python.el: indentation RFE
has caused the debbugs.gnu.org bug report #19691,
regarding 24.4; python.el: indentation RFE
to be marked as done.

(If you believe you have received this mail in error, please contact

19691: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19691
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.4; python.el: indentation RFE Date: Mon, 26 Jan 2015 11:25:18 -0300
When you're in a blank line and press Enter, IMHO it would be better if
python.el kept the cursor column position, instead of restoring the last
non-blank line indentation level.

For example, say the cursor is X:

def f():

When I press Enter most often I don't want to get:

def f():


Instead, I think a more sensible default behaviour would be:

def f():


That is, to keep the cursor vertical position. This is consistent with
the criterion of auto-indenting up to the indentation of last (both
blank or non-blank) line, except for the technicality that a blank last
line is not really indented... although you still have a point position
there to infer desired indentation for the new line.

Maybe this should be made a customizable option.

What do you think? I'll try to submit a patch later today.

--- End Message ---
--- Begin Message --- Subject: 24.4; python.el: indentation RFE Date: Fri, 30 Jan 2015 00:52:32 -0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
tags 19691 + notabug

Hi Carlos,

The functionality already exists, it's a matter of toggling
`electric-indent-mode` OR alternate between using RET and `C-j` for
creating a newline (depending the case).

When `electric-indent-mode` is enabled, you can achieve what you want by
using `C-j`, while RET would indent just like you see right now.

When `electric-indent-mode` is disabled, you can achieve what you want
by using RET, and `C-j` would indent.

If what you want is to keep the current column in places where there are
several indentation levels involved, then `C-a C-j` or `C-a RET`
(depending on the status `electric-indent-mode`) will help.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]