Tab completion problem in Emacs

Bug #365760 reported by Jennifer Richards
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
IPython
Fix Committed
Undecided
Unassigned

Bug Description

I recently updated my Kubuntu installation from 8.10 to 9.04 and I find that tab-completion within IPython in Emacs no longer works.

For example, at the command line (not in Emacs), typing "dic" then pressing tab leaves "dict" at the prompt, as expected. In Emacs, the same key sequence results in what seems to be an attempt to continue a multi-line command inserted before the "dic", with the point placed on the "d". This looks like:
In [1]: ...: dic

The same thing happens if I execute (ipython-complete) instead of pressing tab.

Versions:
IPython: 0.9.1-1 (installed from Ubuntu package)
Emacs: 23.0.91.1 (installed from emacs-snapshot 1:20090320-1ubuntu1 package)
Python: 2.6.2-0ubuntu1

Arch: amd64

Please let me know if you need further information or if I should report this somewhere else instead. Thanks.

Revision history for this message
Fabio Leimgruber (fabio-leimgruber) wrote :

I am experiencing exactly the same behaviour.

Same version-numbers, except for a i686 Arch.

Any news on this?

Revision history for this message
Joseph Xu (josephzxu) wrote :

There's a simple fix for this bug documented here:

http://www.nabble.com/TAB-Completion-for-emacs-with-python-2.6-td22025019.html

It works well for me.

Revision history for this message
Jennifer Richards (jenny-borkbork) wrote :

That worked for me as all. The only deviation was the location of the ipython.el, which is in /usr/share/emacs/site-lisp on my system. Thanks.

Revision history for this message
Fabio Leimgruber (fabio-leimgruber) wrote :

Tried out the suggested fix. However, completion still does not work, but behaves as described above. There is a buffer called *IPython Completions*, where I get the following message (same format):

"Possible Completions are:
----> "print ('
'.join(__IP.Completer.all_completions('')) #PYTHON-MODE SILENT"

So it seemed that the change in ipython.el was not made after all. I triple-checked that already. The problem must be somewhere else. My guess: There could be a compiled elisp file somewhere, which still contains the old ipython.el line(?)

any ideas or advice?

thanks

Revision history for this message
Fabio Leimgruber (fabio-leimgruber) wrote :

I managed to get completion working... one thing bothers me though: every time I do a completion, e.g.

In [4]: imp(point is here and I press TAB)

I get

In [4]:
In [4]: import

This would not be that annoying. But inside function definitions, when I press CR after the following:

def f():
    if 2 > 1:(point is here and I press CR)

I get

In [5]: def f():
    ....: if 2 > 1:

Display all 296 possibilities? (y or n)

so it seems to me that the completion feature is somehow connected to the CR, which is bound to ipython-send-and-indent. When on a line on its own, the string before point gets completed, but with a preceding CR. When inside function definitions, a CR results into the above completion prompt, as if I had pressed TAB on an empty line...

I hope I made myself clear, or at least comprehensible.

Ideas / suggestions?

Revision history for this message
Joseph Xu (josephzxu) wrote :

Yup, I have the same experience with the newlines getting inserted during tab-complete. I wonder what the maintenance status on ipython.el is. It hasn't been changed in the bzr repository for almost a year now.

Revision history for this message
Fernando Perez (fdo.perez) wrote :

I've just pushed to trunk a fix in r1241, at least on linux it's working again for me.

And yes, ipython.el is semi-abandoned, so help from anyone with elisp expertise would be very welcome (I don't know the language nor the Emacs api).

Changed in ipython:
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

Remote bug watches

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