Windows, r1219: Completion in script buffer doesn't work

Bug #1164183 reported by Richard Stanton
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Unassigned

Bug Description

System: OS X 10.8.3, Emacs 24.3.1, python-mode 1219, running the Anaconda python distribution (though I used to use EPD, and had very similar results) and using ipython as my default python shell.

The problem: Completion hasn't worked for ages with python-mode. Here's an example Python script file, say complete.py:

a = [1,2,3]

If I press C-c C-c, an Ipython buffer opens quite normally. Now suppose I go back to the script buffer and type (in the next line)

a.

and then, with the cursor right after the dot, go to the menu and select "PyTools" -> "Completion" -> "Complete symbol". No completion buffer pops up. Instead

1) In the script buffer, the cursor moves forward 6 spaces, leaving 6 new blank spaces after the dot.

2) In the Ipython buffer, I see a new input line that looks like this:

In [7]: a.append;a.count;a.extend;a.index;a.insert;a.pop;a.remove;a.reverse;a.sort

3) In the minibuffer, I see the message "Completion function py-shell-complete uses a deprecated calling convention"

Am I missing something? I've been unable to get completion to work for months now, which is quite a significant problem.

Let me know if I can do anything to help track this down.

Best,

Richard Stanton

Changed in python-mode:
milestone: none → 6.1.2
assignee: nobody → Andreas Roehler (a-roehler)
importance: Undecided → Medium
Revision history for this message
Richard Stanton (a-stanton) wrote :

Followup:

I just tried the same experiment using EPD instead of Anaconda on the same machine. It fails as well, but in a different way. On selecting "Complete Symbol" as above,

1) There's a *long* wait (about 10-15 seconds, on a fast machine with lots of RAM) with Emacs unresponsive to key presses during this period.

2) An *IPython Completions* buffer does eventually pop up, but tells me "There are no possible completions of what you have typed."

Revision history for this message
Richard Stanton (a-stanton) wrote :

I have found a workaround, which is not to use python-mode's completion at all! I just tried opening up the EIN package, then loaded complete.py, and used EIN to connect the buffer to an existing IPython noteboook. Attached (because it's so lovely!) is a screenshot of what happens now when I type the dot after the a. Not only do I get a pop-up window with all the possible completions, but I also get a description of what each of them means in a separate (yellow) pop-up window. It would be great if python-mode.el could offer the same functionality.

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1164183] Re: r1219: Completion in script buffer doesn't work

Am 04.04.2013 18:59, schrieb Richard Stanton:
> I have found a workaround, which is not to use python-mode's completion
> at all! I just tried opening up the EIN package, then loaded
> complete.py, and used EIN to connect the buffer to an existing IPython
> noteboook. Attached (because it's so lovely!) is a screenshot of what
> happens now when I type the dot after the a. Not only do I get a pop-up
> window with all the possible completions, but I also get a description
> of what each of them means in a separate (yellow) pop-up window. It
> would be great if python-mode.el could offer the same functionality.
>
> ** Attachment added: "Screen Shot 2013-04-04 at 9.52.05 AM.png"
> https://bugs.launchpad.net/python-mode/+bug/1164183/+attachment/3621208/+files/Screen%20Shot%202013-04-04%20at%209.52.05%20AM.png
>

Thanks, Richard, nice indeed.

So what remains to do from python-mode side? Maybe just mention that way?
IMO we must stick with the default tools, can't require notebook.

IPython OTOH should be an option, will see what to do,

Andreas

Revision history for this message
Richard Stanton (a-stanton) wrote :

I agree we shouldn't require external tools or notebooks. This is a useful
work-around, but it would be better if python-mode could provide the same
completion functionality without needing an external package. Maybe you
could just borrow the code from EIN for completion using Ipython.

On 4/4/13 10:21 AM, "Andreas Roehler" <email address hidden> wrote:

>Am 04.04.2013 18:59, schrieb Richard Stanton:
>> I have found a workaround, which is not to use python-mode's completion
>> at all! I just tried opening up the EIN package, then loaded
>> complete.py, and used EIN to connect the buffer to an existing IPython
>> noteboook. Attached (because it's so lovely!) is a screenshot of what
>> happens now when I type the dot after the a. Not only do I get a pop-up
>> window with all the possible completions, but I also get a description
>> of what each of them means in a separate (yellow) pop-up window. It
>> would be great if python-mode.el could offer the same functionality.
>>
>> ** Attachment added: "Screen Shot 2013-04-04 at 9.52.05 AM.png"
>>
>>https://bugs.launchpad.net/python-mode/+bug/1164183/+attachment/3621208/+
>>files/Screen%20Shot%202013-04-04%20at%209.52.05%20AM.png
>>
>
>Thanks, Richard, nice indeed.
>
>So what remains to do from python-mode side? Maybe just mention that way?
>IMO we must stick with the default tools, can't require notebook.
>
>IPython OTOH should be an option, will see what to do,
>
>Andreas
>
>--
>You received this bug notification because you are subscribed to the bug
>report.
>https://bugs.launchpad.net/bugs/1164183
>
>Title:
> r1219: Completion in script buffer doesn't work
>
>Status in An Emacs mode for editing Python code:
> New
>
>Bug description:
> System: OS X 10.8.3, Emacs 24.3.1, python-mode 1219, running the
> Anaconda python distribution (though I used to use EPD, and had very
> similar results) and using ipython as my default python shell.
>
> The problem: Completion hasn't worked for ages with python-mode.
> Here's an example Python script file, say complete.py:
>
> a = [1,2,3]
>
>
> If I press C-c C-c, an Ipython buffer opens quite normally. Now suppose
>I go back to the script buffer and type (in the next line)
>
> a.
>
> and then, with the cursor right after the dot, go to the menu and
> select "PyTools" -> "Completion" -> "Complete symbol". No completion
> buffer pops up. Instead
>
> 1) In the script buffer, the cursor moves forward 6 spaces, leaving 6
> new blank spaces after the dot.
>
> 2) In the Ipython buffer, I see a new input line that looks like this:
>
> In [7]:
>
>a.append;a.count;a.extend;a.index;a.insert;a.pop;a.remove;a.reverse;a.sort
>
> 3) In the minibuffer, I see the message "Completion function py-shell-
> complete uses a deprecated calling convention"
>
> Am I missing something? I've been unable to get completion to work for
> months now, which is quite a significant problem.
>
> Let me know if I can do anything to help track this down.
>
> Best,
>
> Richard Stanton
>
>To manage notifications about this bug go to:
>https://bugs.launchpad.net/python-mode/+bug/1164183/+subscriptions

