I recently had a Sublime Text user try out Emacs for a while, and he was interested in getting the same auto-save behavior in Emacs.
Basically, he wanted all buffers to beall buffers to be saved whenever the frame lost focus (really saved whenever the frame lost focus, not just backed-up). This includes when switching windows to a completely different application.
I could not find any event that was triggered when switching to a different application. Is there such an event or is there another way to achieve the same behavior?
Note a time based solution was not satisfactory, and neither was the default auto backup behavior. He specifically wanted the associated named filebuffers to be saved out equivalent to(as in save-buffer) for all files.