From: Lowell Kirsh
Subject: code completion
Date: 
Message-ID: <bl2jk9$4h7$1@mughi.cs.ubc.ca>
Most Java IDE's I've used have had a feature called code completion 
where after typing an object name or a class name, a menu would drop 
down showing the possible methods that could be called. Is there 
anything like like this in emacs (presumably in a separate package)? Or 
is there any CL environment with a similar feature?
I guess a CL version would be less functional than a Java one could be, 
just by the structure of the language itself. But it would be great if I 
could type in the name of a package followed by a colon, and could be 
reminded of what functions are in that package so I wouldn't have to 
constantly be checking documentation.

Lowell

From: Rainer Joswig
Subject: Re: code completion
Date: 
Message-ID: <joswig-8FF1D0.02021227092003@news.fu-berlin.de>
In article <············@mughi.cs.ubc.ca>,
 Lowell Kirsh <······@cs.ubc.ca> wrote:

> Most Java IDE's I've used have had a feature called code completion 
> where after typing an object name or a class name, a menu would drop 
> down showing the possible methods that could be called. Is there 
> anything like like this in emacs (presumably in a separate package)? Or 
> is there any CL environment with a similar feature?
> I guess a CL version would be less functional than a Java one could be, 
> just by the structure of the language itself. But it would be great if I 
> could type in the name of a package followed by a colon, and could be 
> reminded of what functions are in that package so I wouldn't have to 
> constantly be checking documentation.
> 
> Lowell
> 

try:

 c-h a complete
From: Edi Weitz
Subject: Re: code completion
Date: 
Message-ID: <877k3uvd1o.fsf@bird.agharta.de>
On Fri, 26 Sep 2003 16:54:48 -0700, Lowell Kirsh <······@cs.ubc.ca> wrote:

> Most Java IDE's I've used have had a feature called code completion
> where after typing an object name or a class name, a menu would drop
> down showing the possible methods that could be called. Is there
> anything like like this in emacs (presumably in a separate package)?
> Or is there any CL environment with a similar feature?  I guess a CL
> version would be less functional than a Java one could be, just by
> the structure of the language itself.

Why do you think that? By the structure of the language itself you
always have an interactive REPL (read-eval-print loop). The usual way
you work is that you write your code in some file (as you'd do it with
Java) but from there ask your Editor/IDE to evaluate/compile it step
by step. If you use a decent IDE you have code completion available at
exactly this point, i.e. directly after you've compiled the function
FROB ILISP's complete-lisp function will know that FROB is a possible
completion for "FR". ILISP will also immediateley show the arglist for
this function in the message area if you type "(FROB " - see
ilisp-arglist-message-lisp-space.

ILISP is a Common Lisp IDE for (X)Emacs which works with most Common
Lisp implementations (and some Schemes, too). There are lots of other
IDEs offering similar funtionality, e.g.

- elisp (also for (X)Emacs), originally for AllegroCL but now also
  available for SCL and SBCL,

- SLIME (also for Emacs), currently in development for CMUCL and SBCL,

- Hemlock, originally part of CMUCL but now available as "Portable
  Hemlock" for other Lisps,

- Jabberwocky (stand-alone, written in Java), search Google to find
  out which Lisps are supported, and

- the commercial Lisps (AllegroCL, Xanalys LispWorks, Digitool MCL,
  Corman Lisp) all come with their own IDEs.

Edi.
From: Kenny Tilton
Subject: Re: code completion
Date: 
Message-ID: <jocdb.28858$nU6.4714944@twister.nyc.rr.com>
Edi Weitz wrote:

> On Fri, 26 Sep 2003 16:54:48 -0700, Lowell Kirsh <······@cs.ubc.ca> wrote:
> 
> 
>>Most Java IDE's I've used have had a feature called code completion
>>where after typing an object name or a class name, a menu would drop
>>down showing the possible methods that could be called. Is there
>>anything like like this in emacs (presumably in a separate package)?
>>Or is there any CL environment with a similar feature?  I guess a CL
>>version would be less functional than a Java one could be, just by
>>the structure of the language itself.
> 
> 
> Why do you think that? By the structure of the language itself you
> always have an interactive REPL (read-eval-print loop). The usual way
> you work is that you write your code in some file (as you'd do it with
> Java) but from there ask your Editor/IDE to evaluate/compile it step
> by step. If you use a decent IDE you have code completion available at
> exactly this point, i.e. directly after you've compiled the function
> FROB ILISP's complete-lisp function will know that FROB is a possible
> completion for "FR". ILISP will also immediateley show the arglist for
> this function in the message area if you type "(FROB " - see
> ilisp-arglist-message-lisp-space.

