Author

Step 1: Compile CLISP

On Linux, you need to have built your
CLISP with the
--with-module=bindings/glibc option,
and you should make sure that you have it compiled with readline.
See the CLISP build instructions and Makefile.

Step 2: Make CLISP a valid shell

Put /usr/bin/clisp (or /usr/local/bin/clisp)
in /etc/shells so it looks (something) like this:

NB from SDS

Step 4: start X

The startx command is a shell script, so we cannot use it.
As a temporary fix, I have defunned thus:

(defun startx ()
(execute "/usr/X11R6/bin/xinit"))

Which works for me. Although I haven't investigated all the
consequences of not going via shell's startx. Also I do not use
GNOME or
KDE which may complicate
things for you if you do.
I use fvwm2
and have this in my .xinitrc:

exec fvwm2

Once CLISP is set up, you will also be able to type:

> #[xinit]

from Lisp to start X.

NB from SDS

You should be able to run a shell script using the
CLISP built-in function
ext:shell.

Step 5: set up the reader macro

For conveniently running external programs (i.e., I do not want to
have to type (run-program "ls" :arguments '("-lh")) every
time) I have set up a read macro.
Put the following in somefile.lisp:

NB from SDS

Note that
ext:run-program
will not execute shell scripts, while
ext:shell
will invoke a shell for each command - these are the trade-offs.

Step 6: set up the readline shortcut

It's also a PITA to have to type "#[" and "]" everytime you want to
run a command, so add the following in your
$HOME/.inputrc:

#for clash: prints the square brackets to run an external command
"\ec": "#[]\C-b"

When you type ESC-c (or META-c) readline will print "#[]" to the
console and put the cursor inside the brackets. If you are running
CLISP as your shell, and do this, you will then be able to run programs
(more or less) normally. You will need to escape the dot in any
filenames that start with a dot, e.g.,

> #[cat \.xinitrc]

and sometimes (eek) a colon.

Step 7: try it out

Do NOT modify your /etc/passwd yet!

Start up a clisp with

$ clisp -K full -i somefile.fas

Hit ESC c, type ls -l, hit Enter
and see if it works.

You do not have command line completion for external
programs inside the read-macro. So hitting tab will just give you a
list of all CLISP's possibilties, which is not much use here. However,
ext:run-program (which is part of what's hiding behind the
read macro) does search your path for executables so you don't have to
do #[/bin/ls -l]

NB from SDS

There are CLISP built-ins like
ext:dir and
ext:cd, and most other
shell built-ins can be implemented in CLISP pretty easily.

Step 8: Dump a memory image

If you are happy, and think you can live with this setup then you
must do the following:

Dump a memory image from a CLISP with the read macro and any
convenience stuff loaded, as described in
impnotes.

Make a backup of /usr/[local]/lib/clisp.
(wherever yours is installed)

Rename the "base" directory in /usr/lib/clisp
to "orig-base".

Now rename the "full" directory to "base".

Replace the memory image in your new "base"
directory with the one you dumped.