These are good intentions

What I do is create a temp file when the user changed something, and update that file every time user edits the source. If user saves (or exits without saving), the temp file gets deleted.
If a crash happens (a very rare event, e.g. computer blocked and you had to press the power button for 5 seconds), then on opening the source a dialog pops up asking whether you want the last version.
The logic is simple, and the system has never failed me.
I have a second rescue system, see below. Sometimes it happens to me that I make major edits, and then realise the bloody beast doesn't
build any more because of some deeply hidden glitch. And, bad luck, I already saved the bad version. In this case, I can revert to the last successfully built version. That happens to me once every two or three months, but in those occasions I was very grateful to have that feature
