[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: writing Python in Emacs
From: |
Thierry Volpiatto |
Subject: |
Re: writing Python in Emacs |
Date: |
Sat, 19 Jan 2008 21:41:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
I add just a note about ipython:
if you use a version > 0.6.15 may be you will have a bad output
on error like:
== " ":
instead of:
if __name__ == "__main__":
all the characters are missing.
To avoid that, run in ipython:
%upgrade -nolegacy
uncomment in ~/.ipython/ipy_user_config.py:
import ipy_defaults
restart emacs and try a .py with some syntax errors.
It should be ok now.
Terry Jones <terry@jon.es> writes:
>>>>>> "Richard" == Richard Szopa <ryszard.szopa@gmail.com> writes:
>
> Richard> I am a devoted Emacs user and I write a lot in Python.
>
> Me too.
>
> Richard> I need the following features:
>
> Richard> 1) Tab completion, ideally Slime like. That is, when there's not
> Richard> enough letters to unambiguously complete a symbol, I want it to
> Richard> show a buffer (w/o taking the focus) w/ the possible
> Richard> completions. In an ideal world, it would be able to complete
> Richard> fo.ba<TAB> to foo.bar. I imagine this would require quite tight
> Richard> Emacs-Python integration.
>
> I know this is not what you want, but I use hippie expand (M-/) to cycle
> through possible completions. It's not Python aware, but it is of some use.
>
> Richard> 2) Sending the toplevel definition (class or function) to the Python
> Richard> buffer.
>
> I switched to IPython to have better interaction with a spawned Python.
>
> To use IPython you need to use the Python mode that is NOT the one from
> (endorsed?) by the FSF. It gives you some completion (at least in the
> *Python* buffer) and you can send pieces of the buffer to the python
> process, via py-send-region (C-c |), py-execute-def-or-class (M-C-x), etc.
>
> Richard> 3) Hints on function/method arguments. IDLE has this done nearly
> Richard> right, but the hints are a bit too intrusive for me. I would like to
> Richard> see them in the minibuffer.
>
> I don't have this.
>
> Richard> 4) (optional) I would like to see the definition of a function
> Richard> function or class by hitting M-. on its name. (I understand that
> Richard> this may be impossible for methods, as Emacs would have to
> Richard> automagically infer the type of the object).
>
> This is just an emacs tag file need. Have you googled for something like
> emacs tags python? The issue of methods might be overcome by just moving
> through tags with the same name. Yes, that requires _you_ to know when
> you've hit the right thing. That's not optimal, but it's better than
> nothing. Ideally you could send the definition to IPython, ask it for the
> class info, and use that to jump to the right tag.
>
> Richard> I have tried a couple of times both python-modes (the one shipped w/
> Richard> Python and the one shipped w/ Emacs), pymacs and stuff like that...
> Richard> And, as I said, never got it right. But, maybe I just cannot find the
> Richard> way to configure it, and some configuration hints will be enough...
>
> If you have the time, please summarize your findings. The emacs/python
> world has always seemed quite amorphous to me too.
>
> Terry
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>
--
A + Thierry
Pub key: http://pgp.mit.edu