Emacs has two helpful features, called
auto-save(or at least I call them this way).
Auto-backup is triggered when you save a file - it will keep the old
version of the file around, adding a
~ to its name. So if you saved the
foo, you’d get
foo~ as well.
auto-save-mode auto-saves a file every few seconds or every few
characters(both settings are configurable -
set to 300 characters by default and
auto-save-timeout is set to 30
seconds). The auto-save files have names like
#foo# and are deleted
automatically when you manually save a file.
Although the modes are definitely useful, many Emacs users find the extra files they create quite annoying(especially since they rarely resort to using them) and disable both feature to get rid of the pesky unwanted files:
1 2 3
Even though I’ve never actually had any use of those backups, I still
think it’s a bad idea to disable them(most backups are eventually
useful). I find it much more prudent to simply get them out of sight
by storing them in the OS’s
tmp directory instead.
1 2 3 4 5
Now they won’t annoy you constantly, but they will still be around if
you need them. Some OSes delete everything in their
on restart, so if this worries you - consider using another directory.
Prelude keeps auto-backup and
auto-save files in
tmp by default.