I'd also implore you to also reconsider an automatic autosave function - RStudio is a great model. They automatically save all changes to hidden files that are automatically there when you open the program. It's robust to crashes, accidental shut downs etc
Anonymous
added 1 min and 2 min autosave intervals: hg 6149 (4785ff61dd53)