Como faço para impedir que o emacs crie arquivos de backup?

7

Eu sei que provavelmente há uma razão muito boa para isso (ou seja, backup) - mas por motivos pessoais (é só me aborrecer), é possível impedir o emacs de criar um backup de todos os arquivos que eu edito? Estou falando de quando ele cria um arquivo anexado com o caractere ~ .

FooBar
FooBar~
HelloWorld
HelloWorld~
    
por Nick Bolton 16.12.2009 / 18:39

1 resposta

12

Coloque no seu arquivo .emacs.

(setq make-backup-files nil) ; stop creating ~ files

O que a variável faz ...

make-backup-files is a variable defined in 'files.el'.

Non-nil means make a backup of a file the first time it is saved. This can be done by renaming the file or by copying.

Renaming means that Emacs renames the existing file so that it is a backup file, then writes the buffer into a new file. Any other names that the old file had will now refer to the backup file. The new file is owned by you and its group is defaulted.

Copying means that Emacs copies the existing file into the backup file, then writes the buffer on top of the existing file. Any other names that the old file had will now refer to the new (edited) file. The file's owner and group are unchanged.

Eu prefiro fazer o backup dos arquivos em 1 diretório ~/.Trash/ .

(setq backup-directory-alist            '((".*" . "~/.Trash")))
    
por 16.12.2009 / 18:46

Tags