True, CL has symbol completion, but the OP mentioned specifically what I 
have also seen in Visual C++, the IDE taking advantage of compiler info 
and static typing info. So in C I might have a variable X, but if it has 
been declared to be of type BOX, the IDE knows to offer LEFT, RIGHT, etc 
as completions to "X.". And it also knows the member functions of X and 
can offer those at some point (I guess, I don't recall that one.) In CL 
X is untyped, and even if it were not it's class hierarchy might be 
incomplete as I typed, and then in CLOS a class does not have a set of 
member functions.

Symbol completion is not able to limit itself according to observed type 
info.

kenny
From: Marco Antoniotti
Subject: Re: code completion
Date: 
Message-ID: <3F7852E2.3060704@cs.nyu.edu>
Kenny Tilton wrote:
> 
> 
> Edi Weitz wrote:
> 
>> On Fri, 26 Sep 2003 16:54:48 -0700, Lowell Kirsh <······@cs.ubc.ca> wrote:
>>
>>
>>> Most Java IDE's I've used have had a feature called code completion
>>> where after typing an object name or a class name, a menu would drop
>>> down showing the possible methods that could be called. Is there
>>> anything like like this in emacs (presumably in a separate package)?
>>> Or is there any CL environment with a similar feature?  I guess a CL
>>> version would be less functional than a Java one could be, just by
>>> the structure of the language itself.
>>
>>
>>
>> Why do you think that? By the structure of the language itself you
>> always have an interactive REPL (read-eval-print loop). The usual way
>> you work is that you write your code in some file (as you'd do it with
>> Java) but from there ask your Editor/IDE to evaluate/compile it step
>> by step. If you use a decent IDE you have code completion available at
>> exactly this point, i.e. directly after you've compiled the function
>> FROB ILISP's complete-lisp function will know that FROB is a possible
>> completion for "FR". ILISP will also immediateley show the arglist for
>> this function in the message area if you type "(FROB " - see
>> ilisp-arglist-message-lisp-space.
> 
> 
> True, CL has symbol completion, but the OP mentioned specifically what I 
> have also seen in Visual C++, the IDE taking advantage of compiler info 
> and static typing info. So in C I might have a variable X, but if it has 
> been declared to be of type BOX, the IDE knows to offer LEFT, RIGHT, etc 
> as completions to "X.". And it also knows the member functions of X and 
> can offer those at some point (I guess, I don't recall that one.) In CL 
> X is untyped, and even if it were not it's class hierarchy might be 
> incomplete as I typed, and then in CLOS a class does not have a set of 
> member functions.
> 
> Symbol completion is not able to limit itself according to observed type 
> info.

Agreed.  However, IISMOP (it is a simple matter of programming) to get a 
similar effect in a CL IDE.  MCL and ILISP are already reasonably good 
at it.  No drop down menu, but you can get the arglist of the function.

Now... if only the CLtL2 introspection facilities, plus the changes that 
Franz put in, were "standardized"......

Cheers
--
Marco
From: Paolo Amoroso
Subject: Re: code completion
Date: 
Message-ID: <87u16yz6ic.fsf@plato.moon.paoloamoroso.it>
Edi Weitz writes:

> Lisp implementations (and some Schemes, too). There are lots of other
> IDEs offering similar funtionality, e.g.
>
> - elisp (also for (X)Emacs), originally for AllegroCL but now also
>   available for SCL and SBCL,

Do you mean ELI?


Paolo
-- 
Paolo Amoroso <·······@mclink.it>
From: Edi Weitz
Subject: Re: code completion
Date: 
Message-ID: <871xu1vmla.fsf@bird.agharta.de>
On Sat, 27 Sep 2003 15:48:59 +0200, Paolo Amoroso <·······@mclink.it> wrote:

> Edi Weitz writes:
> 
> > Lisp implementations (and some Schemes, too). There are lots of
> > other IDEs offering similar funtionality, e.g.
> >
> > - elisp (also for (X)Emacs), originally for AllegroCL but now also
> >   available for SCL and SBCL,
> 
> Do you mean ELI?

Yes, thanks.

Edi.
From: Lowell
Subject: Re: code completion
Date: 
Message-ID: <bl8mh9$bgs$1@mughi.cs.ubc.ca>
What you say about ILISP makes it sound pretty cool. Unfortunately, I 
haven't been able to get it working properly on my system. I'll keep trying.

thanks
Lowell

Edi Weitz wrote:

> On Fri, 26 Sep 2003 16:54:48 -0700, Lowell Kirsh <······@cs.ubc.ca> wrote:
> 
> 
>>Most Java IDE's I've used have had a feature called code completion
>>where after typing an object name or a class name, a menu would drop
>>down showing the possible methods that could be called. Is there
>>anything like like this in emacs (presumably in a separate package)?
>>Or is there any CL environment with a similar feature?  I guess a CL
>>version would be less functional than a Java one could be, just by
>>the structure of the language itself.
> 
> 
> Why do you think that? By the structure of the language itself you
> always have an interactive REPL (read-eval-print loop). The usual way
> you work is that you write your code in some file (as you'd do it with
> Java) but from there ask your Editor/IDE to evaluate/compile it step
> by step. If you use a decent IDE you have code completion available at
> exactly this point, i.e. directly after you've compiled the function
> FROB ILISP's complete-lisp function will know that FROB is a possible
> completion for "FR". ILISP will also immediateley show the arglist for
> this function in the message area if you type "(FROB " - see
> ilisp-arglist-message-lisp-space.
> 
> ILISP is a Common Lisp IDE for (X)Emacs which works with most Common
> Lisp implementations (and some Schemes, too). There are lots of other
> IDEs offering similar funtionality, e.g.
> 
> - elisp (also for (X)Emacs), originally for AllegroCL but now also
>   available for SCL and SBCL,
> 
> - SLIME (also for Emacs), currently in development for CMUCL and SBCL,
> 
> - Hemlock, originally part of CMUCL but now available as "Portable
>   Hemlock" for other Lisps,
> 
> - Jabberwocky (stand-alone, written in Java), search Google to find
>   out which Lisps are supported, and
> 
> - the commercial Lisps (AllegroCL, Xanalys LispWorks, Digitool MCL,
>   Corman Lisp) all come with their own IDEs.
> 
> Edi.
From: Marco Antoniotti
Subject: Re: code completion
Date: 
Message-ID: <3F785346.1080004@cs.nyu.edu>
Lowell wrote:
> What you say about ILISP makes it sound pretty cool. Unfortunately, I 
> haven't been able to get it working properly on my system. I'll keep trying.
> 

What's your system?  BTW.  the ··········@lists.sf.net mailing list is a 
very responsive forum for this kind of questions.

Cheers

--
Marco




> thanks
> Lowell
> 
> Edi Weitz wrote:
> 
>> On Fri, 26 Sep 2003 16:54:48 -0700, Lowell Kirsh <······@cs.ubc.ca> wrote:
>>
>>
>>> Most Java IDE's I've used have had a feature called code completion
>>> where after typing an object name or a class name, a menu would drop
>>> down showing the possible methods that could be called. Is there
>>> anything like like this in emacs (presumably in a separate package)?
>>> Or is there any CL environment with a similar feature?  I guess a CL
>>> version would be less functional than a Java one could be, just by
>>> the structure of the language itself.
>>
>>
>>
>> Why do you think that? By the structure of the language itself you
>> always have an interactive REPL (read-eval-print loop). The usual way
>> you work is that you write your code in some file (as you'd do it with
>> Java) but from there ask your Editor/IDE to evaluate/compile it step
>> by step. If you use a decent IDE you have code completion available at
>> exactly this point, i.e. directly after you've compiled the function
>> FROB ILISP's complete-lisp function will know that FROB is a possible
>> completion for "FR". ILISP will also immediateley show the arglist for
>> this function in the message area if you type "(FROB " - see
>> ilisp-arglist-message-lisp-space.
>>
>> ILISP is a Common Lisp IDE for (X)Emacs which works with most Common
>> Lisp implementations (and some Schemes, too). There are lots of other
>> IDEs offering similar funtionality, e.g.
>>
>> - elisp (also for (X)Emacs), originally for AllegroCL but now also
>>   available for SCL and SBCL,
>>
>> - SLIME (also for Emacs), currently in development for CMUCL and SBCL,
>>
>> - Hemlock, originally part of CMUCL but now available as "Portable
>>   Hemlock" for other Lisps,
>>
>> - Jabberwocky (stand-alone, written in Java), search Google to find
>>   out which Lisps are supported, and
>>
>> - the commercial Lisps (AllegroCL, Xanalys LispWorks, Digitool MCL,
>>   Corman Lisp) all come with their own IDEs.
>>
>> Edi.
> 
> 
From: jan
Subject: Re: code completion
Date: 
Message-ID: <ur81tk7ms.fsf@iprimus.com.au>
Lowell Kirsh <······@cs.ubc.ca> writes:

> Most Java IDE's I've used have had a feature called code completion

As already mentioned, `complete-lisp' is the function you're looking
for.  It is part of ilisp. I wouldn't recommend using the bundled
ilisp.  A better version is available here:

http://sourceforge.net/projects/ilisp/


I would also recommend looking at the standard autotyping facilities
emacs provides.  `M-x info' or `C-h i' to get to the info tree, then
search for `autotype'.


In particular, I find `hippie-expand' useful. For example, if I type

(let (arbitrary-symbol-name)
  (setq ar

and then hit M-/ (my hippie-expand binding) it will try the functions
in the list `hippie-expand-try-functions-list' for an expansion. In my
case `try-expand-dabbrev-visible' is used, which searches only text
visible on screen, producing

(let (arbitrary-symbol-name)
  (setq arbitrary-symbol-name

If I don't like the expansion I can hit M-/ repeatedly to cycle
through all the possibilities (I usually get what I want in the first
2 hits).

Other builtin 'try-' functions can complete filenames or lists or
search through open buffers (eg TAGS) for expansions, and ofcourse,
you can write your own.

To customize use `M-x customize-group RET hippie-expand RET' and see
hippie-exp.el for complete documentation.


Finally, lookup abbrevs in the emacs manual.


-- 
jan