How do I change where my scratch buffer is saved? (I ask because I rsync a couple of folders between multiple computers and would like the scratch buffer to come along for the ride.)
+4
A:
Adding this to your .emacs
file should do the trick. Obviously customize the file for the scratch buffer.
(defvar scratch-buffer-file-name "~/sktch.el"
"file name for *scratch* buffer")
(defun synch-scratch-with-file ()
"replace *scratch* buffer with the file scratch-buffer-file-name"
(save-window-excursion
(find-file scratch-buffer-file-name)
(kill-buffer "*scratch*")
(rename-buffer "*scratch*")
(lisp-interaction-mode)))
(synch-scratch-with-file)
Trey Jackson
2009-12-09 18:25:44