Unless you have specified otherwise in your '.emacs' file, Emacs will periodically save the file you are editing into the /var/tmp directory on your workstation.
- You somehow delete your file.
- Your workstation crashes.
- You encounter filesystem errors because you are over quota, or because your fileserver has crashed;
then the auto-save file could be of help. These files are kept for three days before being deleted.
To recover the file, start up emacs with the same filename as you did before, on the SAME WORKSTATION as before. For example, suppose you were editing resume.tex when your workstation crashed. When the workstation becomes usable again, login and do:
Note that when you start up Emacs, it will say:
Auto save file is newer; consider M-x recover-file
This is a hint that the file needs to be recovered from the auto-save file. Look at the file you now have in Emacs; if it's blank or it's not the version you wanted, then you need to recover. DO NOT just begin typing, or Emacs will soon make another auto-save file and clobber the old one.
To recover the auto-save file, type:
Emacs will then show you the date of the auto-save file, just to be sure, and ask you whether you want to recover it. Type 'yes' to recover, or 'no' if you don't want to.
If Emacs says:
Auto save file /var/tmp/#4863. (mit)email@example.com# not current
then the file does not exist on your workstation (ie: you may have misspelled it).
Now save this file under a different name:
e.g. C-x C-w resume.recover
Emacs will not auto-save this recovered file until you type:
This is so you can recover from the old auto-save file again, just in case you change your mind.
Now look at the two files, resume.tex and resume.recover, and take the one you like, or parts of both.