py-execute-line breaks sometimes giving an error trace in emacs

Bug #1519859 reported by deuscovrigus@gmail.com on 2015-11-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Medium
Andreas Roehler

Bug Description

1)when attempting to execute a line that's indented i get the following emacs error:

indent-rigidly-left: Symbol's function definition is void: indent-rigidly--pop-undo
Seems like this function is not present.

Andreas Roehler (a-roehler) wrote :

Can't reproduce, see attachment. Sure error is from within a Python buffer?

Changed in python-mode:
status: New → Incomplete

Ok sorry it took me so long to reproduce this, but I finally figured out when the bug occurs. Consider the following script:

def main():
    print 'this is a test'
    print 'this is another test'

if __name__ == '__main__':
    main()

Executing this script will work as expected. If both the print statements are highlighted using the mark (or manually selecting line 2 and 3, and then invoking M-x py-execute-region I get the following error:

indent-rigidly-left: Symbol's function definition is void: indent-rigidly--pop-undo

Note that if the print statements are on their own (outside a function declaration, the py-execute-region works as expected, as well as any indented code.
The thing that causes it to break if it's wrapped in a function, in this case the main()

Can you reproduce?

On 13.01.2016 17:39, <email address hidden> wrote:
> Ok sorry it took me so long to reproduce this, but I finally figured out
> when the bug occurs. Consider the following script:
>
> def main():
> print 'this is a test'
> print 'this is another test'
>
> if __name__ == '__main__':
> main()
>
> Executing this script will work as expected. If both the print
> statements are highlighted using the mark (or manually selecting line 2
> and 3, and then invoking M-x py-execute-region I get the following
> error:
>
> indent-rigidly-left: Symbol's function definition is void: indent-
> rigidly--pop-undo
>
> Note that if the print statements are on their own (outside a function declaration, the py-execute-region works as expected, as well as any indented code.
> The thing that causes it to break if it's wrapped in a function, in this case the main()
>
> Can you reproduce?
>

No, works as expected. As "indent-rigidly--pop-undo" is said missing,
this is delivered by indent.el here.
Seems you got a version, which has that bug. Maybe upgrade?

Ok so this might be related to https://bugs.launchpad.net/python-mode/+bug/1492054.
Note that I am using emacs 24.x and in my indent.el file from /usr/share/emacs/24.3/lisp/ there is no indent-rigidly-pop-undo function, as per the bug I am referencing I think the function has been removed. You commited a fix for bug 1492054 where you would check whether the function exists in emacs and if not use a provided function from python-mode.
Can you confirm it is the case?

Changed in python-mode:
status: Incomplete → New
importance: Undecided → Medium
assignee: nobody → Andreas Roehler (a-roehler)

Ok so I checked the current snapshot on the emacs git page and, as it is in my emacs 24.3 indent.el file, indent-rigidly-pop-undo is not defined anywhere

http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/indent.el

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

Other bug subscribers

Bug attachments