Can emacs support auto complete of python?

Peter Milliken peterm at resmed.com.au
Sun Jan 5 15:28:55 EST 2003


I am considering something similar for ELSE mode of Emacs i.e. it would
define methods/function calls as "tokens" and would take a definition such
as this from the string module:

def split(s, sep=None, maxsplit=-1):

and produce the following code template:

   split(s = {text}, [sep = {text}], [maxsplit = {text}])

Note that the [] denote "optional" placeholders i.e. the user can delete
them (since they are arguments supported by default values) or "expand" them
if they decide to use them. All of the code would then have the appearance
of using the named parameter call convention - not a bad thing at all if you
use parameter names that mean something! :-)

Whilst this is somewhat similar to features of other editors, I (personally)
find it of interest only for languages that have named parameters (such as
Python and Ada). Just "popping" up some form of prompter in the middle of a
screen with the function definition normally wouldn't be of interest to me
(I find it distracting) - I would just open another buffer and look at it!
:-)

If there are sufficient users of ELSE out there who are interested, please
let me know and I'll look at changing the (current) priority on this work
:-)

Peter


"Charl P. Botha" <cpbotha at i_triple_e.org> wrote in message
news:ava2rs$j2a$1 at news.tudelft.nl...
> In article <mailman.1041777729.13860.python-list at python.org>,
> Laura Creighton wrote:
> >> In article <mailman.1041771677.3260.python-list at python.org>, Nadav
Horesh
> >> wrote:
> >>
> >> > As in IDLE -- try ALT-/
> >>
> >> AFAIK, the only way to do this in emacs (without elisp programming)
would be
> >> e.g. to open the module your working with in another buffer.
> >
> > I have some happy news for you.  If you put this line in your .emacs
> >
> > (global-set-key [f3]       'dabbrev-expand)
> >
> > you can get autocompleting when you press the f3 key.  Bind it to
> > whatever you prefer ...
>
> AFAIK, alt-/ is the default binding for dabbrev, which means your post is
> now "-1 redundant", or whatever the correct moderation parlance is these
> days.
>
> In anycase, as far is I understood, that's not exactly what the original
> poster described.  dabbrev just completes on the grounds of what's in
> current buffers, whereas the original poster (at least according to his
> posting) wanted something a tad more intelligent, e.g. class.b<complete>
> would suggest all members of "class" that start with "b".  The ipython
shell
> does this for python.  The emacs java-mode does this for java as well if I
> understand correctly.
>
> --
> charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/






More information about the Python-list mailing list