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

Bug #1519859 reported by deuscovrigus@gmail.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Committed
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.

Revision history for this message
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
Revision history for this message
deuscovrigus@gmail.com (deuscovrigus) 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?

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1519859] Re: py-execute-line breaks sometimes giving an error trace in emacs

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?

Revision history for this message
deuscovrigus@gmail.com (deuscovrigus) wrote :

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)
Revision history for this message
deuscovrigus@gmail.com (deuscovrigus) wrote :

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  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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