From: Jeffery Zhang
Subject: Emacs code completion
Date: 
Message-ID: <e26cih$t5l$1@ruby.cit.cornell.edu>
How do I setup code completion in Emacs for Lisp? I have code completion 
in the REPL buffer, but not in the Lisp file editing buffers. I saw a 
demo video of Uncommon web and it seems that it's possible to add code 
completion to file editing buffers also. Does anyone know how to do 
this? Thanks

-Jeff

From: Wolfram Fenske
Subject: Re: Emacs code completion
Date: 
Message-ID: <1145492836.786607.40640@u72g2000cwu.googlegroups.com>
The first hit for a Google search on the three words emacs,
completion, lisp was this:
<http://www.delorie.com/gnu/docs/emacs/emacs_294.html>, and it says
it's M-TAB.  If this conflicts with your window manager (it did with
mine), you'll have to reconfigure it or Emacs.


Wolfram
From: Bill Atkins
Subject: Re: Emacs code completion
Date: 
Message-ID: <871wvt5hnw.fsf@rpi.edu>
Jeffery Zhang <····@cornell.edu> writes:

> How do I setup code completion in Emacs for Lisp? I have code
> completion in the REPL buffer, but not in the Lisp file editing
> buffers. I saw a demo video of Uncommon web and it seems that it's
> possible to add code completion to file editing buffers also. Does
> anyone know how to do this? Thanks
>
> -Jeff

If you're using SLIME, it's already there - just use C-TAB in Lisp
buffers.
From: Jeffery Zhang
Subject: Re: Emacs code completion
Date: 
Message-ID: <e26qvb$iv2$1@ruby.cit.cornell.edu>
Neither C-Tab nor M-Tab works. M-Tab is switch app in Windows, and C-Tab 
just does nothing. Do you know what is the actual M-x command for it? 
This way I might be able to bind Tab to it.

Jeffery Zhang wrote:
> How do I setup code completion in Emacs for Lisp? I have code completion 
> in the REPL buffer, but not in the Lisp file editing buffers. I saw a 
> demo video of Uncommon web and it seems that it's possible to add code 
> completion to file editing buffers also. Does anyone know how to do 
> this? Thanks
> 
> -Jeff
From: Ari Johnson
Subject: Re: Emacs code completion
Date: 
Message-ID: <m2ejztf0o0.fsf@hermes.theari.com>
Jeffery Zhang <····@cornell.edu> writes:

> Neither C-Tab nor M-Tab works. M-Tab is switch app in Windows, and
> C-Tab just does nothing. Do you know what is the actual M-x command
> for it? This way I might be able to bind Tab to it.

From describe-key on it:

M-TAB (translated from <M-tab>) runs the command lisp-complete-symbol
   which is an interactive compiled Lisp function in `lisp.el'.
It is bound to M-TAB.
(lisp-complete-symbol &optional predicate)

Perform completion on Lisp symbol preceding point.
Compare that symbol against the known Lisp symbols.
If no characters can be completed, display a list of possible completions.
Repeating the command at that point scrolls the list.
From: Jeffery Zhang
Subject: Re: Emacs code completion
Date: 
Message-ID: <e26rt7$nvg$1@ruby.cit.cornell.edu>
Can I rebind the functions?

Ari Johnson wrote:
> Jeffery Zhang <····@cornell.edu> writes:
> 
> 
>>Neither C-Tab nor M-Tab works. M-Tab is switch app in Windows, and
>>C-Tab just does nothing. Do you know what is the actual M-x command
>>for it? This way I might be able to bind Tab to it.
> 
> 
> From describe-key on it:
> 
> M-TAB (translated from <M-tab>) runs the command lisp-complete-symbol
>    which is an interactive compiled Lisp function in `lisp.el'.
> It is bound to M-TAB.
> (lisp-complete-symbol &optional predicate)
> 
> Perform completion on Lisp symbol preceding point.
> Compare that symbol against the known Lisp symbols.
> If no characters can be completed, display a list of possible completions.
> Repeating the command at that point scrolls the list.
From: ·············@gmail.com
Subject: Re: Emacs code completion
Date: 
Message-ID: <1145506943.161097.187270@g10g2000cwb.googlegroups.com>
Jeffery Zhang wrote:
> Can I rebind the functions?

Yeah, a more useful rebinding is something along the lines of

(slime-define-key [tab] 'slime-indent-and-complete-symbol)

that way tab 'just works' whether you're indenting or completing.
From: Ari Johnson
Subject: Re: Emacs code completion
Date: 
Message-ID: <m24q0pezzm.fsf@hermes.theari.com>
Jeffery Zhang <····@cornell.edu> writes:

> Can I rebind the functions?

Nothing stops you from it.  Also, if you have trouble in the future,
you should try posting on comp.emacs.  There are a lot of people who
use Emacs but don't code in Common Lisp, and you'll get better help as
a result. :)
From: Jeffery Zhang
Subject: Re: Emacs code completion
Date: 
Message-ID: <e26tcu$t1r$1@ruby.cit.cornell.edu>
Ah good advice. Will do that.

