开发者

How do I change where my scratch buffer is saved?

开发者 https://www.devze.com 2022-12-13 19:44 出处:网络
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.)Add

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

精彩评论

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