1. Mike Steder
  2. dotfiles


dotfiles / emacs.d / slime-2012-01-20 / contrib / slime-snapshot.el

(define-slime-contrib slime-snapshot
  "Save&restore memory images without disconnecting"
  (:authors "Helmut Eller <heller@common-lisp.net>")
  (:license "GPL v3")
  (:swank-dependencies swank-snapshot))

(defun slime-snapshot (filename &optional background)
  "Save a memory image to the file FILENAME."
  (interactive (list (read-file-name "Image file: ")
  (let ((file (expand-file-name filename)))
    (when (and (file-exists-p file)
	       (not (yes-or-no-p (format "File exists %s.  Overwrite it? " 
      (signal 'quit nil))
     `(,(if background

(defun slime-restore (filename)
  "Restore a memory image stored in file FILENAME."
  (interactive (list (read-file-name "Image file: ")))
  ;; bypass event dispatcher because we don't expect a reply. FIXME.
  (slime-net-send `(:emacs-rex (swank-snapshot:restore-snapshot 
				,(expand-file-name filename))
			       nil t nil)

(provide 'slime-snapshot)