Ari Johnson wrote:
> Jeffery Zhang <····@cornell.edu> writes:
> 
> 
>>Can I rebind the functions?
> 
> 
> Nothing stops you from it.  Also, if you have trouble in the future,
> you should try posting on comp.emacs.  There are a lot of people who
> use Emacs but don't code in Common Lisp, and you'll get better help as
> a result. :)
From: Bill Atkins
Subject: Re: Emacs code completion
Date: 
Message-ID: <87r73t3ri1.fsf@rpi.edu>
Jeffery Zhang <····@cornell.edu> writes:

> Neither C-Tab nor M-Tab works. M-Tab is switch app in Windows, and
> C-Tab just does nothing. Do you know what is the actual M-x command
> for it? This way I might be able to bind Tab to it.
>
> Jeffery Zhang wrote:
>> How do I setup code completion in Emacs for Lisp? I have code
>> completion in the REPL buffer, but not in the Lisp file editing
>> buffers. I saw a demo video of Uncommon web and it seems that it's
>> possible to add code completion to file editing buffers also. Does
>> anyone know how to do this? Thanks
>> -Jeff

slime-complete-symbol

But it actually should have been C-c TAB.  Sorry.
From: Marko Kocic
Subject: Re: Emacs code completion
Date: 
Message-ID: <1145522048.828927.253040@e56g2000cwe.googlegroups.com>
M-TAB in Windows works ok, if you know that under windows M could be
either Alt or Esc key ;)
From: Troels Henriksen
Subject: Re: Emacs code completion
Date: 
Message-ID: <87mzeg63ww.fsf@sigkill.dk>
Jeffery Zhang <····@cornell.edu> writes:

> Neither C-Tab nor M-Tab works. M-Tab is switch app in Windows, and
> C-Tab just does nothing. Do you know what is the actual M-x command
> for it? This way I might be able to bind Tab to it.
 
This is probably because your Lisp buffers are not in the SLIME minor
mode.

- 
\  Troels "Athas" Henriksen
/\ - Insert witty signature
From: Surendra Singhi
Subject: Re: Emacs code completion
Date: 
Message-ID: <u08o5g1a.fsf@netscape.net>
Jeffery Zhang <····@cornell.edu> writes:

> Neither C-Tab nor M-Tab works. M-Tab is switch app in Windows, and
> C-Tab just does nothing. Do you know what is the actual M-x command
> for it? This way I might be able to bind Tab to it.
>
> Jeffery Zhang wrote:
>> How do I setup code completion in Emacs for Lisp? I have code
>> completion in the REPL buffer, but not in the Lisp file editing
>> buffers. I saw a demo video of Uncommon web and it seems that it's
>> possible to add code completion to file editing buffers also. Does
>> anyone know how to do this? Thanks
>> -Jeff


If you want to bind the tab key to code completion, put the following in your
init.el file. 

(defun my-set-indent-and-complete-symbol()
  (local-set-key [tab] 'slime-indent-and-complete-symbol))
;feel free to use some other key combination


(add-hook 'slime-mode-hook 'my-set-indent-and-complete-symbol)

;;you can add other modes also, for example:
(add-hook 'emacs-lisp-mode-hook 'my-set-indent-and-complete-symbol)

HTH.
-- 
Surendra Singhi
http://www.public.asu.edu/~sksinghi/index.html

,----
| WHY SHOULD WE SAVE TIGER?  	
| Ans: Saving the tiger means saving mankind..	
| 
| Help http://pudang.tripod.com/
| or https://secure.worldwildlife.org/forms/tiger_appeal_1.cfm
`----
From: Tim X
Subject: Re: Emacs code completion
Date: 
Message-ID: <87veszx0sp.fsf@tiger.rapttech.com.au>
Jeffery Zhang <····@cornell.edu> writes:

> Neither C-Tab nor M-Tab works. M-Tab is switch app in Windows, and
> C-Tab just does nothing. Do you know what is the actual M-x command
> for it? This way I might be able to bind Tab to it.
>
> Jeffery Zhang wrote:
>> How do I setup code completion in Emacs for Lisp? I have code
>> completion in the REPL buffer, but not in the Lisp file editing
>> buffers. I saw a demo video of Uncommon web and it seems that it's
>> possible to add code completion to file editing buffers also. Does
>> anyone know how to do this? Thanks
>> -Jeff

Possibly a stupid question, but are you sure your lisp file is in
slime mode? I only ask because depending on how slime has been
installed and what you are using for your lisp file extensions, it is
not unusual for slime mode not to be automatically enabled when
editing lisp files.

Tim

-- 
tcross (at) rapttech dot com dot au
From: Rob Thorpe
Subject: Re: Emacs code completion
Date: 
Message-ID: <1145523961.541801.29190@j33g2000cwa.googlegroups.com>
Jeffery Zhang wrote:
> How do I setup code completion in Emacs for Lisp? I have code completion
> in the REPL buffer, but not in the Lisp file editing buffers. I saw a
> demo video of Uncommon web and it seems that it's possible to add code
> completion to file editing buffers also. Does anyone know how to do
> this? Thanks

As others have pointed out Alt-Tab doesn't work as normal on MS
Windows, buy Esc-Tab does.

But I find it most useful to load all the relevant files for a project
and then use M-/