feature/workspace: disable autosave on manual autosave

+workspace/save-session without a name = autosaves the current session.
Doing so now disables autosaving on kill-emacs, otherwise your autosave
would be overwritten when closing Emacs.
This commit is contained in:
Henrik Lissner 2018-04-21 21:03:20 -04:00
parent cb8f12c7da
commit 39836fc15d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -140,12 +140,11 @@ Returns t on success, nil otherwise."
"Save a whole session as NAME. If NAME is nil, use `persp-auto-save-fname'.
Return t on success, nil otherwise."
(let ((fname (expand-file-name (or name persp-auto-save-fname)
persp-save-dir))
(persp-auto-save-opt
(if (or (not name)
(equal name persp-auto-save-fname))
0
persp-auto-save-opt)))
persp-save-dir)))
;; disable auto-saving on kill-emacs if autosaving (i.e. name is nil)
(when (or (not name)
(string= name persp-auto-save-fname))
(setq persp-auto-save-opt 0))
(and (persp-save-state-to-file fname) t)))
;;;###autoload