From: r_stiltskin
Subject: emacs inferior-lisp problem
Date: 
Message-ID: <34652cb414a4081af218ab663cf90bdd@localhost.talkaboutprogramming.com>
I have installed emacs-22gtk and sbcl in a new kubuntu-feisty
installation.

Emacs starts up OK and I can M-x run-lisp and that gives me an
*inferior-lisp* buffer with sbcl interpreter which as far as I can tell
seems to work correctly.

When I type a lisp expression in the *scratch* buffer I can type C-j and
it is evaluated right there in the *scratch* buffer (but as far as I can
tell this has nothing to do with the inferior-lisp buffer because it works
even without running the inferior-lisp).

I have read in various tutorials that I should be able to write lisp
expressions in the *scratch* buffer and type C-M-x to send them to the
inferior-lisp buffer.  I'm not sure exactly how this should look, but when
I try it, it has no effect at all.  Exactly what is it supposed to do and
how can I fix it?

--
Message posted using http://www.talkaboutprogramming.com/group/comp.lang.lisp/
More information at http://www.talkaboutprogramming.com/faq.html

From: Tim X
Subject: Re: emacs inferior-lisp problem
Date: 
Message-ID: <87ir5khhgq.fsf@lion.rapttech.com.au>
"r_stiltskin" <········@very.spam.yahoo.com> writes:

> I have installed emacs-22gtk and sbcl in a new kubuntu-feisty
> installation.
>
> Emacs starts up OK and I can M-x run-lisp and that gives me an
> *inferior-lisp* buffer with sbcl interpreter which as far as I can tell
> seems to work correctly.
>
> When I type a lisp expression in the *scratch* buffer I can type C-j and
> it is evaluated right there in the *scratch* buffer (but as far as I can
> tell this has nothing to do with the inferior-lisp buffer because it works
> even without running the inferior-lisp).
>
> I have read in various tutorials that I should be able to write lisp
> expressions in the *scratch* buffer and type C-M-x to send them to the
> inferior-lisp buffer.  I'm not sure exactly how this should look, but when
> I try it, it has no effect at all.  Exactly what is it supposed to do and
> how can I fix it?
>
> --

I suspect your getting confused between emacs lisp and common
lisp. Normally, the scratch buffer is configured to evaluate emacs lisp
expressions. so, when you hit C-x C-e, the expression is being sent to an
inferior emacs lisp, not sbcl or common lisp. (same with C-M-x)

You may be able to change this by changing the mode of the scratch buffer
and ensuring things are referencing common -lisp rather than just lisp. In
general, references to lisp ar referring to emacs lisp. Only references
including the 'common' lisp keyword are actually using common lisp (there
are exceptions, which is why I say 'in general').

As you are running ubuntu, the best solution is to do

apt-get slime

this will install SLIME (Superior Lisp Interactive Mode). 

Tim

-- 
tcross (at) rapttech dot com dot au
From: r_stiltskin
Subject: Re: emacs inferior-lisp problem
Date: 
Message-ID: <3294cc28852106f6cfa55991c0c6cf7e@localhost.talkaboutprogramming.com>
Thanks.  I had already installed slime but was having the same problem with
or without it.

I finally found that C-c C-c and C-c C-e and M-x lisp-eval-defun all
produce the effect that I was expecting from C-M-x.  (I don't see any
difference among those 3 commands.)

The problem is that while there is plenty of documentation on lisp and
plenty of documentation on emacs, I have not found much to explain how to
use emacs effectively as an ide for lisp to students who are familiar with
neither emacs nor lisp.  A lot of tutorials hint that lisp-in-emacs (not
necessarily emacs-lisp) is a "great" combination, and mention a few
commands, but don't give much explanation of how to proceed.  The Gnu
Emacs Manual has a brief section on "evaluating emacs-lisp expressions"
which mentions the C-M-x command, so I guess that command only applies to
emacs-lisp as you suggested.

Peter Seibel's Practical Common Lisp is the best online source I have
found so far.  Do you know of other good ones?

