Refactor auto-add-buffer functionality

Use built-in mechanism for auto-adding buffers to current workspace,
rather than reinvent the wheel.
This commit is contained in:
Henrik Lissner 2018-06-30 00:57:41 +02:00
parent 537cc9e1ed
commit 83ba527afd
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 7 additions and 23 deletions

View file

@ -484,17 +484,6 @@ the next."
;; Hooks
;;
;;;###autoload
(defun +workspaces|auto-add-buffer ()
"Auto-associate buffers with perspectives upon opening them.
Allows a perspective-specific buffer list via `+workspaces-buffer-list'."
(when (and persp-mode
(not persp-temporarily-display-buffer)
(doom-real-buffer-p))
(persp-add-buffer (current-buffer) (get-current-persp) nil)
(force-mode-line-update t)))
;;;###autoload
(defun +workspaces|delete-associated-workspace (&optional frame)
"Delete workspace associated with current frame.