开发者

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