--
Message posted using http://www.talkaboutprogramming.com/group/comp.lang.lisp/
More information at http://www.talkaboutprogramming.com/faq.html
From: Icarus Sparry
Subject: Re: emacs inferior-lisp problem
Date: 
Message-ID: <4707cdd8$0$79889$742ec2ed@news.sonic.net>
On Sat, 06 Oct 2007 12:13:05 -0400, r_stiltskin wrote:

> Thanks.  I had already installed slime but was having the same problem
> with or without it.
> 
> I finally found that C-c C-c and C-c C-e and M-x lisp-eval-defun all
> produce the effect that I was expecting from C-M-x.  (I don't see any
> difference among those 3 commands.)

Emacs has a "describe-key" function, typically bound to Control-H k, 
which will show you the documentation for the command bound to the key 
sequence.
From: Tim X
Subject: Re: emacs inferior-lisp problem
Date: 
Message-ID: <871wc74jga.fsf@lion.rapttech.com.au>
Icarus Sparry <······@icarus.freeuk.com> writes:

> On Sat, 06 Oct 2007 12:13:05 -0400, r_stiltskin wrote:
>
>> Thanks.  I had already installed slime but was having the same problem
>> with or without it.
>> 
>> I finally found that C-c C-c and C-c C-e and M-x lisp-eval-defun all
>> produce the effect that I was expecting from C-M-x.  (I don't see any
>> difference among those 3 commands.)
>
> Emacs has a "describe-key" function, typically bound to Control-H k, 
> which will show you the documentation for the command bound to the key 
> sequence.
>
>

There is also C-h b, which will show you all the keys that have a binding
in a specific mode. Often, describe function (C-h f) will provide some
useful information on using a specific function (for example  C-h f slime
<ret>. However, note that sometime, the documentation is not available
until the function has been loaded. 

another good source of information is the emacs wiki
http://www.emacswiki.org/ and I tink there is some slime related
information on http://common-lisp.net/ and http://www.cliki.net/

Tim
 
-- 
tcross (at) rapttech dot com dot au
From: Leandro Rios
Subject: Re: emacs inferior-lisp problem
Date: 
Message-ID: <4708e2b9$0$1342$834e42db@reader.greatnowhere.com>
r_stiltskin escribi�:
> Thanks.  I had already installed slime but was having the same problem with
> or without it.
> 
> I finally found that C-c C-c and C-c C-e and M-x lisp-eval-defun all
> produce the effect that I was expecting from C-M-x.  (I don't see any
> difference among those 3 commands.)
> 
> The problem is that while there is plenty of documentation on lisp and
> plenty of documentation on emacs, I have not found much to explain how to
> use emacs effectively as an ide for lisp to students who are familiar with
> neither emacs nor lisp.  A lot of tutorials hint that lisp-in-emacs (not
> necessarily emacs-lisp) is a "great" combination, and mention a few
> commands, but don't give much explanation of how to proceed.  The Gnu
> Emacs Manual has a brief section on "evaluating emacs-lisp expressions"
> which mentions the C-M-x command, so I guess that command only applies to
> emacs-lisp as you suggested.
> 
> Peter Seibel's Practical Common Lisp is the best online source I have
> found so far.  Do you know of other good ones?
> 

You should get Lispbox or slime working:

Lispbox is a bundle of emacs+slime: http://www.gigamonkeys.com/lispbox/

If you want to use your emacs and lisp:

Install emacs, sbcl and slime using apt-get or synaptic.

edit your .emacs (in your home directory) and add the following lines:

(setq inferior-lisp-program "sbcl")
(require 'slime)

Save it and restart emacs. Once it is loaded, type M-x slime [return]
and you should have a repl running in an emacs buffer.

That is a basic setup. Later you can add access to the Hyperspec, sbcl 
manual, lispdoc,Cltl2...

Get the slime manual: http://common-lisp.net/project/slime/
Get the slime movie by Marco Baringer: http://bc.tech.coop/blog/050728.html

If you want to see a commercial lisp ide, get Rainer Joswig's movie: 
http://bc.tech.coop/blog/050711.html

There are many books for free. Google for "common lisp book free" and 
you'll find some.

hth,

Leandro