ipython-complete misses py-which-bufname

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

Bug Description

Am 04.02.2012 23:10, schrieb Maik Beckmann:
> Hello,
>
> By utilizing edebug-defun I figured out how to setup python-mode
> for ipython, so that completion works in a file buffer (M-TAB) as
> well as in the ipython comint buffer (TAB):
>
> (setq py-complete-function 'ipython-complete
> py-shell-complete-function 'ipython-complete
> py-shell-name "ipython"
> py-which-bufname "IPython")
>
> Without setting py-which-bufname to "IPython" emacs told me that
> no process is connected the buffer. After setting it, it worked
> as expected. However, I figured this out by using edebug and it
> might be just a hack.
>
> My questions: Am I doing it the way I'm supposed to? Are there
> docs which talk about how to do it right?
>
>
> Thanks,
> Maik Beckmann
>
> PS: I'm running Archlinux, where /usr/bin/{python,ipython} are
> both Python 3. The above setting worked when I've temporarily
> altered these paths to point to python2 and ipython2
> respectively. I've changed these back and this is what I'm
> actually using
>
> (setq py-complete-function 'ipython-complete
> py-shell-complete-function 'ipython-complete
> py-shell-name "ipython2"
> py-which-bufname "Ipython2")
>
> along with these changes http://paste.pocoo.org/show/545846/
> _______________________________________________
> Python-mode mailing list
> <email address hidden>
> http://mail.python.org/mailman/listinfo/python-mode
>

Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.0.5
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Python-mode] ipython setup

Am 04.02.2012 23:10, schrieb Maik Beckmann:
> Hello,
>
> By utilizing edebug-defun I figured out how to setup python-mode
> for ipython, so that completion works in a file buffer (M-TAB) as
> well as in the ipython comint buffer (TAB):
>
> (setq py-complete-function 'ipython-complete
> py-shell-complete-function 'ipython-complete
> py-shell-name "ipython"
> py-which-bufname "IPython")
>
> Without setting py-which-bufname to "IPython" emacs told me that
> no process is connected the buffer. After setting it, it worked
> as expected. However, I figured this out by using edebug and it
> might be just a hack.
>
> My questions: Am I doing it the way I'm supposed to? Are there
> docs which talk about how to do it right?

Hi,

you should not need any customization for IPython.
There was a bug, which shold be gone now. Could you try from current
trunk again?

Made a bug report lp:927136 for this. Let's continue there, should
something being left.

thanks for your report,

Andreas

>
>
> Thanks,
> Maik Beckmann
>
> PS: I'm running Archlinux, where /usr/bin/{python,ipython} are
> both Python 3. The above setting worked when I've temporarily
> altered these paths to point to python2 and ipython2
> respectively. I've changed these back and this is what I'm
> actually using
>
> (setq py-complete-function 'ipython-complete
> py-shell-complete-function 'ipython-complete
> py-shell-name "ipython2"
> py-which-bufname "Ipython2")
>
> along with these changes http://paste.pocoo.org/show/545846/

Revision history for this message
Maik Beckmann (beckmann-maik) wrote :

Nah, doesn't work. Regarding how to proceed on this: I'd prefer
to write down (in an .org file) what configuration causes which
problems at specific places in python statement, i.e.:

This configuration
#+begin_src elisp
  (add-to-list 'load-path "~/.emacs.d/python-mode")
  (autoload 'python-mode "python-mode" "Python editing mode." t)
  (setq py-shell-name "ipython2")
#+end_src
causes this
#+begin_src python
  import numpy as np
  np.[M-TAB]
#+end_src
to lock emacs indefinitely.

This should reduce the chance of misunderstanding, especially since my system
might be different from yours (python and ipython are both Python 3 here). It
also makes it easier for me to allocate time and is likely to reduce the amount
of time to fix this issue on your side as well.

I hope you're ok with this.

Grüße,
Maik Beckmann

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 927136] Re: ipython-complete misses py-which-bufname

Am 05.02.2012 22:15, schrieb Maik Beckmann:
> Nah, doesn't work. Regarding how to proceed on this: I'd prefer
> to write down (in an .org file) what configuration causes which
> problems at specific places in python statement, i.e.:
>
>
> This configuration
> #+begin_src elisp
> (add-to-list 'load-path "~/.emacs.d/python-mode")
> (autoload 'python-mode "python-mode" "Python editing mode." t)
> (setq py-shell-name "ipython2")
> #+end_src
> causes this
> #+begin_src python
> import numpy as np
> np.[M-TAB]

AFAIU completion should return here all the symbols of np? Right?

For now it's implemented as a kind of word-completion, expecting some
chars of it already inserted.

[ ... ]

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.