help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Perfect python environment


From: Thierry Volpiatto
Subject: Re: Perfect python environment
Date: Sat, 12 Sep 2009 08:17:06 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

Hi,
Neal Becker <ndbecker2@gmail.com> writes:

> Thierry Volpiatto wrote:
>
>> Neal Becker <ndbecker2@gmail.com> writes:
>> 
>>> Thierry Volpiatto wrote:
>>>
>>>> Hi, i never been able to install rope correctly also.
>>>> even when installed, i found severe bugs that crash emacs (don't
>>>> remember what it was).
>>>> 
>>>> If you just want completion in python, consider using ipython as
>>>> python-shell in emacs and use anything-python for completion.
>>>> See:
>>>> 
>>>> http://ipython.scipy.org/
>>>> http://www.emacswiki.org/cgi-bin/emacs/PythonMode
>>>> http://www.emacswiki.org/cgi-bin/emacs/anything-ipython.el
>>>> 
>>> Thanks!  I installed anything-ipython, and now in ipython shell, I have
>>> completions.
>>>
>>> I also added:
>>> (add-hook 'python-mode-hook #'(lambda ()
>>>                                 (define-key py-mode-map (kbd "C-<tab>")
>>> 'anything-ipython-complete)))
>>> (add-hook 'ipython-shell-hook #'(lambda ()
>>>                                   (define-key py-mode-map (kbd "C-<tab>")
>>> 'anything-ipython-complete)))
>>> (require 'anything-show-completion)
>> 
>> It seem your configuration of anything-ipython is wrong, be sure to read
>> carefully the instructions in anything-ipython.el.
>> I can't reproduce your error.
>> Here is my config:
>> 
>> ,----[ Config thierry anything-ipython ]
>> | (require 'anything-ipython)
>> | (add-hook 'python-mode-hook #'(lambda ()
>> |                                 (define-key py-mode-map (kbd "M-<tab>")
>> |                                 'anything-ipython-complete)))
>> | (add-hook 'ipython-mode-hook #'(lambda ()
>> |                                   (define-key py-mode-map (kbd
>> |                                   "M-<tab>")
>> |                                   'anything-ipython-complete)))
>> | 
>> | (add-hook 'ipython-shell-hook #'(lambda ()
>> |                                   (define-key py-mode-map (kbd
>> |                                   "M-<tab>")
>> |                                   'anything-ipython-complete)))
>> | (when (require 'anything-show-completion nil t)
>> |   (use-anything-show-completion 'anything-ipython-complete
>> |                                 '(length initial-pattern)))
>> | (define-key py-mode-map (kbd "C-c M")
>> | 'anything-ipython-import-modules-from-buffer)
>> `----
>> 
>> To have completion in python buffer (i.e in your python file, not the
>> shell) you have to start first the ipython interpreter, and then load
>> all the modules you have in your python file.
>> Load modules one by one in ipython interpreter or use from your file
>> C-c M (see above).
>> Be sure also to setup python-mode (PYTHON-MODE, not the bad one that
>> come with emacs) correctly.
>> Let me know if you have more problems.
>> 
>
> It seems if I don't use C-c M then I get the traceback I showed.  Also if 
> there are no completions I get that assertion (Assertion failed: header-
> pos).  

I can't reproduce, all work fine here.
That error come from anything.el itself (in `anything-get-current-source').
It is not related with anything-python.el specialy.
I suspect you will have the same error with others anything modules
also.

You have to make anything working.
Can you describe how did you install anything, what anything files you
load etc...

Be sure also to use anything-config.el.(it will require anything)
Also, don't add anything-python source to anything-sources, use it only
with function `anything-ipython-complete.'



>For example:


> -----
> import os
> os.fcn
> -----
>
> Try to complete os.fcn gives that assertion.

BTW what is os.fcn? i have no completion on that, but yes on os.fc
Anyway if you forget to launch ipython or to load modules,
anything-ipython complete nothing, do nothing, 
it don't crash if you forget that, it just wait.

> python-mode.el is 5.1.0.  emacs is 23.1.1.

So good you have python-mode.el.

>
>
>
>
>
>

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





reply via email to

[Prev in Thread] Current Thread [Next in Thread]