如何更改保存缓冲区的位置?

时间:2009-12-09 17:52:48

标签: emacs

如何更改保存缓冲区的位置? (我问,因为我在多台计算机之间rsync了几个文件夹,并且希望使用临时缓冲区。)

1 个答案:

答案 0 :(得分:4)

将此添加到.emacs文件应该可以解决问题。显然,为临时缓冲区自定义文件。

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