Revision history for this message
Andreas Roehler (a-roehler) wrote :
Download full text (3.3 KiB)

Being shameless enough to do that, if suitable :)

Am 04.04.2013 19:41, schrieb Richard Stanton:
> I agree we shouldn't require external tools or notebooks. This is a useful
> work-around, but it would be better if python-mode could provide the same
> completion functionality without needing an external package. Maybe you
> could just borrow the code from EIN for completion using Ipython.
>
>
> On 4/4/13 10:21 AM, "Andreas Roehler" <email address hidden> wrote:
>
>> Am 04.04.2013 18:59, schrieb Richard Stanton:
>>> I have found a workaround, which is not to use python-mode's completion
>>> at all! I just tried opening up the EIN package, then loaded
>>> complete.py, and used EIN to connect the buffer to an existing IPython
>>> noteboook. Attached (because it's so lovely!) is a screenshot of what
>>> happens now when I type the dot after the a. Not only do I get a pop-up
>>> window with all the possible completions, but I also get a description
>>> of what each of them means in a separate (yellow) pop-up window. It
>>> would be great if python-mode.el could offer the same functionality.
>>>
>>> ** Attachment added: "Screen Shot 2013-04-04 at 9.52.05 AM.png"
>>>
>>> https://bugs.launchpad.net/python-mode/+bug/1164183/+attachment/3621208/+
>>> files/Screen%20Shot%202013-04-04%20at%209.52.05%20AM.png
>>>
>>
>> Thanks, Richard, nice indeed.
>>
>> So what remains to do from python-mode side? Maybe just mention that way?
>> IMO we must stick with the default tools, can't require notebook.
>>
>> IPython OTOH should be an option, will see what to do,
>>
>> Andreas
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1164183
>>
>> Title:
>> r1219: Completion in script buffer doesn't work
>>
>> Status in An Emacs mode for editing Python code:
>> New
>>
>> Bug description:
>> System: OS X 10.8.3, Emacs 24.3.1, python-mode 1219, running the
>> Anaconda python distribution (though I used to use EPD, and had very
>> similar results) and using ipython as my default python shell.
>>
>> The problem: Completion hasn't worked for ages with python-mode.
>> Here's an example Python script file, say complete.py:
>>
>> a = [1,2,3]
>>
>>
>> If I press C-c C-c, an Ipython buffer opens quite normally. Now suppose
>> I go back to the script buffer and type (in the next line)
>>
>> a.
>>
>> and then, with the cursor right after the dot, go to the menu and
>> select "PyTools" -> "Completion" -> "Complete symbol". No completion
>> buffer pops up. Instead
>>
>> 1) In the script buffer, the cursor moves forward 6 spaces, leaving 6
>> new blank spaces after the dot.
>>
>> 2) In the Ipython buffer, I see a new input line that looks like this:
>>
>> In [7]:
>>
>> a.append;a.count;a.extend;a.index;a.insert;a.pop;a.remove;a.reverse;a.sort
>>
>> 3) In the minibuffer, I see the message "Completion function py-shell-
>> complete uses a deprecated calling convention"
>>
>> Am I missing something? I've been unable to get completion to work for
>> months now, which is quite a significant problem.
>>
>> Let me know if I can do anything to help track this down.
...

Read more...

Changed in python-mode:
milestone: 6.1.2 → 6.2
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: r1219: Completion in script buffer doesn't work

Hi Richard,

the Python code used to fetch completions doesn't work at windows for me.
No idea why not.
Will remove the assignment, so maybe someone else will see it and send a patch.

Cheers,
Andreas

Changed in python-mode:
assignee: Andreas Roehler (a-roehler) → nobody
status: New → Confirmed
summary: - r1219: Completion in script buffer doesn't work
+ r1219, windows: Completion in script buffer doesn't work
summary: - r1219, windows: Completion in script buffer doesn't work
+ Windows, r1219: Completion in script buffer doesn't work
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Works for me with current trunk. Please re-open if not done.

Changed in python-mode:
status: Confirmed → 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.