[slime-devel] Saving *slime-scratch*

Nikodemus Siivola nikodemus at random-state.net
Fri Apr 27 13:31:25 UTC 2007

The attached patch associates *slime-scratch* with a file
if you name one as "slime-scratch-file". I've been running
slime with this a while, and rather like it.

Something like this was talked about a while ago, and dropped
because of what looked like an ideologinal objection to
scratch-buffers in my mind.

Is the consensus still against this?


   -- Nikodemus

Index: slime.el
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.784
diff -u -r1.784 slime.el
--- slime.el    16 Apr 2007 14:42:33 -0000      1.784
+++ slime.el    27 Apr 2007 13:26:17 -0000
@@ -4570,10 +4570,15 @@
      (set-keymap-parent map lisp-mode-map)

+(defvar slime-scratch-file nil)
  (defun slime-scratch-buffer ()
    "Return the scratch buffer, create it if necessary."
    (or (get-buffer "*slime-scratch*")
-      (with-current-buffer (get-buffer-create "*slime-scratch*")
+      (with-current-buffer (if (not slime-scratch-file)
+                               (get-buffer-create "*slime-scratch*")
+                             (find-file slime-scratch-file))
+        (rename-buffer "*slime-scratch*")
         (use-local-map slime-scratch-mode-map)
         (slime-mode t)

More information about the slime-devel mailing list