Emacs: Don't create #these# files when not sav

2019-03-19 16:50发布

How do I prevent Emacs from creating backup copies of buffers I don't wish to save when I kill buffers that have not been saved?

3条回答
冷血范
2楼-- · 2019-03-19 16:57

If you don't want emacs to litter your drive with backup files try adding the following to your .emacs file:

(setq backup-directory-alist '(("." . "~/emacs-backups")))

This will store every backup in a single location.

查看更多
Summer. ? 凉城
3楼-- · 2019-03-19 16:57

I would advice you to use something like:

(defvar backup-dir "~/.emacs.d/backups/")
(setq backup-directory-alist (list (cons "." backup-dir)))

This way you can have all backup files in one directory.

查看更多
走好不送
4楼-- · 2019-03-19 16:58

See Here

Short version: put

(setq make-backup-files nil)

in you .emacs file, or toggle this feature at any time with M-x auto-save-mode.

Here is the Emacs Manual Node.

查看更多
登录 后发表回答