Page 1 of 1

Save and load a SBCL image from/to emacs

Posted: Wed Jan 11, 2012 8:08 pm
by E_Blackadder
Hi all,

My FreeBSD machine has had a panic and wants to shutdown, and I have a rather large SBCL image running from within EMACS/Slime. I was wondering if I could save the image with (save-lisp-and-die) from the REPL but then when I restart how do I tell EMACS to loaded this saved image next time?


Thanks in advance,

Daniel

Re: Save and load a SBCL image from/to emacs

Posted: Thu Jan 12, 2012 1:08 am
by ramarren
SBCL cannot save an image if there are multiple threads running, and Slime by default uses a separate thread for communicating with a listener. Unless you use an alternative communication mode saving an image from that state would be difficult. You could try arranging the core to save itself after killing swank threads, but I have no idea how to do that and trying things would probably just shut down the image.

Not that it matters if you cannot create one, but using a preexisting image from Emacs is much simpler. You can either add a "--core" argument to slime-lisp-implementation variable, or start a swank server (by loading swank, slime server component, and doing swank:create-server) and connect to it from emacs with slime-connect.