Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How can I get emacs to save the buffer automatically every time I switch to another buffer?
(This is similar to this question, where the buffer is saved automatically when Emacs loses focus.)
Here's what I'm using:
(defun ora-save-and-switch-buffer ()
(when (and (buffer-file-name)
(not (bound-and-true-p archive-subfile-mode)))
Required, but never shown