4 ms·
(edit: reposted this comment in their bug tracker) You might want to warn people that this enables auto-saving buffers on many buffer/frame events that are usu
by pdkl95 9y ago
(edit: reposted this comment in their bug tracker)
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 https://github.com/thefrontside/frontmacs/blob/master/frontm...
(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.
- maaaats 9y agoAs a general fileditor, it may be scary, yes. But I have this in IntelliJ and love it. Saving is just a useless keystroke for most of my development time. Things are in VCS, and if not, I can also use local history to roll back.
- jeremyjh 9y agoLocal history is the feature that makes this practical. Without it, there will be blood spilled.
- dkersten 9y agoI don’t agree. I used IntelliJ for work for the past two years and I’ve never had any problems with auto saving (in fact, I find it quite convenient, although muscle memory means I still do :w with my vim bindings) and I’ve never seen ever used the local history feature.
- pksadiq 9y ago> (defadvice ... For your information, defadvice is deprecated[0]. Alternatives like advice-add can be used instead. [0] https://www.gnu.org/software/emacs/manual/html_node/elisp/Porting-old-advice.html https://www.gnu.org/software/emacs/manual/html_node/elisp/Po...
- zeveb 9y agoPrelude does this too (I'm guessing that's what inspired them), and I've gotten very used to it. Since emacs maintains a pretty deep edit history, it hasn't caused me issues. But it probably is worth mentioning. I wouldn't go back now that I'm used to it.
- michaelsbradley 9y agoAgreed, and undo-tree-visualize is a nice tool for winding through Emacs edit history, with branching!