Make session persistence module agnostic

They've been removed from feature/workspaces and moved into
core/autoload/sessions, which falls back to desktop.el if persp-mode
isn't present. This also offers a substantial speed up to
restart+restoring and restoring sessions in general.

Also fixes #1210, where the newly spawned frame after doom/restart
wasn't focused.

Introduces the following commands:

- doom/restart
- doom/restart-and-restore
- doom/quickload-session
- doom/quicksave-session
- doom/load-session
- doom/save-session
- +workspace/restore-last-session (alias for doom/quickload-session)

And removes

- +workspace/load-session
- +workspace/save-session
- +workspace/load-last-session (renamed to +workspace/restore-last-session)
- +workspace/restart-emacs-then-restore (replaced by doom/restart-and-restore)
- :ss (ex command)
- :sl (ex command)
This commit is contained in:
Henrik Lissner 2019-03-02 01:04:41 -05:00
parent 735ec58b36
commit 8a90f29c91
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
10 changed files with 181 additions and 143 deletions

View file

@ -1,20 +1,6 @@
;;; feature/workspaces/autoload/evil.el -*- lexical-binding: t; -*-
;;;###if (featurep! :feature evil)
;;;###autoload (autoload '+workspace:save-session "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:save-session (&optional bang name)
"Ex wrapper around `+workspace/save-session'. If BANG, then autosave
(pointless if autosaving/loading is off). If NAME is nil, default to 'last'."
(interactive "<!><a>")
(+workspace/save-session (if bang persp-auto-save-fname name)))
;;;###autoload (autoload '+workspace:load-session "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:load-session (&optional bang name)
"Ex wrapper around `+workspace/load-session'. If BANG, then load last autosave
(pointless if autosaving/loading is off). If NAME is nil, defaults to 'last'."
(interactive "<!><a>")
(+workspace/load-session (if bang persp-auto-save-fname name)))
;;;###autoload (autoload '+workspace:save "feature/workspaces/autoload/evil" nil t)
(evil-define-command +workspace:save (&optional name)
"Ex wrapper around `+workspace/save-session'."