In ABCL how do I break from a runaway function without killing LISP?

108 Views Asked by At

In ABCL, during development I sometimes get runaway functions. I want to be able to stop execution and return to top level LISP without killing the LISP/JVM process (in my emacs shell) and losing my current LISP environment.

I've tried various control keys (e.g., Control-C, Control-D,...) but at best end up killing LISP or the JVM.

;;; How to stop this function and return to LISP interactive ;;; without killing lisp...? (defun runaway () (let ((result nil)) (dotimes (count 10 result) (sleep 2) (print count))))

C-c C-cTerminate batch job (Y/N)? n n

Process inferior-lisp exited abnormally with code 130

1

There are 1 best solutions below

0
On

Try using Emacs with Slime instead, because Slime does not kill the process but interrupt the thread and enters the debugger if you press C-c C-c.

You should probably add an executable script abcl.sh somewhere in your PATH, as follows:

#!/bin/sh
exec java -jar .../abcl/abcl-bin-1.5.0/abcl.jar

You have to replace ... with your own path to abcl.jar.

Then, from Emacs, you should be able to start it.

Do C-u M-x slime to force the slime command to prompt for an executable, and give abcl.sh to it. It should start the process and connect to it using the Slime protocol.