Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe add a warning that about calling save-buffe on traditionally safe buffer events? #99

Open
pdkl95 opened this issue Jan 4, 2018 · 0 comments

Comments

@pdkl95
Copy link

pdkl95 commented Jan 4, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant