frontmacs
frontmacs copied to clipboard
Maybe add a warning that about calling save-buffe on traditionally safe buffer events?
You might want to warn people that this enables auto-saving buffers on many buffer/frame events that are usually considered safe.
https://github.com/thefrontside/frontmacs/blob/master/frontmacs-editing.el#L128
(defadvice switch-to-buffer (before save-buffer-now activate)
(when buffer-file-name (save-buffer)))
; the same defadvice is applied to:
; other-window
; windmove-{up,down,left,right}
This absolutely needs a warning.
(add-hook 'focus-out-hook
(lambda () (when buffer-file-name
(save-buffer))))
Also, maybe this should only happen to buffers that are already backed up in the VCS? Saving unknown changes back to the original file whenever the frame looses focus - which can happen due to external, unpredictable events - seems like an accident waiting to happen.