Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

autosave files on buffer switch

  • Loading branch information...
commit d362ac021747e80f7bdd137739819905af8cd1cb 1 parent 25db0ca
@langmartin authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 rc-emacs.el
View
7 rc-emacs.el
@@ -321,4 +321,11 @@ Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled"
(rc-org-mode-line-less-decoration)
(rc-erc-mode-line-less-decoration))
+(progn
+ ;; autosave buffer on window switch
+ (defadvice switch-to-buffer (before save-buffer-now activate)
+ (when buffer-file-name (save-buffer)))
+ (defadvice other-window (before other-window-now activate)
+ (when buffer-file-name (save-buffer))))
+
(provide 'rc-emacs)
Please sign in to comment.
Something went wrong with that request. Please try again.