From: Daniel Klein
Subject: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <b249j3t107ivafqg3p0gfgbkbad6lmb6gt@4ax.com>
Just received my copy of Practical Common Lisp from Amazon. I was
eager to get into it but I've encountered a problem.

On page 15 (Chapter 2, Section 'Saving Your Work') it states:

"Now you can get this definition into your Lisp environment in several
ways. The easiest is to type C-c C-c with the cursor anywhere in or
immediately after the DEFUN form, which runs the command
slime-compile-defun, which in turn sends the definition to Lisp to be
evaluated and compiled."

It appears that C-c C-c is not a valid command, or I am just not doing
something correctly.

I can compile a defun in the scratch buffer with C-x C-e but how to
get that into the REPL?

I am obviously very new at all of this.

Can someone clarify how to do the compile in Lispbox?

Daniel Klein

From: Jason
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <1194628792.106962.11550@e34g2000pro.googlegroups.com>
On Nov 9, 9:04 am, Daniel Klein <·······@featherbrain.net> wrote:
> Just received my copy of Practical Common Lisp from Amazon. I was
> eager to get into it but I've encountered a problem.
>
> On page 15 (Chapter 2, Section 'Saving Your Work') it states:
>
> "Now you can get this definition into your Lisp environment in several
> ways. The easiest is to type C-c C-c with the cursor anywhere in or
> immediately after the DEFUN form, which runs the command
> slime-compile-defun, which in turn sends the definition to Lisp to be
> evaluated and compiled."
>
> It appears that C-c C-c is not a valid command, or I am just not doing
> something correctly.
>
> I can compile a defun in the scratch buffer with C-x C-e but how to
> get that into the REPL?
>
> I am obviously very new at all of this.
>
> Can someone clarify how to do the compile in Lispbox?
>
> Daniel Klein

C-c C-c simply means hold the <control> key while pressing the <c> key
twice.

You should see a message like this in the the messages bar on the
bottom of Emacs: Compilation finished: 0 errors  0 warnings  0 notes
[0.00 secs]

-Jason
From: Daniel Klein
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <td79j31qudt9bessqvo005lla165tf0s6b@4ax.com>
On Fri, 09 Nov 2007 09:19:52 -0800, Jason <·······@gmail.com> wrote:

>C-c C-c simply means hold the <control> key while pressing the <c> key
>twice.
>
>You should see a message like this in the the messages bar on the
>bottom of Emacs: Compilation finished: 0 errors  0 warnings  0 notes
>[0.00 secs]
>

I've tried it exactly as you say (in both the REPL and the 'scratch'
buffers) but the message buffer says that that keycord is 'undefined'.

Apparently I do not have this key binding defined.

I have the Allegro version of Lispbox installed on a Windows XP Pro
SP2 system.

I'm going to try installing the clisp version of Lispbox to see of
that makes a difference.

Dan
From: Daniel Klein
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <5pc9j39ldrhqmi03p0ti37rtk3rajubav0@4ax.com>
On Fri, 09 Nov 2007 12:58:52 -0500, Daniel Klein
<·······@featherbrain.net> wrote:

>On Fri, 09 Nov 2007 09:19:52 -0800, Jason <·······@gmail.com> wrote:
>
>>C-c C-c simply means hold the <control> key while pressing the <c> key
>>twice.
>>
>>You should see a message like this in the the messages bar on the
>>bottom of Emacs: Compilation finished: 0 errors  0 warnings  0 notes
>>[0.00 secs]
>>
>
>I've tried it exactly as you say (in both the REPL and the 'scratch'
>buffers) but the message buffer says that that keycord is 'undefined'.
>
>Apparently I do not have this key binding defined.
>
>I have the Allegro version of Lispbox installed on a Windows XP Pro
>SP2 system.
>
>I'm going to try installing the clisp version of Lispbox to see of
>that makes a difference.

I just noticed that when you drop down the REPL menu it shows the
following entry:

Interrupt Lisp process      (C-c C-c)

So how could this keycord also mean 'compile'?

I would still like to know how to compile a file in Lispbox. Or is the
same as doing a (load "hello-world.lisp") ?

Daniel Klein
From: Eirik Mikkelsen
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <m2r6izi4ym.fsf@-gmail.com>
Daniel Klein <·······@featherbrain.net> writes:
>>I've tried it exactly as you say (in both the REPL and the 'scratch'
>>buffers) but the message buffer says that that keycord is 'undefined'.

I think you are in the Emacs lisp scratch buffer, where C-c C-c is not
defined. C-x C-e will evaluate your lisp expression - as Emacs lisp :)

You should visit a file, e.g. "foo.lisp" to get Emacs into SLIME mode.
In this mode C-c C-c will compile the expression. Look at your mode 
line to see what mode your emacs is in.

> I just noticed that when you drop down the REPL menu it shows the
> following entry:
>
> Interrupt Lisp process      (C-c C-c)
>
> So how could this keycord also mean 'compile'?

The C-c C-c interrupt command works in the REPL mode.

Eirik
From: Tobias C. Rittweiler
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <87wssrp4sv.fsf@freebits.de>
Daniel Klein <·······@featherbrain.net> writes:

> I would still like to know how to compile a file in Lispbox. Or is the
> same as doing a (load "hello-world.lisp") ?

`C-c C-k' is bound to `slime-compile-and-load-file' in a file-buffer
with slime-mode enabled.

HTH,

  -T.
