How do I change where my scratch buffer is saved?
How d开发者_JAVA百科o 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.)
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)
精彩评论