Skip to content Accesskey=4Skip to sub-navigation Accesskey=3View our Accessibility Options MIT Information Systems Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

On This Page

[Help]

  

Quick Links

Top Level

Related Links

Ask OLC a question

Athena Consulting Homepage

Helpdesk Stock Answers (for Mac/PC questions)


How to recover Emacs AUTOSAVE files

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.

If:
	1) You somehow delete your file.
	2) Your workstation crashes.
	3) 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:

	emacs resume.tex &

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:

	M-x recover-file RETURN resume.tex RETURN

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@jruser@resume.tex# 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:

	C-x C-w resume.recover      

Emacs will not auto-save this recovered file until you type:

	M-x auto-save-mode

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.

MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.