feature/workspaces: fix hash-table-p error on startup in daemon Emacs

Because persp-mode initializes differently (and later) in daemon/noninteractive
Emacs, +workspaces|init would fail while trying to use persp-mode features in a
broken state.
This commit is contained in:
Henrik Lissner 2018-01-30 16:17:46 -05:00
parent 55cd9817ef
commit 834e92c465
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -25,12 +25,14 @@ renamed.")
:defer t
:init
(defun +workspaces|init ()
(add-hook 'after-make-frame-functions #'+workspaces|init-frame)
(require 'persp-mode)
(persp-mode +1)
(+workspaces|init-frame (selected-frame))
(add-hook 'after-make-frame-functions #'+workspaces|init-frame))
(unless (daemonp)
(+workspaces|init-frame (selected-frame))))
(defun +workspaces|init-frame (frame)
(unless persp-mode
(persp-mode +1))
(unless noninteractive
(let (persp-before-switch-functions persp-activated-functions)
(with-selected-frame frame