wg: improve autosave + don't restore marks

This commit is contained in:
Henrik Lissner 2016-01-02 15:07:01 -05:00
parent 41b97e0990
commit 69a19ef574
2 changed files with 23 additions and 3 deletions

View file

@ -179,10 +179,22 @@
(narf:workgroup-delete))
(evil-window-delete)))
(defvar narf-wg-autosave-interval 600)
(defvar narf-wg-autosave-timer nil)
;;;###autoload
(defun narf/wg-autosave ()
(when (and (wg-current-session t) (not (minibufferp)))
(shut-up! (wg-save-session))))
;;;###autoload
(defun narf|wg-autosave-enable ()
(setq narf-wg-autosave-timer (run-with-timer 0 narf-wg-autosave-interval 'narf/wg-autosave)))
;;;###autoload
(defun narf|wg-autosave-disable ()
(cancel-timer narf-wg-autosave-timer)
(narf/wg-autosave))
(provide 'defuns-workgroup)
;;; defuns-workgroup.el ends here