tags:

views:

360

answers:

3

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?

+7  A: 

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.

kjfletch
Links are OK, but it is better to copy the actual soution into StackOverflow then to count on it remaining indefinitly somewhere out on the web...
dmckee
Thank you for editing. I have to admit I rushed it. If you look in the revision, I did post an example but was not in the situation to test it. So I removed it.
kjfletch
I should point out that the OP asked how to disable `auto-save`, not how to disable `backup-files`, as this answer suggests.
Michiel Buddingh'
+1  A: 

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.

simao
+5  A: 

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.

indy
I'm not sure tat this really answers the question, but I like it.
dmckee
You're right, I just assumed the reason that skurpur wanted to disable backups was because of all those messy droppings that Emacs leaves behind. Setting the backup-directory-alist variable is just a simple way of house training it.
indy