A suggestion for more efficient use of the Lisp interpreter clisp
Copyright Gunnar Gotshalks
Use two emacs windows. One window is used to edit a file for loading into
the lisp interpreter. The other is to run clisp. By running clisp from within
emacs you can use all the editing commands of emacs to create and modify
s-expressions. Also you get a complete history which can be cut and paste
into new s-expressions or in the file in the other window. For example using
the up arrow you can go back in history to a previous command and re-execute it
by pressing return.
Emacs has a tutorial and other help facilities available from the menu. The basic editing
commands are avaialbe from the menu with keyboard shortcuts indicated.
- From an xterm session run start two emacs sessions.
% emacs & emacs &
- In one of the windows execute the following commands.
- Get the csh shell running within emacs (ESC-x means press and hold the
escape key and then press x. Within emacs it is a modifier key similar to
shift and control)
Within the window you can now do all that you do at an xterm window plus all the Emacs editing
- Check that you are running csh
% echo $TERM
should return /cs/local/bin/csh. If not start the shell with the following command.
- Remove the command line echo by entering the following command.
% stty -echo
- Now you can enter the lisp interpreter.
- Test it by trying out a few s-epressions. Then use the up arrow to go
back to a previous s-epression and press return. The s-expression will be
entered and executed for you at the end of the bufer. This is particularily
useful for reloading files.
- Create a function definition, or setq expression in the other emacs
window and save it to a file.
- In the "clisp" window. Load the file. Check the value of a variable which
you "setq"'ed or execute a function you defined. Note that when loading files
you do not see the results of any s-expressions. On loading only internal
data structures are modified.