Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ideally I want to replicate with emacs functionality from TextMate, whereby on loss of focus i.e. I click away from the buffer, my file saves.

If this isn't possible, I want to customize emacs so that it will autosave the file for every character I write. When I say this I don't mean I want to autosave to the ~ backup files. I want to save the file I am currently working on.

I am working on a Fedora VM.

Note I am not looking for a backup or autosave. I want the file I am actually in to save, so that if I loaded the html file I am editing in a web browser it would reflect my new changes without me having to explicitly change it.

share|improve this question

According to this blog post it's possible, but this solution only works with XEmacs. Here's the code:

(defun dld-deselect-frame-hook ()
  (save-some-buffers 1))

(add-hook 'deselect-frame-hook 'dld-deselect-frame-hook)
share|improve this answer
This didn't work for me. – Spencer Jul 3 '12 at 20:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.