[Python-mode] how to enable auto-complete in the mode

Tan, Heap Ho htan at mlp.com
Wed Apr 27 19:50:27 CEST 2005


Ok so there is no easy way to do it ? There should be right or it will
be hard for emacs to be a true integrated IDE environment ..


-----Original Message-----
From: Skip Montanaro [mailto:skip at pobox.com] 
Sent: Wednesday, April 27, 2005 1:45 PM
To: Tan, Heap Ho
Cc: python-mode at Python.org
Subject: RE: [Python-mode] how to enable auto-complete in the mode


Okay, we're closing in on me understanding your request.

    Heap> It meant that when I edit python in xemacs. There is CPython
mode,
    Heap> how can I edit the xemacs bindings so that it allows
auto-complete
    Heap> the class methods?  I meant in IDE like komodo, they will
    Heap> auto-complete the bindings for you.  Is there a mode in
xemacs?

What sort of completion are you looking for?  Assume I have this class:

    class SillyClass:
        def __init__(self):
            self.long_attribute_name = 5

        def SillyMethodWithALongName(self):
            print self.long_attribute_name

Somewhere else in another module I instantiate it:

    silly = SillyClass()

Now, I want to call its long method, so I type:

    silly.Silly

then hit the TAB key (or something similar).  Do you expect it to
automatically complete to

    silly.SillyMethodWithALongName

?  Given that Python is such a dynamic language, I can't see how that
could
be done reliably.  The only way I can see to implement this easily would
be
to coopt Emacs's TAGS facility to replace partial function/method names
with
the result of (find-tag-tag).  That puts an extra burden on you to
generate
TAGS files, typically from a Makefile.

-- 
Skip Montanaro
skip at pobox.com


More information about the Python-mode mailing list