Indentation after pressing "return" key if keyword in line

Bug #885143 reported by Ryan Kaskel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler

Bug Description

This is simple to describe.

Type a line with a keyword that expects indention after in it:

def foo():
    pass

or

with_help = False
^
|------------------move cursor here and press return (enter)

Notice that the line indents.

Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

Make sure to try the above at the top of the buffer.

It seems to stop after a few lines but I can't figure out why:

For example:

--------- top of buffer - press return when cursor is over "d" in "def foo" and watch it indent
|
def foo():
    pass

def bar():
    pass

If you press return when the cursor is on the "d" in "def bar", it doens't indent.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Hi Ryan,

don't see any indentation here.

M-x report-emacs-bug RET

?

Cheers

Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.0.4
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

hmm.

if you type:

import foo

on the first line of a new Python file and then you press C-a and then C-j, it ends up like:

    import foo

on my screen. I will investigate further.

Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

I've just updated by local branch and now I see the following behavior (recipe with emacs -q):

step 1 - type into buffer on the first line :

import sys

step 2 - move cursor to beginning of line

import sys
^
|-----------cursor here

step 3 - press enter or C-j (both bound to py-newline-and-indent)

output:

import sys
         ^
          |------ cursor now here

Can you replicate this?

Revision history for this message
Ryan Kaskel (ryankaskel) wrote :

Sorry the formatting above isn't correct and I can't edit the message.

The cursor ends up on the "r" in "import".

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 885143] Re: Indentation after pressing "return" key if keyword in line

Am 23.11.2011 11:15, schrieb Ryan Kaskel:
> Sorry the formatting above isn't correct and I can't edit the message.
>
> The cursor ends up on the "r" in "import".
>

see it, thanks!

Changed in python-mode:
status: Incomplete → In Progress
Changed in python-mode:
status: In Progress → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.