From: Rob Warnock on
Pascal J. Bourguignon <pjb(a)informatimago.com> wrote:
+---------------
| ... You could also provide an access to you implementation
| by writing a telnet server (for example, you could try Allegro CL
| with telnet://prompt.franz.com/
+---------------

By the way, this hasn't worked for some time:

% telnet prompt.franz.com
Trying 206.169.106.7...
telnet: connect to address 206.169.106.7: Operation timed out
telnet: Unable to connect to remote host
%

[Duane?]


-Rob

-----
Rob Warnock <rpw3(a)rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607

From: Captain Obvious on

HB> (add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
HB> (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))
HB> ;; Optionally, specify the lisp program you are using. Default is
HB> "lisp"
HB> (setq inferior-lisp-program "swank-clisp.lisp")

I think this is a problem, inferior-lisp-program should be a path to a
Common Lisp implementation you have.

E.g. you download CLISP here: http://clisp.cons.org/ (check for download
link for win32 on the right).
Install it to c:\lisp\clisp-2.48

Then you should set

(setq inferior-lisp-program "c:/lisp/clisp-2.48/clisp.exe")

Also, here's a better way to configure SLIME:

(add-to-list 'load-path "c:/slime")
(add-to-list 'load-path "c:/slime/contrib")
(require 'slime)
(slime-setup '(slime-fancy))
(setq inferior-lisp-program "c:/lisp/clisp-2.48/clisp.exe")

This will load all fancy features too so you have a full experience.

From: Haris Bogdanovic on
Ok, I installed slime in emacs but I'm confused now.
Load-file doesn't work anymore.
What things have changed now, opposite to emacs lisp ?
Does elisp or clisp evaluate expression now and with what command, C-x C-e ?
Every time I start emacs I type M-x slime to start it. How can I automate
that ?
Is there in *slime-repl-clisp* cursor up command like in command prompt to
get last (previous) entry ?
How do I load lisp file now, to get it visible to clisp ?

This is in my init.el:

(setq inferior-lisp-program "C:/lisp/clisp-2.48/clisp.exe")
(add-to-list 'load-path "c:/lisp/slime")
(add-to-list 'load-path "c:/lisp/slime/contrib")
(require 'slime)
(slime-setup '(slime-fancy))


From: Captain Obvious on
HB> Ok, I installed slime in emacs but I'm confused now.
HB> Load-file doesn't work anymore.

load-file is for loading code into Emacs itself. It is not in any way
related to Common Lisp programs/files.
After installing SLIME it should work just as it was working before.

HB> What things have changed now, opposite to emacs lisp ?

SLIME doesn't change things, it adds new things -- now your Emacs supports
working with Common Lisp.

You can see a lot of different "buffers" in your Emacs. Buffer is roughly
like a window -- it can represent an open file or some other feature.

SLIME only works in buffers which are somehow related to SLIME. Other
buffers are unaffected.
Those SLIME buffers are:

* SLIME REPL -- that's where you enter interactive commands. You can have
more than one REPL, but it's better to have just one to avoid mess.
* Common Lisp source files. SLIME is automatically enabled for some file
extensions, for example, *.lisp. It is a recommeneded extension. That is,
you should write your program's source code into a file, say, foo.lisp, and
then SLIME will be enabled automatically for this file. Of course, you can
have more than one file. If you open a file which does not exists yet from
Emacs, Emacs will create it for you.
You can see what mode you're working in buffer's status line. You can
also enable SLIME mode for any file regardless of its name.
* SLIME scratch -- if you want to write some code without saving it to a
file, but you don't like editing it in REPL, you can use scratch buffer. It
can be opened via M-x slime-scratch.

HB> Does elisp or clisp evaluate expression now and with what command, C-x
HB> C-e ?

If you're in one of SLIME's buffers -- either editing source code or in
slime-scratch, clisp will evaluate it. Otherwise that might be elisp or
something else.

Yes, C-x C-e is one of commands to evaluate something.

There are other commands too. Perhaps, more frequently used is C-M-x (called
slime-eval-defun), it is better because it automatically evaluates a whole
function or expression so you don't need to worry about that.
There is a similar command C-c C-c (called slime-compile-defun) -- a close
relative to slime-eval-defun, but it compiles a function rather than merely
evaluates it. It will automatically highlight warnings if you're lucky
enough.

You can find a full list of commands in SLIME's manual, check section 3.

http://common-lisp.net/project/slime/doc/html/

HB> Every time I start emacs I type M-x slime to start it. How can I
HB> automate that ?

Add (slime) to the end of your init.el.

HB> Is there in *slime-repl-clisp* cursor up command like in command prompt
HB> to get last (previous) entry ?

Yes, M-p goes to previous command, M-n goes to next.

HB> How do I load lisp file now, to get it visible to clisp ?

If you're going to work with this file, open it in Emacs (File -> visit
file -> enter filename, use TAB for completion), then you should see SLIME
menu available from this file, and you can choose Compilation ->
Compile/Load file. That will compile and load a whole file into clisp.
After that, you can edit functions and evaluate or compile them one by one,
without a need to recompile whole file. But you can still compile a whole
file, if you edited a lot, for example.
Note that Emacs menus often have keybindings listed near commands, this is
very useful -- you can call a lot of stuff from menus without learning keys,
but later memorize keys if you do some command frequently.

If you do not want to view or edit this file, but just load it into clisp,
you can use command slime-load-file or call Common Lisp function directly in
the REPL, e.g.

(load "c:\\lisp\\source\\foo.lisp")

In later case you need to be careful with relative pathnames, clisp's idea
of what the current directory is might be different from Emacs' idea.

Finally, if you have a program which comprises multiple files, there is a
way to organize it in a nice way, so dependencies are loaded properly etc.
It is called ASDF. It is an advanced topic, I'm only mentioning it so you
don't have an impression that people who program in Common Lisp load their
programs loading files one by one manually. There are better ways to deal
with larger programs, but if you work on a small program, one file is OK.

From: Haris Bogdanovic on
It opens whole new menus when working with *.lisp file.
When I enetered M-x load-file in elisp, whole file was like evaluated
so I could call functions from it in *scratch*.
When I load-file and then try to call some function from *slime-repl-clisp*
it is not recognized. What to I have to do when I open file or add some code
to it
so it gets recognized by slime: save it and then load/compile or compile ?
I cannot like evaluate the whole file ?
It appears that slime gets disconnected sometimes so all slime menus become
greyed
and I have to enter M-x slime to get it work again. Why is that ?
Can I set default directory for emacs when I press open file or
enter M-x load-file ?
Why does emacs ask me do I want another buffer *inferior-lisp* ?