Reputation: 9244
I find that there are a lot of files like the one below generated by Emacs. What are those files ? And is there anyone that I can put them in one place and stop hanging around in the project ?
app/helpers/#application_helper.rb#
Thanks
Upvotes: 0
Views: 242
Reputation:
These files are automatically saved versions of files edited by Emacs. You can tell Emacs to put all auto-save files and all backup files (those ending on ~
) in one place by adding this to your .emacs
or .emacs.d/init.el
file:
(setq backup-directory-alist
`((".*" . ,(expand-file-name
(concat user-emacs-directory "backups"))))
(setq auto-save-file-name-transforms
`((".*" ,(expand-file-name
(concat user-emacs-directory "backups") t)))
This will set the directory to be ~/.emacs.d/backups/
. Another common thing to do is setting the directory to the temp directory:
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
Alternatively, you could completely disable auto-saving but this is not recommended.
EDIT: I just found this related question with lots of advice on how to configure this behaviour: How do I control how Emacs makes backup files?
Upvotes: 2