How to automatically save files on lose focus in Emacs
问题 Is it possible to configure Emacs, so that it saves all files when the emacs window loses focus? 回答1: I use this, it will only work if emacs is running under X (like it probably would in something like ubuntu). (when (and (featurep 'x) window-system) (defvar on-blur--saved-window-id 0 "Last known focused window.") (defvar on-blur--timer nil "Timer refreshing known focused window.") (defun on-blur--refresh () "Runs on-blur-hook if emacs has lost focus." (let* ((active-window (x-window-property