all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Inferior Python mode completion
@ 2010-11-11 21:14 Андрей Парамонов
  0 siblings, 0 replies; only message in thread
From: Андрей Парамонов @ 2010-11-11 21:14 UTC (permalink / raw)
  To: help-gnu-emacs

Hello Emacs hackers!

Recently I'm investigating the possibility to use Emacs as Python IDE.
I have used Emacs for a long time and I wish continue to do so when
developing in Python.

So far I've tried built-in python.el, CEDET in Emacs 23.2 and latest
trunk, and python-mode.el. From these, built-in python.el seems the
best. It's consistent with other Emacs modes and has very decent
completion. However I fail to see how to enable completion in Python
interpreter buffer. I thought it would be easy as completion already
works in Python mode, but no luck :-(

I tried to copy-paste the following lines from \\{python-mode-map} to
\\{inferior-python-mode-map}:

(add-hook 'completion-at-point-functions
          'python-completion-at-point nil 'local)

and I got a completion, sort of. In Python interpreter buffer upon
M-Tab I would get multiple _emacs_out traces, like the following:

>>> _emacs_out ( "os" )
>>> _emacs_out ( "os.path.pardir" "os.path._varprog" "os.path.sameopenfile" "os.path.exists" "os.path.realpath" "os.path.splitext" "os.path.basename" "os.path.walk" "os.path.expandvars" "os.path.altsep" "os.path.expanduser" "os.path.getmtime" "os.path.defpath" "os.path.dirname" "os.path.isfile" "os.path.supports_unicode_filenames" "os.path.__all__" "os.path.sep" "os.path.pathsep" "os.path.__class__" "os.path.__package__" "os.path.getsize" "os.path.samestat" "os.path.curdir" "os.path.devnull" "os.path.abspath" "os.path.islink" "os.path.relpath" "os.path.samefile" "os.path.genericpath" "os.path.stat" "os.path.commonprefix" "os.path.normpath" "os.path.__builtins__" "os.path.__file__" "os.path.normcase" "os.path.extsep" "os.path.__name__" "os.path.getatime" "os.path.lexists" "os.path.isdir" "os.path.join" "os.path.split" "os.path.getctime" "os.path.isabs" "os.path.__doc__" "os.path.ismount" "os.path.splitdrive" "os.path.warnings" "os.path._resolve_link" "os.path.os" )

I'm not very good at (e)lisp, but after reading code in python.el and
a bit of googling I understand that Emacs installs a kind of hook into
Python interpreter by loading package "emacs". It looks like that hook
works nicely but Emacs cannot correctly handle it's output in my case.

It would be great if someone with better knowledge of Emacs'
architecture could point me where to dig.

Any hint appreciated,
Andrey Paramonov



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-11 21:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-11 21:14 Inferior Python mode completion Андрей Парамонов

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.