Emacs: Don't create #these# files when not saving modified buffer

♀尐吖头ヾ 提交于 2019-12-04 10:59:02

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/1199216/emacs-dont-create-these-files-when-not-saving-modified-buffer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!