From: Zach Beane
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <m33avfkzoc.fsf@unnamed.xach.com>
Daniel Klein <·······@featherbrain.net> writes:

> Just received my copy of Practical Common Lisp from Amazon. I was
> eager to get into it but I've encountered a problem.
>
> On page 15 (Chapter 2, Section 'Saving Your Work') it states:
>
> "Now you can get this definition into your Lisp environment in several
> ways. The easiest is to type C-c C-c with the cursor anywhere in or
> immediately after the DEFUN form, which runs the command
> slime-compile-defun, which in turn sends the definition to Lisp to be
> evaluated and compiled."
>
> It appears that C-c C-c is not a valid command, or I am just not doing
> something correctly.

C-c C-c is for file buffers, not the REPL. To evaluate things in the
REPL, just enter them.

For C-c C-c to work in a buffer, you must start slime with M-x slime
and have the buffer in Slime mode.

Zach
From: Jason
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <1194639700.313993.57070@v23g2000prn.googlegroups.com>
On Nov 9, 11:05 am, Zach Beane <····@xach.com> wrote:
> Daniel Klein <·······@featherbrain.net> writes:
> > Just received my copy of Practical Common Lisp from Amazon. I was
> > eager to get into it but I've encountered a problem.
>
> > On page 15 (Chapter 2, Section 'Saving Your Work') it states:
>
> > "Now you can get this definition into your Lisp environment in several
> > ways. The easiest is to type C-c C-c with the cursor anywhere in or
> > immediately after the DEFUN form, which runs the command
> > slime-compile-defun, which in turn sends the definition to Lisp to be
> > evaluated and compiled."
>
> > It appears that C-c C-c is not a valid command, or I am just not doing
> > something correctly.
>
> C-c C-c is for file buffers, not the REPL. To evaluate things in the
> REPL, just enter them.
>
> For C-c C-c to work in a buffer, you must start slime with M-x slime
> and have the buffer in Slime mode.
>

This is the key. If you are typing in *scratch* then you are using a
buffer in "Lisp Interaction" mode, which is a completely different
animal. On my system, if I run slime then open any .lisp file, the
file mode shows as "Lisp Slime". C-c C-c works just fine there.
From: Daniel Klein
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <9qmcj352hq5i7qh7320jlape1jsvgrdhar@4ax.com>
On Fri, 09 Nov 2007 12:21:40 -0800, Jason <·······@gmail.com> wrote:

>On Nov 9, 11:05 am, Zach Beane <····@xach.com> wrote:
>> Daniel Klein <·······@featherbrain.net> writes:
>> > Just received my copy of Practical Common Lisp from Amazon. I was
>> > eager to get into it but I've encountered a problem.
>>
>> > On page 15 (Chapter 2, Section 'Saving Your Work') it states:
>>
>> > "Now you can get this definition into your Lisp environment in several
>> > ways. The easiest is to type C-c C-c with the cursor anywhere in or
>> > immediately after the DEFUN form, which runs the command
>> > slime-compile-defun, which in turn sends the definition to Lisp to be
>> > evaluated and compiled."
>>
>> > It appears that C-c C-c is not a valid command, or I am just not doing
>> > something correctly.
>>
>> C-c C-c is for file buffers, not the REPL. To evaluate things in the
>> REPL, just enter them.
>>
>> For C-c C-c to work in a buffer, you must start slime with M-x slime
>> and have the buffer in Slime mode.
>>
>
>This is the key. If you are typing in *scratch* then you are using a
>buffer in "Lisp Interaction" mode, which is a completely different
>animal. On my system, if I run slime then open any .lisp file, the
>file mode shows as "Lisp Slime". C-c C-c works just fine there.

Thanks everyone. Your responses allowed me to finally get it sorted
out.

The mistake I made was using '.cl' instead of '.lisp' for the file
extension. I will go stand in the corner now...

Dan
From: Barry Fishman
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <m364086ek3.fsf@barry_fishman.acm.org>
Daniel Klein <·······@featherbrain.net> writes:
> Thanks everyone. Your responses allowed me to finally get it sorted
> out.
>
> The mistake I made was using '.cl' instead of '.lisp' for the file
> extension. I will go stand in the corner now...

You can add the following to you .emacs file:

(add-to-list 'auto-mode-alist '("\\.cl\\'" . lisp-mode))

and emacs will consider files ending in '.cl' to be lisp.

-- 
Barry Fishman
From: Daniel Klein
Subject: Re: Help getting started with Lispbox and Practical Common Lisp
Date: 
Message-ID: <tnkgj3hluuuravjv35s39jq3b9bslcttue@4ax.com>
On Sun, 11 Nov 2007 14:29:33 GMT, Barry Fishman
<·············@acm.org> wrote:

>Daniel Klein <·······@featherbrain.net> writes:
>> Thanks everyone. Your responses allowed me to finally get it sorted
>> out.
>>
>> The mistake I made was using '.cl' instead of '.lisp' for the file
>> extension. I will go stand in the corner now...
>
>You can add the following to you .emacs file:
>
>(add-to-list 'auto-mode-alist '("\\.cl\\'" . lisp-mode))
>
>and emacs will consider files ending in '.cl' to be lisp.

Thanks for the tip, but it is my understanding that Lispbox does not
use my .emacs file. According to http://www.gigamonkeys.com/lispbox/:

"it doesn't load your ~/.emacs file if you have one."

I've done a search in the Lispbox and Allegro directories and there
doesn't seem to be any .emacs file to modify.

Daniel Klein