Save and load a SBCL image from/to emacs

Discussion of Common Lisp
Post Reply
E_Blackadder
Posts: 4
Joined: Thu Dec 15, 2011 11:30 pm

Save and load a SBCL image from/to emacs

Post by E_Blackadder » Wed Jan 11, 2012 8:08 pm

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

ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

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

Post by ramarren » Thu Jan 12, 2012 1:08 am

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.

Post Reply